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

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

Issue 1346143005: Scale objectBoundingBox units for primitive dimensions w/ -webkit-filter (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
Index: Source/core/layout/svg/ReferenceFilterBuilder.cpp
diff --git a/Source/core/layout/svg/ReferenceFilterBuilder.cpp b/Source/core/layout/svg/ReferenceFilterBuilder.cpp
index 26a3e338e862eefba52876eb11e3489bf4e2849c..0c08e165b199e035e690f5b660fdb94097baa063 100644
--- a/Source/core/layout/svg/ReferenceFilterBuilder.cpp
+++ b/Source/core/layout/svg/ReferenceFilterBuilder.cpp
@@ -124,7 +124,9 @@ PassRefPtrWillBeRawPtr<Filter> ReferenceFilterBuilder::build(float zoom, Element
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));
+ bool primitiveBoundingBoxMode = filterElement.primitiveUnits()->currentValue()->enumValue() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX;
+ Filter::UnitScaling unitScaling = primitiveBoundingBoxMode ? Filter::BoundingBox : Filter::UserSpace;
+ RefPtrWillBeRawPtr<Filter> result(Filter::create(referenceBox, filterRegion, zoom, unitScaling));
if (!previousEffect)
previousEffect = result->sourceGraphic();
RefPtrWillBeRawPtr<SVGFilterBuilder> builder = SVGFilterBuilder::create(previousEffect);
« no previous file with comments | « LayoutTests/css3/filters/effect-reference-obb-dimensions-expected.html ('k') | Source/platform/graphics/filters/Filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698