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); |