author | Robert O'Callahan <robert@ocallahan.org> |
Wed, 26 Oct 2011 15:55:51 +1300 | |
changeset 79222 | 8a1f0927d98af71a85b30743fa5d2328da430d9c |
parent 79216 | 9bbb30ec51f5ab0e155c092ef8e1d03893331881 |
child 79223 | 98013fe19dcb4b6f89e0c92fc7f5c42dbcf5c111 |
push id | 21380 |
push user | bmo@edmorley.co.uk |
push date | Wed, 26 Oct 2011 23:31:27 +0000 |
treeherder | autoland@16a8d2ab5240 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
milestone | 10.0a1 |
backs out | 9bbb30ec51f5ab0e155c092ef8e1d03893331881 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/layout/base/FrameLayerBuilder.cpp +++ b/layout/base/FrameLayerBuilder.cpp @@ -83,21 +83,16 @@ public: nsTHashtable<FrameLayerBuilder::DisplayItemDataEntry> mFramesWithLayers; bool mInvalidateAllLayers; /** Layer manager we belong to, we hold a reference to this object. */ nsRefPtr<LayerManager> mLayerManager; }; 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); } /** * This property represents a region that should be invalidated in every * ThebesLayer child whose parent ContainerLayer is associated with the @@ -1328,17 +1323,17 @@ ContainerState::ProcessDisplayItems(cons FrameLayerBuilder::Clip childClip(aClip, item); ProcessDisplayItems(*item->GetList(), childClip); continue; } 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); if (aClip.mHaveClipRect) { itemContent.IntersectRect(aClip.mClipRect, itemContent); } mBounds.UnionRect(mBounds, itemContent); nsIntRect itemDrawRect = itemContent.ScaleToOutsidePixels( @@ -1346,34 +1341,32 @@ ContainerState::ProcessDisplayItems(cons LayerState layerState = item->GetLayerState(mBuilder, mManager); nsIFrame* activeScrolledRoot = nsLayoutUtils::GetActiveScrolledRootFor(item, mBuilder); // 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; } aClip.RemoveRoundedCorners(); // Just use its layer. nsRefPtr<Layer> ownLayer = item->BuildLayer(mBuilder, mManager, mParameters); @@ -1401,38 +1394,38 @@ ContainerState::ProcessDisplayItems(cons // It has its own layer. Update that layer's clip and visible rects. if (aClip.mHaveClipRect) { ownLayer->IntersectClipRect( aClip.mClipRect.ScaleToNearestPixels( mParameters.mXScale, mParameters.mYScale, appUnitsPerDevPixel)); } 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); } NS_ASSERTION(!mNewChildLayers.Contains(ownLayer), "Layer already in list???"); InvalidateForLayerChange(item, ownLayer); mNewChildLayers.AppendElement(ownLayer); 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( activeScrolledRoot, mBuilder)); InvalidateForLayerChange(item, thebesLayer); mBuilder->LayerBuilder()->