Bug 1313276 - Part 2. Add comment for bug 1323912. r=mstange
☠☠ backed out by 51e47188c132 ☠ ☠
authorcku <cku@mozilla.com>
Fri, 16 Dec 2016 12:52:21 +0800
changeset 450770 e505479a60e5660ef653d346920bb4405ed30e15
parent 450769 efb9edd878f0ff9ce06b8921098d7f284081b485
child 450771 18a793f65dcd0607536708270c1e11fb50ec7df7
push id38944
push userbmo:leftysolara@gmail.com
push dateSun, 18 Dec 2016 16:01:15 +0000
reviewersmstange
bugs1313276, 1323912
milestone53.0a1
Bug 1313276 - Part 2. Add comment for bug 1323912. r=mstange MozReview-Commit-ID: CetQxWIr1sq
layout/painting/nsDisplayList.cpp
layout/svg/nsSVGIntegrationUtils.cpp
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -7348,16 +7348,18 @@ bool nsDisplayMask::ShouldPaintOnMaskLay
 {
   if (!aManager->IsCompositingCheap()) {
     return false;
   }
 
   nsSVGUtils::MaskUsage maskUsage;
   nsSVGUtils::DetermineMaskUsage(mFrame, mHandleOpacity, maskUsage);
 
+  // XXX Bug 1323912. nsSVGIntegrationUtils::PaintMask can not handle opacity
+  // correctly. Turn it off before bug fixed.
   if (maskUsage.opacity != 1.0) {
     return false;
   }
 
   if (!nsSVGIntegrationUtils::IsMaskResourceReady(mFrame)) {
     return false;
   }
 
--- a/layout/svg/nsSVGIntegrationUtils.cpp
+++ b/layout/svg/nsSVGIntegrationUtils.cpp
@@ -798,19 +798,20 @@ nsSVGIntegrationUtils::PaintMask(const P
   // Paint mask onto ctx.
   if (maskUsage.shouldGenerateMaskLayer) {
     matSR.Restore();
     matSR.SetContext(&ctx);
 
     SetupContextMatrix(frame, aParams, offsetToBoundingBox,
                        offsetToUserSpace, false);
     nsTArray<nsSVGMaskFrame *> maskFrames = effectProperties.GetMaskFrames();
-    bool opacityApplied = !HasNonSVGMask(maskFrames);
-    result = PaintMaskSurface(aParams, target,
-                              opacityApplied ? maskUsage.opacity : 1.0,
+    // XXX Bug 1323912.
+    MOZ_ASSERT(maskUsage.opacity == 1.0,
+               "nsSVGIntegrationUtils::PaintMask can not handle opacity now.");
+    result = PaintMaskSurface(aParams, target, 1.0,
                               firstFrame->StyleContext(), maskFrames,
                               ctx.CurrentMatrix(), offsetToUserSpace);
     if (result != DrawResult::SUCCESS) {
       if (maskUsage.shouldApplyBasicShape) {
         ctx.PopClip();
       }
 
       return result;