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

Unified Diff: third_party/WebKit/Source/platform/graphics/filters/FETile.cpp

Issue 1463513002: Move application of filter effect boundaries to a helper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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: third_party/WebKit/Source/platform/graphics/filters/FETile.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/filters/FETile.cpp b/third_party/WebKit/Source/platform/graphics/filters/FETile.cpp
index 696d603789dd398f7fc5bcdc0e137e1986f1989c..6e5b4d883f6acae208f468498748762b97627293 100644
--- a/third_party/WebKit/Source/platform/graphics/filters/FETile.cpp
+++ b/third_party/WebKit/Source/platform/graphics/filters/FETile.cpp
@@ -45,26 +45,13 @@ FloatRect FETile::mapPaintRect(const FloatRect& rect, bool forward)
return forward ? maxEffectRect() : inputEffect(0)->maxEffectRect();
}
-static FloatRect getRect(FilterEffect* effect)
-{
- FloatRect result = effect->filter()->filterRegion();
- FloatRect boundaries = effect->effectBoundaries();
- if (effect->hasX())
- result.setX(boundaries.x());
- if (effect->hasY())
- result.setY(boundaries.y());
- if (effect->hasWidth())
- result.setWidth(boundaries.width());
- if (effect->hasHeight())
- result.setHeight(boundaries.height());
- return result;
-}
-
PassRefPtr<SkImageFilter> FETile::createImageFilter(SkiaImageFilterBuilder& builder)
{
RefPtr<SkImageFilter> input(builder.build(inputEffect(0), operatingColorSpace()));
- FloatRect srcRect = inputEffect(0) ? getRect(inputEffect(0)) : filter()->filterRegion();
- FloatRect dstRect = getRect(this);
+ FloatRect srcRect = filter()->filterRegion();
+ inputEffect(0)->applyEffectBoundaries(srcRect);
Stephen White 2015/11/19 14:54:34 Can inputEffect(0) not be null here?
fs 2015/11/19 15:48:09 Nope. (That should even hold generally - at least
+ FloatRect dstRect = filter()->filterRegion();
+ applyEffectBoundaries(dstRect);
return adoptRef(SkTileImageFilter::Create(srcRect, dstRect, input.get()));
}

Powered by Google App Engine
This is Rietveld 408576698