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

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: Make method "functional". 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/filters/FilterEffect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..62ba539a2e4babb5dad54fa43cc2131f63091dd6 100644
--- a/third_party/WebKit/Source/platform/graphics/filters/FETile.cpp
+++ b/third_party/WebKit/Source/platform/graphics/filters/FETile.cpp
@@ -45,26 +45,11 @@ 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 = inputEffect(0)->applyEffectBoundaries(filter()->filterRegion());
+ FloatRect dstRect = applyEffectBoundaries(filter()->filterRegion());
return adoptRef(SkTileImageFilter::Create(srcRect, dstRect, input.get()));
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/filters/FilterEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698