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

Unified Diff: Source/core/svg/graphics/filters/SVGFEImage.cpp

Issue 67483003: [SVG] Fix root element length values handling. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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/svg/graphics/filters/SVGFEImage.cpp
diff --git a/Source/core/svg/graphics/filters/SVGFEImage.cpp b/Source/core/svg/graphics/filters/SVGFEImage.cpp
index a14220af17f3a38d294465c4dc716a008e391171..feda6e0713e2bb4214edd95f48f63236cc87f998 100644
--- a/Source/core/svg/graphics/filters/SVGFEImage.cpp
+++ b/Source/core/svg/graphics/filters/SVGFEImage.cpp
@@ -121,13 +121,12 @@ void FEImage::applySoftware()
SVGElement* contextNode = toSVGElement(renderer->node());
if (contextNode->hasRelativeLengths()) {
SVGLengthContext lengthContext(contextNode);
- float width = 0;
- float height = 0;
+ FloatSize viewportSize;
// If we're referencing an element with percentage units, eg. <rect with="30%"> those values were resolved against the viewport.
// Build up a transformation that maps from the viewport space to the filter primitive subregion.
- if (lengthContext.determineViewport(width, height))
- resultImage->context()->concatCTM(makeMapBetweenRects(FloatRect(0, 0, width, height), destRect));
+ if (lengthContext.determineViewport(viewportSize))
+ resultImage->context()->concatCTM(makeMapBetweenRects(FloatRect(FloatPoint(), viewportSize), destRect));
} else {
const AffineTransform& absoluteTransform = filter()->absoluteTransform();
resultImage->context()->concatCTM(absoluteTransform);
« Source/core/svg/SVGLengthContext.cpp ('K') | « Source/core/svg/SVGLengthContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698