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

Unified Diff: Source/core/platform/graphics/filters/FilterEffect.cpp

Issue 22794007: Implement filter primitive subregion on accelerated reference filters (FEColorMatrix a… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix computation of default filter primitive subregion Created 7 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
Index: Source/core/platform/graphics/filters/FilterEffect.cpp
diff --git a/Source/core/platform/graphics/filters/FilterEffect.cpp b/Source/core/platform/graphics/filters/FilterEffect.cpp
index 01e4b0a6278d5a66915688a0e6a3713d52a18670..5972bcddcc1aa69f7321ff4fcfcacd49461f5c46 100644
--- a/Source/core/platform/graphics/filters/FilterEffect.cpp
+++ b/Source/core/platform/graphics/filters/FilterEffect.cpp
@@ -481,4 +481,17 @@ PassRefPtr<SkImageFilter> FilterEffect::createImageFilter(SkiaImageFilterBuilder
return 0;
}
+SkIRect FilterEffect::getCropRect(const FloatSize& cropOffset) const
+{
+ SkIRect rect;
+ FloatRect boundaries = effectBoundaries();
+ FloatSize resolution = filter()->filterResolution();
+ boundaries.scale(resolution.width(), resolution.height());
+ rect.fLeft = hasX() ? static_cast<int>(boundaries.x()) + cropOffset.width() : 0;
+ rect.fTop = hasY() ? static_cast<int>(boundaries.y()) + cropOffset.height() : 0;
+ rect.fRight = hasWidth() ? rect.fLeft + static_cast<int>(boundaries.width()) : SK_MaxS32;
+ rect.fBottom = hasHeight() ? rect.fTop + static_cast<int>(boundaries.height()) : SK_MaxS32;
+ return rect;
+}
+
} // namespace WebCore
« no previous file with comments | « Source/core/platform/graphics/filters/FilterEffect.h ('k') | Source/core/platform/graphics/filters/SkiaImageFilterBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698