Bug 952011 - Use Untransform API to safetly untransform points when we have a projective matrix. r=roc

This commit is contained in:
Matt Woodrow
2014-01-29 13:10:35 +13:00
parent 1c813674b6
commit eeedab7831
5 changed files with 73 additions and 23 deletions

View File

@@ -1561,7 +1561,10 @@ SetVisibleRegionForLayer(Layer* aLayer, const nsIntRegion& aLayerVisibleRegion,
// for the layer, so it doesn't really matter what we do here
gfxRect itemVisible(aRestrictToRect.x, aRestrictToRect.y,
aRestrictToRect.width, aRestrictToRect.height);
gfxRect layerVisible = transform.Inverse().ProjectRectBounds(itemVisible);
nsIntRect childBounds = aLayerVisibleRegion.GetBounds();
gfxRect childGfxBounds(childBounds.x, childBounds.y,
childBounds.width, childBounds.height);
gfxRect layerVisible = transform.UntransformBounds(itemVisible, childGfxBounds);
layerVisible.RoundOut();
nsIntRect visibleRect;