Index: third_party/WebKit/Source/core/paint/SVGPaintContext.cpp |
diff --git a/third_party/WebKit/Source/core/paint/SVGPaintContext.cpp b/third_party/WebKit/Source/core/paint/SVGPaintContext.cpp |
index eab8db4016e64c7acf95bde7fe8ce018da59d96b..9e9dc8aed01a99f54bee45973424e64e5fa35f6a 100644 |
--- a/third_party/WebKit/Source/core/paint/SVGPaintContext.cpp |
+++ b/third_party/WebKit/Source/core/paint/SVGPaintContext.cpp |
@@ -61,6 +61,12 @@ bool SVGPaintContext::applyClipMaskAndFilterIfNecessary() { |
DCHECK(!m_applyClipMaskAndFilterIfNecessaryCalled); |
m_applyClipMaskAndFilterIfNecessaryCalled = true; |
#endif |
+ // In SPv2 we should early exit once the paint property state has been |
+ // applied, because all meta (non-drawing) display items are ignored in |
+ // SPv2. However we can't simply omit them because there are still |
+ // non-composited painting (e.g. SVG filters in particular) that rely on |
+ // these meta display items. |
+ applyPaintPropertyState(); |
// When rendering clip paths as masks, only geometric operations should be |
// included so skip non-geometric operations such as compositing, masking, and |
@@ -108,6 +114,28 @@ bool SVGPaintContext::applyClipMaskAndFilterIfNecessary() { |
return true; |
} |
+void SVGPaintContext::applyPaintPropertyState() { |
+ if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) |
+ return; |
+ |
+ // SVGRoot works like normal CSS replaced element and its effects are |
+ // applied as stacking context effect by PaintLayerPainter. |
+ if (m_object.isSVGRoot()) |
+ return; |
+ |
+ const auto* paintProperties = m_object.paintProperties(); |
+ const EffectPaintPropertyNode* effect = |
+ paintProperties ? paintProperties->effect() : nullptr; |
+ if (!effect) |
+ return; |
+ |
+ auto& paintController = paintInfo().context.getPaintController(); |
+ PaintChunkProperties properties( |
+ paintController.currentPaintChunkProperties()); |
+ properties.propertyTreeState.setEffect(effect); |
+ m_scopedPaintChunkProperties.emplace(paintController, m_object, properties); |
+} |
+ |
void SVGPaintContext::applyCompositingIfNecessary() { |
DCHECK(!paintInfo().isRenderingClipPathAsMaskImage()); |