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

Unified Diff: src/effects/SkDisplacementMapEffect.cpp

Issue 272643003: Fix for SkDisplacementMap::onFilterBounds(). (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 7 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 | « no previous file | tests/ImageFilterTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkDisplacementMapEffect.cpp
diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp
index 39222444d274b72934027224d29249e654b188f5..d0f134be40ff3d9da7a5fc475894f37388ccd28a 100644
--- a/src/effects/SkDisplacementMapEffect.cpp
+++ b/src/effects/SkDisplacementMapEffect.cpp
@@ -257,11 +257,13 @@ void SkDisplacementMapEffect::computeFastBounds(const SkRect& src, SkRect* dst)
bool SkDisplacementMapEffect::onFilterBounds(const SkIRect& src, const SkMatrix& ctm,
SkIRect* dst) const {
SkIRect bounds = src;
- if (getColorInput() && !getColorInput()->filterBounds(src, ctm, &bounds)) {
- return false;
+ SkVector scale = SkVector::Make(fScale, fScale);
+ ctm.mapVectors(&scale, 1);
+ bounds.outset(SkScalarCeilToInt(scale.fX * SK_ScalarHalf),
+ SkScalarCeilToInt(scale.fY * SK_ScalarHalf));
+ if (getColorInput()) {
+ return getColorInput()->filterBounds(bounds, ctm, dst);
}
- bounds.outset(SkScalarCeilToInt(fScale * SK_ScalarHalf),
- SkScalarCeilToInt(fScale * SK_ScalarHalf));
*dst = bounds;
return true;
}
« no previous file with comments | « no previous file | tests/ImageFilterTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698