Bug 1234485 - Part 11. Paint SVG mask on PaintedLayer before bug 1313877 fixed. r=mstange
authorcku <cku@mozilla.com>
Sun, 30 Oct 2016 02:55:24 +0800
changeset 348381 15301d7d6162cabd35e2bb2f2752137166ba90ef
parent 348380 ca961d579a3922193bdea9a5a16521edf38fc89f
child 348382 41d66b1327ace3c314d196154381713ed4188299
push id10298
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:33:03 +0000
treeherdermozilla-aurora@7e29173b1641 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1234485, 1313877
milestone52.0a1
Bug 1234485 - Part 11. Paint SVG mask on PaintedLayer before bug 1313877 fixed. r=mstange MozReview-Commit-ID: C8XIZ4ttp1P
layout/base/nsDisplayList.cpp
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -7099,16 +7099,30 @@ bool nsDisplayMask::ShouldPaintOnMaskLay
       maskUsage.shouldGenerateClipMaskLayer) {
     return false;
   }
 
   if (!nsSVGIntegrationUtils::IsMaskResourceReady(mFrame)) {
     return false;
   }
 
+  // XXX temporary disable drawing SVG mask onto mask layer before bug 1313877
+  // been fixed.
+  nsIFrame* firstFrame =
+    nsLayoutUtils::FirstContinuationOrIBSplitSibling(mFrame);
+  nsSVGEffects::EffectProperties effectProperties =
+    nsSVGEffects::GetEffectProperties(firstFrame);
+  nsTArray<nsSVGMaskFrame *> maskFrames = effectProperties.GetMaskFrames();
+  for (size_t i = 0; i < maskFrames.Length() ; i++) {
+    nsSVGMaskFrame *maskFrame = maskFrames[i];
+    if (maskFrame) {
+      return false; // Found SVG mask.
+    }
+  }
+
   return true;
 }
 
 bool nsDisplayMask::ComputeVisibility(nsDisplayListBuilder* aBuilder,
                                       nsRegion* aVisibleRegion)
 {
   // Our children may be made translucent or arbitrarily deformed so we should
   // not allow them to subtract area from aVisibleRegion.