Bug 1210560 - Followup 3: Fix an assertion that can occur on mochitest bc4. r=jrmuizel on a CLOSED TREE
--- a/gfx/thebes/gfxContext.cpp
+++ b/gfx/thebes/gfxContext.cpp
@@ -785,24 +785,24 @@ gfxContext::SetFontSmoothingBackgroundCo
Color
gfxContext::GetFontSmoothingBackgroundColor()
{
return CurrentState().fontSmoothingBackgroundColor;
}
// masking
void
-gfxContext::Mask(SourceSurface* aSurface, const Matrix& aTransform)
+gfxContext::Mask(SourceSurface* aSurface, Float aAlpha, const Matrix& aTransform)
{
Matrix old = mTransform;
Matrix mat = aTransform * mTransform;
ChangeTransform(mat);
mDT->MaskSurface(PatternFromState(this), aSurface, Point(),
- DrawOptions(1.0f, CurrentState().op, CurrentState().aaMode));
+ DrawOptions(aAlpha, CurrentState().op, CurrentState().aaMode));
ChangeTransform(old);
}
void
gfxContext::Mask(gfxASurface *surface, const gfxPoint& offset)
{
PROFILER_LABEL("gfxContext", "Mask",
js::ProfileEntry::Category::GRAPHICS);
@@ -995,18 +995,17 @@ gfxContext::PopGroupAndBlend()
CompositionOp oldOp = GetOp();
SetOp(CompositionOp::OP_OVER);
if (mask) {
if (!maskTransform.HasNonTranslation()) {
Mask(mask, opacity, Point(maskTransform._31, maskTransform._32));
} else {
- MOZ_ASSERT(opacity == 1.0f);
- Mask(mask, maskTransform);
+ Mask(mask, opacity, maskTransform);
}
} else {
Paint(opacity);
}
SetOp(oldOp);
}
--- a/gfx/thebes/gfxContext.h
+++ b/gfx/thebes/gfxContext.h
@@ -310,17 +310,18 @@ public:
/**
** Painting with a Mask
**/
/**
* Like Paint, except that it only draws the source where pattern is
* non-transparent.
*/
- void Mask(mozilla::gfx::SourceSurface *aSurface, const mozilla::gfx::Matrix& aTransform);
+ void Mask(mozilla::gfx::SourceSurface *aSurface, mozilla::gfx::Float aAlpha, const mozilla::gfx::Matrix& aTransform);
+ void Mask(mozilla::gfx::SourceSurface *aSurface, const mozilla::gfx::Matrix& aTransform) { Mask(aSurface, 1.0f, aTransform); }
/**
* Shorthand for creating a pattern and calling the pattern-taking
* variant of Mask.
*/
void Mask(gfxASurface *surface, const gfxPoint& offset = gfxPoint(0.0, 0.0));
void Mask(mozilla::gfx::SourceSurface *surface, float alpha = 1.0f, const mozilla::gfx::Point& offset = mozilla::gfx::Point());