mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Bug 971720 - Adjust the source pattern transform when masking with RotatedBuffer to take the mask transform into account. r=roc
This commit is contained in:
parent
0827270cd6
commit
34ea3f441f
@ -125,17 +125,24 @@ RotatedBuffer::DrawBufferQuadrant(gfx::DrawTarget* aTarget,
|
||||
}
|
||||
|
||||
if (aMask) {
|
||||
Matrix oldTransform = aTarget->GetTransform();
|
||||
|
||||
// Transform from user -> buffer space.
|
||||
Matrix transform;
|
||||
transform.Translate(quadrantTranslation.x, quadrantTranslation.y);
|
||||
|
||||
Matrix inverseMask = *aMaskTransform;
|
||||
inverseMask.Invert();
|
||||
|
||||
transform *= oldTransform;
|
||||
transform *= inverseMask;
|
||||
|
||||
#ifdef MOZ_GFX_OPTIMIZE_MOBILE
|
||||
SurfacePattern source(snapshot, ExtendMode::CLAMP, transform, Filter::POINT);
|
||||
#else
|
||||
SurfacePattern source(snapshot, ExtendMode::CLAMP, transform);
|
||||
#endif
|
||||
|
||||
Matrix oldTransform = aTarget->GetTransform();
|
||||
aTarget->SetTransform(*aMaskTransform);
|
||||
aTarget->MaskSurface(source, aMask, Point(0, 0), DrawOptions(aOpacity, aOperator));
|
||||
aTarget->SetTransform(oldTransform);
|
||||
|
Loading…
Reference in New Issue
Block a user