mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 21:05:36 +00:00
Bug 641770. Ensure that the cliprect for a layer is interpreted in the coordinate system of its container in MarkLeafLayersCoveredByOpaque. r=bas
This commit is contained in:
parent
2030c35c8b
commit
023d0fa5da
@ -1259,6 +1259,7 @@ TransformIntRect(nsIntRect& aRect, const gfxMatrix& aMatrix,
|
|||||||
// This implementation assumes that GetEffectiveTransform transforms
|
// This implementation assumes that GetEffectiveTransform transforms
|
||||||
// all layers to the same coordinate system. It can't be used as is
|
// all layers to the same coordinate system. It can't be used as is
|
||||||
// by accelerated layers because of intermediate surfaces.
|
// by accelerated layers because of intermediate surfaces.
|
||||||
|
// aClipRect and aRegion are in that global coordinate system.
|
||||||
static void
|
static void
|
||||||
MarkLeafLayersCoveredByOpaque(Layer* aLayer, const nsIntRect& aClipRect,
|
MarkLeafLayersCoveredByOpaque(Layer* aLayer, const nsIntRect& aClipRect,
|
||||||
nsIntRegion& aRegion)
|
nsIntRegion& aRegion)
|
||||||
@ -1267,7 +1268,6 @@ MarkLeafLayersCoveredByOpaque(Layer* aLayer, const nsIntRect& aClipRect,
|
|||||||
BasicImplData* data = ToData(aLayer);
|
BasicImplData* data = ToData(aLayer);
|
||||||
data->SetCoveredByOpaque(PR_FALSE);
|
data->SetCoveredByOpaque(PR_FALSE);
|
||||||
|
|
||||||
const nsIntRect* clipRect = aLayer->GetEffectiveClipRect();
|
|
||||||
nsIntRect newClipRect(aClipRect);
|
nsIntRect newClipRect(aClipRect);
|
||||||
|
|
||||||
// Allow aLayer or aLayer's descendants to cover underlying layers
|
// Allow aLayer or aLayer's descendants to cover underlying layers
|
||||||
@ -1277,14 +1277,21 @@ MarkLeafLayersCoveredByOpaque(Layer* aLayer, const nsIntRect& aClipRect,
|
|||||||
newClipRect.SetRect(0, 0, 0, 0);
|
newClipRect.SetRect(0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (clipRect) {
|
{
|
||||||
nsIntRect cr = *clipRect;
|
const nsIntRect* clipRect = aLayer->GetEffectiveClipRect();
|
||||||
gfxMatrix tr;
|
if (clipRect) {
|
||||||
if (aLayer->GetEffectiveTransform().Is2D(&tr)) {
|
nsIntRect cr = *clipRect;
|
||||||
TransformIntRect(cr, tr, ToInsideIntRect);
|
// clipRect is in the container's coordinate system. Get it into the
|
||||||
|
// global coordinate system.
|
||||||
|
if (aLayer->GetParent()) {
|
||||||
|
gfxMatrix tr;
|
||||||
|
if (aLayer->GetParent()->GetEffectiveTransform().Is2D(&tr)) {
|
||||||
|
TransformIntRect(cr, tr, ToInsideIntRect);
|
||||||
|
} else {
|
||||||
|
cr.SetRect(0, 0, 0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
newClipRect.IntersectRect(newClipRect, cr);
|
newClipRect.IntersectRect(newClipRect, cr);
|
||||||
} else {
|
|
||||||
newClipRect.SetRect(0, 0, 0, 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user