Skip to content

Commit

Permalink
Backed out changeset 9fe78d3eab37 (bug 1313276) for conflicts with mo…
Browse files Browse the repository at this point in the history
…zilla-central merge
  • Loading branch information
BavarianTomcat committed Dec 22, 2016
1 parent e2ad30b commit 3a93b8f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 30 deletions.
7 changes: 6 additions & 1 deletion layout/painting/nsDisplayList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7353,7 +7353,12 @@ bool nsDisplayMask::ShouldPaintOnMaskLayer(LayerManager* aManager)
nsSVGUtils::MaskUsage maskUsage;
nsSVGUtils::DetermineMaskUsage(mFrame, mHandleOpacity, maskUsage);

if (maskUsage.opacity != 1.0) {
if (!maskUsage.shouldGenerateMaskLayer && !maskUsage.shouldApplyClipPath &&
!maskUsage.shouldGenerateClipMaskLayer) {
return false;
}

if (maskUsage.opacity != 1.0 || maskUsage.shouldApplyBasicShape) {
return false;
}

Expand Down
32 changes: 3 additions & 29 deletions layout/svg/nsSVGIntegrationUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,9 @@ nsSVGIntegrationUtils::PaintMask(const PaintFramesParams& aParams)
nsSVGUtils::MaskUsage maskUsage;
nsSVGUtils::DetermineMaskUsage(aParams.frame, aParams.handleOpacity,
maskUsage);
MOZ_ASSERT(maskUsage.shouldGenerateMaskLayer ||
maskUsage.shouldApplyClipPath ||
maskUsage.shouldGenerateClipMaskLayer);

nsIFrame* frame = aParams.frame;
if (!ValidateSVGFrame(frame)) {
Expand Down Expand Up @@ -789,27 +792,8 @@ nsSVGIntegrationUtils::PaintMask(const PaintFramesParams& aParams)
SurfaceFormat::A8);
}

if (maskUsage.shouldApplyBasicShape) {
matSR.SetContext(&ctx);

SetupContextMatrix(firstFrame, aParams, offsetToBoundingBox,
offsetToUserSpace, false);

nsCSSClipPathInstance::ApplyBasicShapeClip(ctx, frame);
if (!maskUsage.shouldGenerateMaskLayer) {
// Only have basic-shape clip-path effect. Fill clipped region by
// opaque white.
ctx.SetColor(Color(0.0, 0.0, 0.0, 1.0));
ctx.Fill();
ctx.PopClip();

return result;
}
}

// Paint mask onto ctx.
if (maskUsage.shouldGenerateMaskLayer) {
matSR.Restore();
matSR.SetContext(&ctx);

SetupContextMatrix(frame, aParams, offsetToBoundingBox,
Expand All @@ -821,27 +805,17 @@ nsSVGIntegrationUtils::PaintMask(const PaintFramesParams& aParams)
firstFrame->StyleContext(), maskFrames,
ctx.CurrentMatrix(), offsetToUserSpace);
if (result != DrawResult::SUCCESS) {
if (maskUsage.shouldApplyBasicShape) {
ctx.PopClip();
}

return result;
}
}

if (maskUsage.shouldApplyBasicShape) {
ctx.PopClip();
return result;
}

// Paint clip-path onto ctx.
if (maskUsage.shouldGenerateClipMaskLayer || maskUsage.shouldApplyClipPath) {
matSR.Restore();
matSR.SetContext(&ctx);

SetupContextMatrix(firstFrame, aParams, offsetToBoundingBox,
offsetToUserSpace, false);

Matrix clipMaskTransform;
gfxMatrix cssPxToDevPxMatrix = GetCSSPxToDevPxMatrix(frame);

Expand Down

0 comments on commit 3a93b8f

Please sign in to comment.