Index: src/effects/SkDropShadowImageFilter.cpp |
diff --git a/src/effects/SkDropShadowImageFilter.cpp b/src/effects/SkDropShadowImageFilter.cpp |
index 40ab8cf64154c8d6b99d311d7069f4ea52d0e4ab..94055ce8ae0a44281560d86f8bf54df36e89cb2d 100644 |
--- a/src/effects/SkDropShadowImageFilter.cpp |
+++ b/src/effects/SkDropShadowImageFilter.cpp |
@@ -66,7 +66,9 @@ bool SkDropShadowImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& source |
return false; |
SkIRect bounds; |
- if (!this->applyCropRect(ctx, src, srcOffset, &bounds)) { |
+ src.getBounds(&bounds); |
+ bounds.offset(srcOffset); |
+ if (!this->applyCropRect(&bounds, ctx.ctm())) { |
return false; |
} |
@@ -88,8 +90,7 @@ 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(srcOffset.fX - bounds.fLeft), |
- SkIntToScalar(srcOffset.fY - bounds.fTop)); |
+ canvas.translate(-SkIntToScalar(bounds.fLeft), -SkIntToScalar(bounds.fTop)); |
canvas.drawBitmap(src, offsetVec.fX, offsetVec.fY, &paint); |
canvas.drawBitmap(src, 0, 0); |
*result = device->accessBitmap(false); |