From f82e98ade385f1cd60b6da9b22c0592301af1cc8 Mon Sep 17 00:00:00 2001 From: Chris Lord Date: Fri, 11 Apr 2014 13:23:09 +0100 Subject: [PATCH] Bug 993475 - Support masks on color layers in BasicCompositor. r=mattwoodrow --- gfx/layers/basic/BasicCompositor.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/gfx/layers/basic/BasicCompositor.cpp b/gfx/layers/basic/BasicCompositor.cpp index e9acebdc32c1..a4c86184c71d 100644 --- a/gfx/layers/basic/BasicCompositor.cpp +++ b/gfx/layers/basic/BasicCompositor.cpp @@ -318,9 +318,19 @@ BasicCompositor::DrawQuad(const gfx::Rect& aRect, EffectSolidColor* effectSolidColor = static_cast(aEffectChain.mPrimaryEffect.get()); - dest->FillRect(aRect, - ColorPattern(effectSolidColor->mColor), - DrawOptions(aOpacity)); + if (sourceMask) { + dest->PushClipRect(aRect); + Matrix dtTransform = dest->GetTransform(); + dest->SetTransform(maskTransform); + dest->MaskSurface(ColorPattern(effectSolidColor->mColor), + sourceMask, Point(), DrawOptions(aOpacity)); + dest->SetTransform(dtTransform); + dest->PopClip(); + } else { + dest->FillRect(aRect, + ColorPattern(effectSolidColor->mColor), + DrawOptions(aOpacity)); + } break; } case EFFECT_RGB: {