diff options
author | humper@google.com <humper@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-03-11 21:16:20 +0000 |
---|---|---|
committer | humper@google.com <humper@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-03-11 21:16:20 +0000 |
commit | 68a690cb05d78060a95b1c8af0e60467740730a4 (patch) | |
tree | 3db8826379de8c97dc4ca6b3038135353ee0a166 /src/effects | |
parent | 8fff39804398cbf33b77ff7061391d47d6090e4f (diff) |
fix pad bug introduced during code cleanup
git-svn-id: http://skia.googlecode.com/svn/trunk@8083 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/effects')
-rw-r--r-- | src/effects/SkBlurMask.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
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) { |