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

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

Issue 2065593002: Unprefix the CSS 'filter' property (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 6 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..123da4df3a10bd82743acf87ea5e70896b1df6cc 100644
--- a/third_party/WebKit/Source/core/paint/SVGPaintContext.cpp
+++ b/third_party/WebKit/Source/core/paint/SVGPaintContext.cpp
@@ -77,7 +77,14 @@ bool SVGPaintContext::applyClipMaskAndFilterIfNecessary()
return true;
}
- applyCompositingIfNecessary();
+ bool isSVGRoot = m_object.isSVGRoot();
+
+ // Layer takes care of root opacity and blend mode.
+ if (isSVGRoot) {
+ DCHECK((m_object.styleRef().hasBlendMode() || m_object.isTransparent()) && m_object.hasLayer());
+ } else {
+ applyCompositingIfNecessary();
+ }
if (!applyClipIfNecessary(resources))
return false;
@@ -85,8 +92,11 @@ bool SVGPaintContext::applyClipMaskAndFilterIfNecessary()
if (!applyMaskIfNecessary(resources))
return false;
- if (!applyFilterIfNecessary(resources))
+ if (isSVGRoot) {
+ DCHECK(m_object.styleRef().hasFilter() && m_object.hasLayer());
+ } else if (!applyFilterIfNecessary(resources)) {
return false;
+ }
if (!isIsolationInstalled() && SVGLayoutSupport::isIsolationRequired(&m_object))
m_compositingRecorder = adoptPtr(new CompositingRecorder(paintInfo().context, m_object, SkXfermode::kSrcOver_Mode, 1));
@@ -98,10 +108,6 @@ void SVGPaintContext::applyCompositingIfNecessary()
{
ASSERT(!paintInfo().isRenderingClipPathAsMaskImage());
- // Layer takes care of root opacity and blend mode.
- if (m_object.isSVGRoot())
- return;
-
const ComputedStyle& style = m_object.styleRef();
float opacity = style.opacity();
WebBlendMode blendMode = style.hasBlendMode() && m_object.isBlendingAllowed() ?
@@ -147,7 +153,7 @@ bool SVGPaintContext::applyMaskIfNecessary(SVGResources* resources)
bool SVGPaintContext::applyFilterIfNecessary(SVGResources* resources)
{
if (!resources) {
- if (m_object.style()->svgStyle().hasFilter())
+ if (m_object.style()->hasFilter())
return false;
} else if (LayoutSVGResourceFilter* filter = resources->filter()) {
m_filterRecordingContext = adoptPtr(new SVGFilterRecordingContext(paintInfo().context));

Powered by Google App Engine
This is Rietveld 408576698