| Index: third_party/WebKit/Source/core/paint/SVGFilterPainter.cpp
|
| diff --git a/third_party/WebKit/Source/core/paint/SVGFilterPainter.cpp b/third_party/WebKit/Source/core/paint/SVGFilterPainter.cpp
|
| index bb7a3f932b15b7f932fe9211271b621ad237ad3c..f54c0ce6e3a1e765251247089ea2e991b7051e82 100644
|
| --- a/third_party/WebKit/Source/core/paint/SVGFilterPainter.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/SVGFilterPainter.cpp
|
| @@ -122,31 +122,32 @@ GraphicsContext* SVGFilterPainter::prepareEffect(const LayoutObject& object, SVG
|
| }
|
|
|
| OwnPtrWillBeRawPtr<FilterData> filterData = FilterData::create();
|
| - FloatRect targetBoundingBox = object.objectBoundingBox();
|
| + FloatRect referenceBox = object.objectBoundingBox();
|
|
|
| SVGFilterElement* filterElement = toSVGFilterElement(m_filter.element());
|
| - FloatRect filterRegion = SVGLengthContext::resolveRectangle<SVGFilterElement>(filterElement, filterElement->filterUnits()->currentValue()->enumValue(), targetBoundingBox);
|
| + FloatRect filterRegion = SVGLengthContext::resolveRectangle<SVGFilterElement>(filterElement, filterElement->filterUnits()->currentValue()->enumValue(), referenceBox);
|
| if (filterRegion.isEmpty())
|
| return nullptr;
|
|
|
| // Create the SVGFilter object.
|
| bool primitiveBoundingBoxMode = filterElement->primitiveUnits()->currentValue()->enumValue() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX;
|
| Filter::UnitScaling unitScaling = primitiveBoundingBoxMode ? Filter::BoundingBox : Filter::UserSpace;
|
| - filterData->filter = Filter::create(targetBoundingBox, filterRegion, 1, unitScaling);
|
| + filterData->filter = Filter::create(referenceBox, filterRegion, 1, unitScaling);
|
| + filterData->nodeMap = SVGFilterGraphNodeMap::create();
|
|
|
| IntRect sourceRegion = enclosingIntRect(intersection(filterRegion, object.strokeBoundingBox()));
|
| filterData->filter->sourceGraphic()->setSourceRect(sourceRegion);
|
|
|
| // Create all relevant filter primitives.
|
| - filterData->builder = m_filter.buildPrimitives(filterData->filter.get());
|
| - if (!filterData->builder)
|
| - return nullptr;
|
| + SVGFilterBuilder builder(filterData->filter->sourceGraphic(), filterData->nodeMap.get());
|
| + builder.buildGraph(filterData->filter.get(), *filterElement, referenceBox);
|
|
|
| - FilterEffect* lastEffect = filterData->filter->lastEffect();
|
| + FilterEffect* lastEffect = builder.lastEffect();
|
| if (!lastEffect)
|
| return nullptr;
|
|
|
| lastEffect->determineFilterPrimitiveSubregion(ClipToFilterRegion);
|
| + filterData->filter->setLastEffect(lastEffect);
|
|
|
| FilterData* data = filterData.get();
|
| // TODO(pdr): Can this be moved out of painter?
|
|
|