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

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

Issue 1987943002: [wip] unprefix filter Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Decide on BUG 109224, minor test code tweaks. Created 4 years, 7 months 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
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 c595c9ce65df225c11c2bd9ac0c7e474697ad047..3dd014825d4b9001fe00d82531493e2b6ab2f145 100644
--- a/third_party/WebKit/Source/core/paint/SVGPaintContext.cpp
+++ b/third_party/WebKit/Source/core/paint/SVGPaintContext.cpp
@@ -147,9 +147,16 @@ bool SVGPaintContext::applyMaskIfNecessary(SVGResources* resources)
bool SVGPaintContext::applyFilterIfNecessary(SVGResources* resources)
{
if (!resources) {
- if (m_object.style()->svgStyle().hasFilter())
- return false;
- } else if (LayoutSVGResourceFilter* filter = resources->filter()) {
+ if (m_object.style()->hasFilter())
+ return false; // Do not allow a draw: the SVG filter is invalid.
+ return true;
fs 2016/05/23 12:29:53 return !m_object.style()->hasFilter(); ?
Noel Gordon 2016/05/29 04:15:29 I restored the old code, so done.
+ }
+
+ if (LayoutSVGResourceFilter* filter = resources->filter()) {
+ // The root element's filter is applied by the layer filter painter.
fs 2016/05/23 12:29:53 Shouldn't need to call this at all if m_object.isS
Noel Gordon 2016/05/29 04:15:28 ditto, restored the old code.
+ if (m_object.isSVGRoot() && m_object.hasLayer())
+ return true;
+
m_filterRecordingContext = adoptPtr(new SVGFilterRecordingContext(paintInfo().context));
m_filter = filter;
GraphicsContext* filterContext = SVGFilterPainter(*filter).prepareEffect(m_object, *m_filterRecordingContext);
@@ -165,6 +172,7 @@ bool SVGPaintContext::applyFilterIfNecessary(SVGResources* resources)
// so elements outside the initial paint (due to scrolling, etc) paint.
m_filterPaintInfo->m_cullRect.m_rect = LayoutRect::infiniteIntRect();
}
+
fs 2016/05/23 12:29:53 Drop.
Noel Gordon 2016/05/29 04:15:28 ditto.
return true;
}

Powered by Google App Engine
This is Rietveld 408576698