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

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: Updated to ToT 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..aece491731aefd3038bae8ef622470ed1f8cde36 100644
--- a/Source/core/platform/graphics/filters/FilterEffect.cpp
+++ b/Source/core/platform/graphics/filters/FilterEffect.cpp
@@ -481,4 +481,21 @@ PassRefPtr<SkImageFilter> FilterEffect::createImageFilter(SkiaImageFilterBuilder
return 0;
}
+SkIRect FilterEffect::getCropRect(const FloatSize& cropOffset) const
+{
+ SkIRect rect = SkIRect::MakeLargest();
f(malita) 2013/09/09 21:37:43 Hmm, starting off with SkIRect::MakeLargest() does
Stephen White 2013/09/10 14:43:41 When omitted, filter primitive subregion is suppos
f(malita) 2013/09/10 15:37:10 Sounds good, thanks for the explanation.
+ FloatRect boundaries = effectBoundaries();
+ FloatSize resolution = filter()->filterResolution();
+ boundaries.scale(resolution.width(), resolution.height());
+ if (hasX())
+ rect.fLeft = static_cast<int>(boundaries.x()) + cropOffset.width();
+ if (hasY())
+ rect.fTop = static_cast<int>(boundaries.y()) + cropOffset.height();
+ if (hasWidth())
+ rect.fRight = rect.fLeft + static_cast<int>(boundaries.width());
+ if (hasHeight())
+ rect.fBottom = rect.fTop + static_cast<int>(boundaries.height());
f(malita) 2013/09/09 21:37:43 Selectively overwriting edges like this seems prob
Stephen White 2013/09/10 14:43:41 You're right. (I knew there was a reason I didn't
+ return rect;
+}
+
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698