From 68a690cb05d78060a95b1c8af0e60467740730a4 Mon Sep 17 00:00:00 2001 From: "humper@google.com" Date: Mon, 11 Mar 2013 21:16:20 +0000 Subject: fix pad bug introduced during code cleanup git-svn-id: http://skia.googlecode.com/svn/trunk@8083 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/effects/SkBlurMask.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'src/effects') diff --git a/src/effects/SkBlurMask.cpp b/src/effects/SkBlurMask.cpp index 31bd711b4e..97b5ab3ee9 100644 --- a/src/effects/SkBlurMask.cpp +++ b/src/effects/SkBlurMask.cpp @@ -1255,15 +1255,10 @@ bool SkBlurMask::BlurRect(SkMask *dst, const SkRect &src, margin->set( pad, pad ); } - int shadow_left = -pad; - int shadow_top = -pad; - int shadow_right = (int)(src.width()) + pad; - int shadow_bottom = (int)(src.height()) + pad; - - dst->fBounds.set(SkScalarRoundToInt(shadow_left + src.fLeft), - SkScalarRoundToInt(shadow_top + src.fTop), - SkScalarRoundToInt(shadow_right + src.fRight), - SkScalarRoundToInt(shadow_bottom + src.fBottom)); + dst->fBounds.set(SkScalarRoundToInt(src.fLeft - pad), + SkScalarRoundToInt(src.fTop - pad), + SkScalarRoundToInt(src.fRight + pad), + SkScalarRoundToInt(src.fBottom + pad)); dst->fRowBytes = dst->fBounds.width(); dst->fFormat = SkMask::kA8_Format; @@ -1274,7 +1269,10 @@ bool SkBlurMask::BlurRect(SkMask *dst, const SkRect &src, if (createMode == SkMask::kJustComputeBounds_CreateMode) { if (style == kInner_Style) { - dst->fBounds.set(0, 0, sw, sh); // restore trimmed bounds + dst->fBounds.set(SkScalarRoundToInt(src.fLeft), + SkScalarRoundToInt(src.fTop), + SkScalarRoundToInt(src.fRight), + SkScalarRoundToInt(src.fBottom)); // restore trimmed bounds dst->fRowBytes = sw; } return true; @@ -1347,7 +1345,10 @@ bool SkBlurMask::BlurRect(SkMask *dst, const SkRect &src, } SkMask::FreeImage(dp); - dst->fBounds.set(0, 0, sw, sh); // restore trimmed bounds + dst->fBounds.set(SkScalarRoundToInt(src.fLeft), + SkScalarRoundToInt(src.fTop), + SkScalarRoundToInt(src.fRight), + SkScalarRoundToInt(src.fBottom)); // restore trimmed bounds dst->fRowBytes = sw; } else if (style == kOuter_Style) { -- cgit v1.2.3