Bug 1478815 part 2 - Make DrawTargetDual aware of component alpha clearing. r=bas

This commit changes the behavior of DrawTargetDual::Clear to be aware that
it has on-white and on-black buffers, and perform clearing appropriately.

This is slightly against what the DrawTarget documentation says the method
should do, but it allows us to move another paint thread operation into
DrawTargetCapture and simplify our ContentClient implementations.

I haven't seen any obvious breakage with this, and reftests are green.

An alternative would be to add a separate Clear method with documented
difference here.

MozReview-Commit-ID: 65CzcxlRqv7

--HG--
extra : rebase_source : 299adbb02e79f66f7d6860c5fe86784bad8332f8
extra : source : 3dc47f17fa446bb7f2b5876753f8271a93c0e0c8
This commit is contained in:
Ryan Hunt 2018-08-01 12:45:35 -05:00
Родитель 53537230f9
Коммит 9c419c4c91
2 изменённых файлов: 9 добавлений и 1 удалений

Просмотреть файл

@ -125,6 +125,13 @@ DrawTargetDual::MaskSurface(const Pattern &aSource,
mB->MaskSurface(*source.mB, mask.mB, aOffset, aOptions);
}
void
DrawTargetDual::ClearRect(const Rect &aRect)
{
mA->FillRect(aRect, ColorPattern(Color(0.0, 0.0, 0.0, 1.0)));
mB->FillRect(aRect, ColorPattern(Color(1.0, 1.0, 1.0, 1.0)));
}
void
DrawTargetDual::CopySurface(SourceSurface *aSurface, const IntRect &aSourceRect,
const IntPoint &aDestination)

Просмотреть файл

@ -58,7 +58,6 @@ public:
FORWARD_FUNCTION1(PushClipRect, const Rect &, aRect)
FORWARD_FUNCTION(PopClip)
FORWARD_FUNCTION(PopLayer)
FORWARD_FUNCTION1(ClearRect, const Rect &, aRect)
virtual void SetTransform(const Matrix &aTransform) override {
mTransform = aTransform;
@ -87,6 +86,8 @@ public:
const Color &aColor, const Point &aOffset,
Float aSigma, CompositionOp aOp) override;
virtual void ClearRect(const Rect &aRect) override;
virtual void CopySurface(SourceSurface *aSurface, const IntRect &aSourceRect,
const IntPoint &aDestination) override;