From 8147e6d4e1a176f0bf01914be39076f0a5ab6922 Mon Sep 17 00:00:00 2001 From: cku Date: Fri, 4 Nov 2016 12:25:33 +0800 Subject: [PATCH] Bug 1314001 - Part 2. Draw mask by single opaque green. r=mstange MozReview-Commit-ID: 12S5vBGYRpb --HG-- extra : rebase_source : ef9bfa3251610732a0a6d2becb0e07737a40ac12 --- layout/base/nsDisplayList.cpp | 4 ++++ layout/svg/nsSVGIntegrationUtils.cpp | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index f62a143d568f..1238b4219af5 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -7118,6 +7118,10 @@ bool nsDisplayMask::ShouldPaintOnMaskLayer(LayerManager* aManager) } } + if (gfxPrefs::DrawMaskLayer()) { + return false; + } + return true; } diff --git a/layout/svg/nsSVGIntegrationUtils.cpp b/layout/svg/nsSVGIntegrationUtils.cpp index 860f306c1784..06988928ed97 100644 --- a/layout/svg/nsSVGIntegrationUtils.cpp +++ b/layout/svg/nsSVGIntegrationUtils.cpp @@ -971,6 +971,18 @@ nsSVGIntegrationUtils::PaintMaskAndClipPath(const PaintFramesParams& aParams) aParams.builder); basic->SetTarget(oldCtx); + 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)); + context.Fill(); + } + if (maskUsage.shouldApplyClipPath || maskUsage.shouldApplyBasicShape) { context.PopClip(); }