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

Unified Diff: Source/core/rendering/svg/RenderSVGResourceFilter.cpp

Issue 323013004: Clean up transform methods in GraphicsContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2nd Attempt Mac build fix Created 6 years, 6 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/rendering/svg/RenderSVGResourceFilter.cpp
diff --git a/Source/core/rendering/svg/RenderSVGResourceFilter.cpp b/Source/core/rendering/svg/RenderSVGResourceFilter.cpp
index bd2019d089d1db590b3571e6d0ee2b95962bc235..39de4baa53a1e6beecf7f244383ec4d15d1e4b6e 100644
--- a/Source/core/rendering/svg/RenderSVGResourceFilter.cpp
+++ b/Source/core/rendering/svg/RenderSVGResourceFilter.cpp
@@ -150,16 +150,17 @@ static void beginDeferredFilter(GraphicsContext* context, FilterData* filterData
context->clipRect(boundaries);
if (filterElement->hasAttribute(SVGNames::filterResAttr)) {
// Get boundaries in device coords.
+ // FIXME: See crbug.com/382491. Is the use of getCTM OK here, given it does not include device
+ // zoom or High DPI adjustments?
FloatSize size = context->getCTM().mapSize(boundaries.size());
// Compute the scale amount required so that the resulting offscreen is exactly filterResX by filterResY pixels.
- FloatSize filterResScale(
- filterElement->filterResX()->currentValue()->value() / size.width(),
- filterElement->filterResY()->currentValue()->value() / size.height());
+ float filterResScaleX = filterElement->filterResX()->currentValue()->value() / size.width();
+ float filterResScaleY = filterElement->filterResY()->currentValue()->value() / size.height();
// Scale the CTM so the primitive is drawn to filterRes.
- context->scale(filterResScale);
+ context->scale(filterResScaleX, filterResScaleY);
// Create a resize filter with the inverse scale.
AffineTransform resizeMatrix;
- resizeMatrix.scale(1 / filterResScale.width(), 1 / filterResScale.height());
+ resizeMatrix.scale(1 / filterResScaleX, 1 / filterResScaleY);
imageFilter = builder.buildTransform(resizeMatrix, imageFilter.get());
}
// If the CTM contains rotation or shearing, apply the filter to
« no previous file with comments | « Source/core/rendering/compositing/CompositedLayerMapping.cpp ('k') | Source/core/rendering/svg/RenderSVGResourcePattern.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698