Bug 952977: Convert SnapTransforms to gfx::Matrix r=nical

This commit is contained in:
David Zbarsky
2014-01-27 10:27:20 -05:00
parent 6532ec4040
commit ec82eb78ca
9 changed files with 134 additions and 64 deletions

View File

@@ -106,7 +106,8 @@ ImageLayerComposite::RenderLayer(const nsIntRect& aClipRect)
void
ImageLayerComposite::ComputeEffectiveTransforms(const gfx3DMatrix& aTransformToSurface)
{
gfx3DMatrix local = GetLocalTransform();
gfx::Matrix4x4 local;
gfx::ToMatrix4x4(GetLocalTransform(), local);
// Snap image edges to pixel boundaries
gfxRect sourceRect(0, 0, 0, 0);
@@ -129,10 +130,11 @@ ImageLayerComposite::ComputeEffectiveTransforms(const gfx3DMatrix& aTransformToS
// This makes our snapping equivalent to what would happen if our content
// was drawn into a ThebesLayer (gfxContext would snap using the local
// transform, then we'd snap again when compositing the ThebesLayer).
gfx3DMatrix snappedTransform =
gfx::Matrix4x4 transformToSurface;
gfx::ToMatrix4x4(aTransformToSurface, transformToSurface);
mEffectiveTransform =
SnapTransform(local, sourceRect, nullptr) *
SnapTransformTranslation(aTransformToSurface, nullptr);
gfx::ToMatrix4x4(snappedTransform, mEffectiveTransform);
SnapTransformTranslation(transformToSurface, nullptr);
ComputeEffectiveTransformForMaskLayer(aTransformToSurface);
}