Bug 1157984 - Part 3: Correct bounding box transformations to support projections and correct clipping when transforming behind the camera,r=vlad

- Update callsites of Matrix4x4::TransformBounds to use
  Matrix4x4::TransformAndClipBounds.
This commit is contained in:
Kearwood (Kip) Gilbert
2015-08-06 17:26:09 -07:00
parent 2c46bd8443
commit 0cac799a77
10 changed files with 58 additions and 31 deletions

View File

@@ -761,14 +761,12 @@ Transform3D(RefPtr<SourceSurface> aSource,
const Matrix4x4& aTransform,
gfxRect& aDestRect)
{
// Find the transformed rectangle of our layer.
gfxRect offsetRect = aBounds;
offsetRect.TransformBounds(aTransform);
// Intersect the transformed layer with the destination rectangle.
// Find the transformed rectangle of our layer, intersected with the
// destination rectangle.
// This is in device space since we have an identity transform set on aTarget.
aDestRect = aDest->GetClipExtents();
aDestRect.IntersectRect(aDestRect, offsetRect);
aDestRect = ThebesRect(aTransform.TransformAndClipBounds(
ToRectDouble(aBounds),
ToRectDouble(aDest->GetClipExtents())));
aDestRect.RoundOut();
// Create a surface the size of the transformed object.