Bug 1314001 - Part 2. Draw mask by single opaque green.
MozReview-Commit-ID: 12S5vBGYRpb
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -7113,16 +7113,20 @@ bool nsDisplayMask::ShouldPaintOnMaskLay
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.
}
}
+ if (gfxPrefs::DrawMaskLayer()) {
+ return false;
+ }
+
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.
--- a/layout/svg/nsSVGIntegrationUtils.cpp
+++ b/layout/svg/nsSVGIntegrationUtils.cpp
@@ -889,16 +889,28 @@ nsSVGIntegrationUtils::PaintMaskAndClipP
context.SetMatrix(matrixAutoSaveRestore.Matrix());
BasicLayerManager* basic = aParams.layerManager->AsBasicLayerManager();
RefPtr<gfxContext> oldCtx = basic->GetTarget();
basic->SetTarget(&context);
aParams.layerManager->EndTransaction(FrameLayerBuilder::DrawPaintedLayer,
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();
}
if (shouldGenerateMask) {
context.PopGroupAndBlend();
}