Bug 1314001 - (followup) give different color to different kind of mask. r=me
☠☠ backed out by 376b3896239c ☠ ☠
authorcku <cku@mozilla.com>
Thu, 29 Dec 2016 11:36:39 +0800
changeset 327525 6a9a6e524a7b21fec801bda1679fb06e721628b6
parent 327524 f23003f4b838b3e7bb74a8568f418962559b4ea8
child 327526 376b3896239c1545e9570263af1eae9ce228244e
push id35517
push userkwierso@gmail.com
push dateThu, 29 Dec 2016 20:22:54 +0000
treeherderautoland@3f2f8d77ad27 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1314001
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1314001 - (followup) give different color to different kind of mask. r=me MozReview-Commit-ID: Ko9MyTzMhL2
layout/svg/nsSVGIntegrationUtils.cpp
--- a/layout/svg/nsSVGIntegrationUtils.cpp
+++ b/layout/svg/nsSVGIntegrationUtils.cpp
@@ -1022,17 +1022,28 @@ nsSVGIntegrationUtils::PaintMaskAndClipP
   if (gfxPrefs::DrawMaskLayer()) {
     gfxContextAutoSaveRestore saver(&context);
 
     context.NewPath();
     gfxRect drawingRect =
       nsLayoutUtils::RectToGfxRect(aParams.borderArea,
                                    frame->PresContext()->AppUnitsPerDevPixel());
     context.Rectangle(drawingRect, true);
-    context.SetColor(Color(0.0, 1.0, 0.0, 1.0));
+    Color color(0, 0, 0, 0.8);
+    if (maskUsage.shouldGenerateMaskLayer ||
+        maskUsage.shouldGenerateClipMaskLayer) {
+      color.r = 1.0;
+    }
+    if (maskUsage.shouldApplyClipPath) {
+      color.g = 1.0;
+    }
+    if (maskUsage.shouldApplyBasicShape) {
+      color.b = 1.0;
+    }
+    context.SetColor(color);
     context.Fill();
   }
 
   if (maskUsage.shouldApplyClipPath || maskUsage.shouldApplyBasicShape) {
     context.PopClip();
   }
 
   if (shouldPushMask) {