Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(693)

Unified Diff: third_party/WebKit/Source/core/paint/SVGPaintContext.cpp

Issue 2570223002: [SPv2] Associate effect property nodes for SVG paint chunks (Closed)
Patch Set: revert hasNonIso... change Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/paint/SVGPaintContext.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « third_party/WebKit/Source/core/paint/SVGPaintContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698