Bug 856807. Add apparently-pointless call to SetClipRect(nullptr) to avoid Android regression. r=mattwoodrow
This commit is contained in:
@@ -1298,8 +1298,7 @@ ContainerState::CreateOrRecycleThebesLayer(const nsIFrame* aActiveScrolledRoot,
|
||||
// Recycle a layer
|
||||
layer = mRecycledThebesLayers[mNextFreeRecycledThebesLayer];
|
||||
++mNextFreeRecycledThebesLayer;
|
||||
// Clear clip rect and mask layer so we don't accidentally stay clipped.
|
||||
// We will reapply any necessary clipping.
|
||||
// Clear mask layer so we don't accidentally stay masked.
|
||||
layer->SetMaskLayer(nullptr);
|
||||
|
||||
data = static_cast<ThebesDisplayItemLayerUserData*>
|
||||
@@ -1541,14 +1540,15 @@ ContainerState::PopThebesLayerData()
|
||||
ThebesLayerData* data = mThebesLayerDataStack[lastIndex];
|
||||
|
||||
nsRefPtr<Layer> layer;
|
||||
ThebesLayer* thebesLayer = data->mLayer;
|
||||
nsRefPtr<ImageContainer> imageContainer = data->CanOptimizeImageLayer(mBuilder);
|
||||
|
||||
if ((data->mIsSolidColorInVisibleRegion || imageContainer) &&
|
||||
data->mLayer->GetValidRegion().IsEmpty()) {
|
||||
thebesLayer->GetValidRegion().IsEmpty()) {
|
||||
NS_ASSERTION(!(data->mIsSolidColorInVisibleRegion && imageContainer),
|
||||
"Can't be a solid color as well as an image!");
|
||||
if (imageContainer) {
|
||||
nsRefPtr<ImageLayer> imageLayer = CreateOrRecycleImageLayer(data->mLayer);
|
||||
nsRefPtr<ImageLayer> imageLayer = CreateOrRecycleImageLayer(thebesLayer);
|
||||
imageLayer->SetContainer(imageContainer);
|
||||
data->mImage->ConfigureLayer(imageLayer, mParameters.mOffset);
|
||||
imageLayer->SetPostScale(mParameters.mXScale,
|
||||
@@ -1564,13 +1564,13 @@ ContainerState::PopThebesLayerData()
|
||||
mLayerBuilder->StoreOptimizedLayerForFrame(data->mImage,
|
||||
imageLayer);
|
||||
} else {
|
||||
nsRefPtr<ColorLayer> colorLayer = CreateOrRecycleColorLayer(data->mLayer);
|
||||
colorLayer->SetIsFixedPosition(data->mLayer->GetIsFixedPosition());
|
||||
nsRefPtr<ColorLayer> colorLayer = CreateOrRecycleColorLayer(thebesLayer);
|
||||
colorLayer->SetIsFixedPosition(thebesLayer->GetIsFixedPosition());
|
||||
colorLayer->SetColor(data->mSolidColor);
|
||||
|
||||
// Copy transform
|
||||
colorLayer->SetBaseTransform(data->mLayer->GetBaseTransform());
|
||||
colorLayer->SetPostScale(data->mLayer->GetPostXScale(), data->mLayer->GetPostYScale());
|
||||
colorLayer->SetBaseTransform(thebesLayer->GetBaseTransform());
|
||||
colorLayer->SetPostScale(thebesLayer->GetPostXScale(), thebesLayer->GetPostYScale());
|
||||
|
||||
// Clip colorLayer to its visible region, since ColorLayers are
|
||||
// allowed to paint outside the visible region. Here we rely on the
|
||||
@@ -1592,13 +1592,16 @@ ContainerState::PopThebesLayerData()
|
||||
|
||||
// Hide the ThebesLayer. We leave it in the layer tree so that we
|
||||
// can find and recycle it later.
|
||||
// XXX removing the call to SetClipRect(nullptr) causes a significant tsvg_nochrome
|
||||
// regression on Android. See bug 856807.
|
||||
thebesLayer->SetClipRect(nullptr);
|
||||
nsIntRect emptyRect;
|
||||
data->mLayer->SetClipRect(&emptyRect);
|
||||
data->mLayer->SetVisibleRegion(nsIntRegion());
|
||||
thebesLayer->SetClipRect(&emptyRect);
|
||||
thebesLayer->SetVisibleRegion(nsIntRegion());
|
||||
} else {
|
||||
layer = data->mLayer;
|
||||
layer = thebesLayer;
|
||||
thebesLayer->SetClipRect(nullptr);
|
||||
imageContainer = nullptr;
|
||||
layer->SetClipRect(nullptr);
|
||||
}
|
||||
|
||||
gfxMatrix transform;
|
||||
|
||||
Reference in New Issue
Block a user