зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 9bbb30ec51f5
This commit is contained in:
Родитель
f2d3346139
Коммит
78adb06e98
|
@ -88,11 +88,6 @@ public:
|
|||
|
||||
namespace {
|
||||
|
||||
/**
|
||||
* Active layers smaller than this in each dimension are treated as inactive.
|
||||
*/
|
||||
static const int MIN_ACTIVE_LAYER_SIZE = 16;
|
||||
|
||||
static void DestroyRegion(void* aPropertyValue)
|
||||
{
|
||||
delete static_cast<nsRegion*>(aPropertyValue);
|
||||
|
@ -1333,7 +1328,7 @@ ContainerState::ProcessDisplayItems(const nsDisplayList& aList,
|
|||
NS_ASSERTION(appUnitsPerDevPixel == AppUnitsPerDevPixel(item),
|
||||
"items in a container layer should all have the same app units per dev pixel");
|
||||
|
||||
nsIntRect itemVisibleRectPixels =
|
||||
nsIntRect itemVisibleRect =
|
||||
item->GetVisibleRect().ScaleToOutsidePixels(
|
||||
mParameters.mXScale, mParameters.mYScale, appUnitsPerDevPixel);
|
||||
nsRect itemContent = item->GetBounds(mBuilder);
|
||||
|
@ -1351,24 +1346,22 @@ ContainerState::ProcessDisplayItems(const nsDisplayList& aList,
|
|||
// Assign the item to a layer
|
||||
if (layerState == LAYER_ACTIVE_FORCE ||
|
||||
layerState == LAYER_ACTIVE_EMPTY ||
|
||||
(layerState == LAYER_ACTIVE &&
|
||||
(aClip.mRoundedClipRects.IsEmpty() ||
|
||||
// We can use the visible rect here only because the item has its own
|
||||
// layer, like the comment below.
|
||||
!aClip.IsRectClippedByRoundedCorner(item->GetVisibleRect())) &&
|
||||
!(itemVisibleRectPixels.Size() < nsIntSize(MIN_ACTIVE_LAYER_SIZE, MIN_ACTIVE_LAYER_SIZE)))) {
|
||||
layerState == LAYER_ACTIVE && (aClip.mRoundedClipRects.IsEmpty() ||
|
||||
// We can use the visible rect here only because the item has its own
|
||||
// layer, like the comment below.
|
||||
!aClip.IsRectClippedByRoundedCorner(item->GetVisibleRect()))) {
|
||||
|
||||
// LAYER_ACTIVE_EMPTY means the layer is created just for its metadata.
|
||||
// We should never see an empty layer with any visible content!
|
||||
NS_ASSERTION(layerState != LAYER_ACTIVE_EMPTY ||
|
||||
itemVisibleRectPixels.IsEmpty(),
|
||||
itemVisibleRect.IsEmpty(),
|
||||
"State is LAYER_ACTIVE_EMPTY but visible rect is not.");
|
||||
|
||||
// If the item would have its own layer but is invisible, just hide it.
|
||||
// Note that items without their own layers can't be skipped this
|
||||
// way, since their ThebesLayer may decide it wants to draw them
|
||||
// into its buffer even if they're currently covered.
|
||||
if (itemVisibleRectPixels.IsEmpty() && layerState != LAYER_ACTIVE_EMPTY) {
|
||||
if (itemVisibleRect.IsEmpty() && layerState != LAYER_ACTIVE_EMPTY) {
|
||||
InvalidateForLayerChange(item, nsnull);
|
||||
continue;
|
||||
}
|
||||
|
@ -1406,14 +1399,14 @@ ContainerState::ProcessDisplayItems(const nsDisplayList& aList,
|
|||
}
|
||||
ThebesLayerData* data = GetTopThebesLayerData();
|
||||
if (data) {
|
||||
data->mVisibleAboveRegion.Or(data->mVisibleAboveRegion, itemVisibleRectPixels);
|
||||
data->mVisibleAboveRegion.Or(data->mVisibleAboveRegion, itemVisibleRect);
|
||||
// Add the entire bounds rect to the mDrawAboveRegion.
|
||||
// The visible region may be excluding opaque content above the
|
||||
// item, and we need to ensure that that content is not placed
|
||||
// in a ThebesLayer below the item!
|
||||
data->mDrawAboveRegion.Or(data->mDrawAboveRegion, itemDrawRect);
|
||||
}
|
||||
RestrictVisibleRegionForLayer(ownLayer, itemVisibleRectPixels);
|
||||
RestrictVisibleRegionForLayer(ownLayer, itemVisibleRect);
|
||||
ContainerLayer* oldContainer = ownLayer->GetParent();
|
||||
if (oldContainer && oldContainer != mContainerLayer) {
|
||||
oldContainer->RemoveChild(ownLayer);
|
||||
|
@ -1427,7 +1420,7 @@ ContainerState::ProcessDisplayItems(const nsDisplayList& aList,
|
|||
mBuilder->LayerBuilder()->AddLayerDisplayItem(ownLayer, item, layerState);
|
||||
} else {
|
||||
nsRefPtr<ThebesLayer> thebesLayer =
|
||||
FindThebesLayerFor(item, itemVisibleRectPixels, itemDrawRect, aClip,
|
||||
FindThebesLayerFor(item, itemVisibleRect, itemDrawRect, aClip,
|
||||
activeScrolledRoot);
|
||||
|
||||
thebesLayer->SetIsFixedPosition(!nsLayoutUtils::ScrolledByViewportScrolling(
|
||||
|
|
Загрузка…
Ссылка в новой задаче