mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 948765 - Implement BasicColorLayer::Paint. r=nical
This commit is contained in:
parent
09df5cf35c
commit
298876b747
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user