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

Unified Diff: Source/core/layout/svg/ReferenceFilterBuilder.cpp

Issue 1326183002: Merge ReferenceFilter into Filter (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Touchups; Rebase. Created 5 years, 3 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
« no previous file with comments | « Source/core/layout/svg/ReferenceFilterBuilder.h ('k') | Source/core/paint/DeprecatedPaintLayer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/svg/ReferenceFilterBuilder.cpp
diff --git a/Source/core/layout/svg/ReferenceFilterBuilder.cpp b/Source/core/layout/svg/ReferenceFilterBuilder.cpp
index 5bf2b0ba372c7928fe04367ef7093eff76870370..26a3e338e862eefba52876eb11e3489bf4e2849c 100644
--- a/Source/core/layout/svg/ReferenceFilterBuilder.cpp
+++ b/Source/core/layout/svg/ReferenceFilterBuilder.cpp
@@ -26,7 +26,6 @@
*/
#include "config.h"
-
#include "core/layout/svg/ReferenceFilterBuilder.h"
#include "core/css/CSSPrimitiveValue.h"
@@ -40,7 +39,7 @@
#include "core/svg/SVGDocumentExtensions.h"
#include "core/svg/SVGFilterPrimitiveStandardAttributes.h"
#include "core/svg/graphics/filters/SVGFilterBuilder.h"
-#include "platform/graphics/filters/ReferenceFilter.h"
+#include "platform/graphics/filters/Filter.h"
#include "platform/graphics/filters/SourceGraphic.h"
namespace blink {
@@ -90,7 +89,7 @@ static EColorInterpolation colorInterpolationForElement(SVGElement& element, ECo
return parentColorInterpolation;
}
-PassRefPtrWillBeRawPtr<ReferenceFilter> ReferenceFilterBuilder::build(float zoom, Element* element, FilterEffect* previousEffect, const ReferenceFilterOperation& filterOperation)
+PassRefPtrWillBeRawPtr<Filter> ReferenceFilterBuilder::build(float zoom, Element* element, FilterEffect* previousEffect, const ReferenceFilterOperation& filterOperation)
{
TreeScope* treeScope = &element->treeScope();
@@ -120,12 +119,12 @@ PassRefPtrWillBeRawPtr<ReferenceFilter> ReferenceFilterBuilder::build(float zoom
SVGFilterElement& filterElement = toSVGFilterElement(*filter);
- FloatRect targetBoundingBox;
+ FloatRect referenceBox;
if (element->inDocument() && element->layoutObject() && element->layoutObject()->isBoxModelObject())
- targetBoundingBox = toLayoutBoxModelObject(element->layoutObject())->borderBoundingBox();
- targetBoundingBox.scale(1.0f / zoom);
- FloatRect filterRegion = SVGLengthContext::resolveRectangle<SVGFilterElement>(&filterElement, filterElement.filterUnits()->currentValue()->enumValue(), targetBoundingBox);
- RefPtrWillBeRawPtr<ReferenceFilter> result(ReferenceFilter::create(targetBoundingBox, filterRegion, zoom));
+ referenceBox = toLayoutBoxModelObject(element->layoutObject())->borderBoundingBox();
+ referenceBox.scale(1.0f / zoom);
+ FloatRect filterRegion = SVGLengthContext::resolveRectangle<SVGFilterElement>(&filterElement, filterElement.filterUnits()->currentValue()->enumValue(), referenceBox);
+ RefPtrWillBeRawPtr<Filter> result(Filter::create(referenceBox, filterRegion, zoom));
if (!previousEffect)
previousEffect = result->sourceGraphic();
RefPtrWillBeRawPtr<SVGFilterBuilder> builder = SVGFilterBuilder::create(previousEffect);
@@ -142,7 +141,7 @@ PassRefPtrWillBeRawPtr<ReferenceFilter> ReferenceFilterBuilder::build(float zoom
continue;
effectElement->setStandardAttributes(effect.get());
- effect->setEffectBoundaries(SVGLengthContext::resolveRectangle<SVGFilterPrimitiveStandardAttributes>(effectElement, filterElement.primitiveUnits()->currentValue()->enumValue(), targetBoundingBox));
+ 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);
« no previous file with comments | « Source/core/layout/svg/ReferenceFilterBuilder.h ('k') | Source/core/paint/DeprecatedPaintLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698