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

Unified Diff: third_party/WebKit/Source/core/svg/SVGFilterPrimitiveStandardAttributes.cpp

Issue 2128193004: Update FilterEffect colorspace on color-interpolation-filters changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/svg/SVGFilterPrimitiveStandardAttributes.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGFilterPrimitiveStandardAttributes.cpp b/third_party/WebKit/Source/core/svg/SVGFilterPrimitiveStandardAttributes.cpp
index d519fa548e97f97a007f86aef4879d856b4d9dff..aa3c99c4f1d854389c589f63c55a5ffabe0bf87f 100644
--- a/third_party/WebKit/Source/core/svg/SVGFilterPrimitiveStandardAttributes.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGFilterPrimitiveStandardAttributes.cpp
@@ -25,6 +25,7 @@
#include "core/layout/svg/LayoutSVGResourceContainer.h"
#include "core/layout/svg/LayoutSVGResourceFilterPrimitive.h"
#include "core/svg/SVGLength.h"
+#include "core/svg/graphics/filters/SVGFilterBuilder.h"
#include "platform/graphics/filters/FilterEffect.h"
namespace blink {
@@ -62,11 +63,16 @@ DEFINE_TRACE(SVGFilterPrimitiveStandardAttributes)
SVGElement::trace(visitor);
}
-bool SVGFilterPrimitiveStandardAttributes::setFilterEffectAttribute(FilterEffect*, const QualifiedName&)
+bool SVGFilterPrimitiveStandardAttributes::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName)
{
- // When all filters support this method, it will be changed to a pure virtual method.
- ASSERT_NOT_REACHED();
- return false;
+ DCHECK(attrName == SVGNames::color_interpolation_filtersAttr);
+ DCHECK(layoutObject());
+ EColorInterpolation colorInterpolation = layoutObject()->styleRef().svgStyle().colorInterpolationFilters();
+ ColorSpace resolvedColorSpace = SVGFilterBuilder::resolveColorSpace(colorInterpolation);
+ if (resolvedColorSpace == effect->operatingColorSpace())
+ return false;
+ effect->setOperatingColorSpace(resolvedColorSpace);
+ return true;
}
void SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(const QualifiedName& attrName)

Powered by Google App Engine
This is Rietveld 408576698