diff --git a/gfx/layers/basic/BasicColorLayer.cpp b/gfx/layers/basic/BasicColorLayer.cpp index 7f08217a9a3..b170dc737af 100644 --- a/gfx/layers/basic/BasicColorLayer.cpp +++ b/gfx/layers/basic/BasicColorLayer.cpp @@ -9,6 +9,7 @@ #include "BasicLayers.h" // for BasicLayerManager #include "gfxContext.h" // for gfxContext, etc #include "gfxRect.h" // for gfxRect +#include "gfx2DGlue.h" #include "mozilla/mozalloc.h" // for operator new #include "nsAutoPtr.h" // for nsRefPtr #include "nsCOMPtr.h" // for already_AddRefed @@ -45,13 +46,27 @@ public: virtual void Paint(DrawTarget* aTarget, SourceSurface* aMaskSurface) { - DeprecatedPaint(new gfxContext(aTarget), nullptr); //TODO: null->aMaskSurface + if (IsHidden()) { + return; + } + CompositionOp mixBlendMode = GetEffectiveMixBlendMode(); + CompositionOp op = + mixBlendMode != CompositionOp::OP_OVER ? mixBlendMode : GetOperator(); + + DrawOptions opts = DrawOptions(); + opts.mCompositionOp = op; + ColorPattern pattern(ToColor(mColor)); + aTarget->MaskSurface(pattern, + aMaskSurface, + ToIntRect(GetBounds()).TopLeft(), + opts); } virtual void DeprecatedPaint(gfxContext* aContext, Layer* aMaskLayer) { - if (IsHidden()) + if (IsHidden()) { return; + } gfxContextAutoSaveRestore contextSR(aContext); gfxContext::GraphicsOperator mixBlendMode = DeprecatedGetEffectiveMixBlendMode(); AutoSetOperator setOptimizedOperator(aContext,