Bug 1313276 - Part 2. Add comment for bug 1323912. draft
authorcku <cku@mozilla.com>
Fri, 16 Dec 2016 12:52:21 +0800
changeset 453274 734d5cd32224a0287f50aa15e0086287e5f349c9
parent 453273 512690da5ab0e562c3cd4f9a964219ffd8447f9c
child 453275 9a6aa1537b0b60a35a74c6e323144b4f46533f9a
push id39612
push userbmo:cku@mozilla.com
push dateFri, 23 Dec 2016 03:14:31 +0000
bugs1313276, 1323912
milestone53.0a1
Bug 1313276 - Part 2. Add comment for bug 1323912. 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
@@ -799,19 +799,20 @@ nsSVGIntegrationUtils::PaintMask(const P
   // Paint mask onto ctx.
   if (maskUsage.shouldGenerateMaskLayer) {
     matSR.Restore();
     matSR.SetContext(&ctx);
 
     SetupContextMatrix(frame, aParams, offsetToBoundingBox,
                        offsetToUserSpace);
     nsTArray<nsSVGMaskFrame *> maskFrames = effectProperties.GetMaskFrames();
-    bool opacityApplied = !HasNonSVGMask(maskFrames);
-    result = PaintMaskSurface(aParams, maskTarget,
-                              opacityApplied ? maskUsage.opacity : 1.0,
+    // XXX Bug 1323912.
+    MOZ_ASSERT(maskUsage.opacity == 1.0,
+               "nsSVGIntegrationUtils::PaintMask can not handle opacity now.");
+    result = PaintMaskSurface(aParams, maskTarget, 1.0,
                               firstFrame->StyleContext(), maskFrames,
                               ctx.CurrentMatrix(), offsetToUserSpace);
     if (result != DrawResult::SUCCESS) {
       if (maskUsage.shouldApplyBasicShape) {
         ctx.PopClip();
       }
 
       return result;