| Index: third_party/WebKit/Source/core/layout/svg/ReferenceFilterBuilder.cpp
|
| diff --git a/third_party/WebKit/Source/core/layout/svg/ReferenceFilterBuilder.cpp b/third_party/WebKit/Source/core/layout/svg/ReferenceFilterBuilder.cpp
|
| index 0c08e165b199e035e690f5b660fdb94097baa063..c26e496de9819883ec70489232db8eee095e0349 100644
|
| --- a/third_party/WebKit/Source/core/layout/svg/ReferenceFilterBuilder.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/svg/ReferenceFilterBuilder.cpp
|
| @@ -28,16 +28,11 @@
|
| #include "config.h"
|
| #include "core/layout/svg/ReferenceFilterBuilder.h"
|
|
|
| -#include "core/css/CSSPrimitiveValue.h"
|
| -#include "core/css/CSSPrimitiveValueMappings.h"
|
| -#include "core/css/StylePropertySet.h"
|
| #include "core/dom/Element.h"
|
| -#include "core/dom/ElementTraversal.h"
|
| #include "core/fetch/DocumentResource.h"
|
| #include "core/layout/LayoutBox.h"
|
| -#include "core/layout/svg/LayoutSVGResourceFilter.h"
|
| #include "core/svg/SVGDocumentExtensions.h"
|
| -#include "core/svg/SVGFilterPrimitiveStandardAttributes.h"
|
| +#include "core/svg/SVGFilterElement.h"
|
| #include "core/svg/graphics/filters/SVGFilterBuilder.h"
|
| #include "platform/graphics/filters/Filter.h"
|
| #include "platform/graphics/filters/SourceGraphic.h"
|
| @@ -69,26 +64,6 @@ void ReferenceFilterBuilder::clearDocumentResourceReference(const FilterOperatio
|
| documentResourceReferences->remove(filterOperation);
|
| }
|
|
|
| -// Returns the color-interpolation-filters property of the element.
|
| -static EColorInterpolation colorInterpolationForElement(SVGElement& element, EColorInterpolation parentColorInterpolation)
|
| -{
|
| - if (const LayoutObject* layoutObject = element.layoutObject())
|
| - return layoutObject->styleRef().svgStyle().colorInterpolationFilters();
|
| -
|
| - // No layout has been performed, try to determine the property value
|
| - // "manually" (used by external SVG files.)
|
| - if (const StylePropertySet* propertySet = element.presentationAttributeStyle()) {
|
| - RefPtrWillBeRawPtr<CSSValue> cssValue = propertySet->getPropertyCSSValue(CSSPropertyColorInterpolationFilters);
|
| - if (cssValue && cssValue->isPrimitiveValue()) {
|
| - const CSSPrimitiveValue& primitiveValue = *((CSSPrimitiveValue*)cssValue.get());
|
| - return static_cast<EColorInterpolation>(primitiveValue);
|
| - }
|
| - }
|
| - // 'auto' is the default (per Filter Effects), but since the property is
|
| - // inherited, propagate the parent's value.
|
| - return parentColorInterpolation;
|
| -}
|
| -
|
| PassRefPtrWillBeRawPtr<Filter> ReferenceFilterBuilder::build(float zoom, Element* element, FilterEffect* previousEffect, const ReferenceFilterOperation& filterOperation)
|
| {
|
| TreeScope* treeScope = &element->treeScope();
|
| @@ -129,26 +104,11 @@ PassRefPtrWillBeRawPtr<Filter> ReferenceFilterBuilder::build(float zoom, Element
|
| RefPtrWillBeRawPtr<Filter> result(Filter::create(referenceBox, filterRegion, zoom, unitScaling));
|
| if (!previousEffect)
|
| previousEffect = result->sourceGraphic();
|
| - RefPtrWillBeRawPtr<SVGFilterBuilder> builder = SVGFilterBuilder::create(previousEffect);
|
|
|
| - EColorInterpolation filterColorInterpolation = colorInterpolationForElement(filterElement, CI_AUTO);
|
| + SVGFilterBuilder builder(previousEffect);
|
| + builder.buildGraph(result.get(), filterElement, referenceBox);
|
|
|
| - for (SVGElement* element = Traversal<SVGElement>::firstChild(filterElement); element; element = Traversal<SVGElement>::nextSibling(*element)) {
|
| - if (!element->isFilterEffect())
|
| - continue;
|
| -
|
| - SVGFilterPrimitiveStandardAttributes* effectElement = static_cast<SVGFilterPrimitiveStandardAttributes*>(element);
|
| - RefPtrWillBeRawPtr<FilterEffect> effect = effectElement->build(builder.get(), result.get());
|
| - if (!effect)
|
| - continue;
|
| -
|
| - effectElement->setStandardAttributes(effect.get());
|
| - effect->setEffectBoundaries(SVGLengthContext::resolveRectangle<SVGFilterPrimitiveStandardAttributes>(effectElement, filterElement.primitiveUnits()->currentValue()->enumValue(), referenceBox));
|
| - EColorInterpolation colorInterpolation = colorInterpolationForElement(*effectElement, filterColorInterpolation);
|
| - effect->setOperatingColorSpace(colorInterpolation == CI_LINEARRGB ? ColorSpaceLinearRGB : ColorSpaceDeviceRGB);
|
| - builder->add(AtomicString(effectElement->result()->currentValue()->value()), effect);
|
| - }
|
| - result->setLastEffect(builder->lastEffect());
|
| + result->setLastEffect(builder.lastEffect());
|
| return result.release();
|
| }
|
|
|
|
|