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

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

Issue 540073003: Merge 181007 "Restore SVG filter optimization that was lost in t..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/2125/
Patch Set: Created 6 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 | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/RenderSVGResourceFilter.cpp
===================================================================
--- Source/core/rendering/svg/RenderSVGResourceFilter.cpp (revision 181390)
+++ Source/core/rendering/svg/RenderSVGResourceFilter.cpp (working copy)
@@ -165,7 +165,7 @@
ASSERT(sourceGraphic);
builder.setSourceGraphic(sourceGraphic);
RefPtr<ImageFilter> imageFilter = builder.build(filterData->builder->lastEffect(), ColorSpaceDeviceRGB);
- FloatRect boundaries = enclosingIntRect(filterData->boundaries);
+ FloatRect boundaries = filterData->boundaries;
context->save();
FloatSize deviceSize = context->getCTM().mapSize(boundaries.size());
@@ -181,8 +181,9 @@
float scale = sqrtf(FilterEffect::maxFilterArea() / scaledArea);
context->scale(scale, scale);
}
- // Clip drawing of filtered image to primitive boundaries.
- context->clipRect(boundaries);
+ // Clip drawing of filtered image to the minimum required paint rect.
+ FilterEffect* lastEffect = filterData->builder->lastEffect();
+ context->clipRect(lastEffect->determineAbsolutePaintRect(lastEffect->maxEffectRect()));
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
« no previous file with comments | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698