mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 13:55:43 +00:00
Backed out changeset a2f133998adf (bug 1323912)
This commit is contained in:
parent
d569188dd7
commit
6989ec2d7a
@ -420,6 +420,22 @@ private:
|
||||
nsPoint mOffset;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns true if any of the masks is an image mask (and not an SVG mask).
|
||||
*/
|
||||
static bool
|
||||
HasNonSVGMask(const nsTArray<nsSVGMaskFrame*>& aMaskFrames)
|
||||
{
|
||||
for (size_t i = 0; i < aMaskFrames.Length() ; i++) {
|
||||
nsSVGMaskFrame *maskFrame = aMaskFrames[i];
|
||||
if (!maskFrame) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
typedef nsSVGIntegrationUtils::PaintFramesParams PaintFramesParams;
|
||||
|
||||
/**
|
||||
@ -434,7 +450,6 @@ PaintMaskSurface(const PaintFramesParams& aParams,
|
||||
{
|
||||
MOZ_ASSERT(aMaskFrames.Length() > 0);
|
||||
MOZ_ASSERT(aMaskDT->GetFormat() == SurfaceFormat::A8);
|
||||
MOZ_ASSERT(aOpacity == 1.0 || aMaskFrames.Length() == 1);
|
||||
|
||||
const nsStyleSVGReset *svgReset = aSC->StyleSVGReset();
|
||||
gfxMatrix cssPxToDevPxMatrix =
|
||||
@ -494,8 +509,7 @@ PaintMaskSurface(const PaintFramesParams& aParams,
|
||||
aParams.frame,
|
||||
aParams.builder->GetBackgroundPaintFlags() |
|
||||
nsCSSRendering::PAINTBG_MASK_IMAGE,
|
||||
i, compositionOp,
|
||||
aOpacity);
|
||||
i, compositionOp);
|
||||
|
||||
result =
|
||||
nsCSSRendering::PaintStyleImageLayerWithSC(params, aSC,
|
||||
@ -566,11 +580,10 @@ CreateAndPaintMaskSurface(const PaintFramesParams& aParams,
|
||||
return paintResult;
|
||||
}
|
||||
|
||||
// We can paint mask along with opacity only if
|
||||
// 1. There is only one mask, or
|
||||
// 2. No overlap among masks.
|
||||
// Collision detect in #2 is not that trivial, we only accept #1 here.
|
||||
paintResult.opacityApplied = (aMaskFrames.Length() == 1);
|
||||
// Set aAppliedOpacity as true only if all mask layers are svg mask.
|
||||
// In this case, we will apply opacity into the final mask surface, so the
|
||||
// caller does not need to apply it again.
|
||||
paintResult.opacityApplied = !HasNonSVGMask(aMaskFrames);
|
||||
|
||||
// Set context's matrix on maskContext, offset by the maskSurfaceRect's
|
||||
// position. This makes sure that we combine the masks in device space.
|
||||
|
Loading…
Reference in New Issue
Block a user