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

Unified Diff: src/effects/SkDropShadowImageFilter.cpp

Issue 198003008: Implement support for expanding crop rects in image filters (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix ImageFilterTest Created 6 years, 9 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 | « src/effects/SkDisplacementMapEffect.cpp ('k') | src/effects/SkLightingImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkDropShadowImageFilter.cpp
diff --git a/src/effects/SkDropShadowImageFilter.cpp b/src/effects/SkDropShadowImageFilter.cpp
index 94055ce8ae0a44281560d86f8bf54df36e89cb2d..40ab8cf64154c8d6b99d311d7069f4ea52d0e4ab 100644
--- a/src/effects/SkDropShadowImageFilter.cpp
+++ b/src/effects/SkDropShadowImageFilter.cpp
@@ -66,9 +66,7 @@ bool SkDropShadowImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source
return false;
SkIRect bounds;
- src.getBounds(&bounds);
- bounds.offset(srcOffset);
- if (!this->applyCropRect(&bounds, ctx.ctm())) {
+ if (!this->applyCropRect(ctx, src, srcOffset, &bounds)) {
return false;
}
@@ -90,7 +88,8 @@ bool SkDropShadowImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source
paint.setXfermodeMode(SkXfermode::kSrcOver_Mode);
SkVector offsetVec, localOffsetVec = SkVector::Make(fDx, fDy);
ctx.ctm().mapVectors(&offsetVec, &localOffsetVec, 1);
- canvas.translate(-SkIntToScalar(bounds.fLeft), -SkIntToScalar(bounds.fTop));
+ canvas.translate(SkIntToScalar(srcOffset.fX - bounds.fLeft),
+ SkIntToScalar(srcOffset.fY - bounds.fTop));
canvas.drawBitmap(src, offsetVec.fX, offsetVec.fY, &paint);
canvas.drawBitmap(src, 0, 0);
*result = device->accessBitmap(false);
« no previous file with comments | « src/effects/SkDisplacementMapEffect.cpp ('k') | src/effects/SkLightingImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698