diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-12-11 15:35:41 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-12-11 15:35:41 +0000 |
commit | 8516e0953955b0c33bcd872554cadb642bcd9da7 (patch) | |
tree | 8d3992b31d7c34fe1b1ab9626c17098485fccc92 | |
parent | 307f13115862563280fbcd4abfe9465486bbf90c (diff) | |
download | src-8516e0953955b0c33bcd872554cadb642bcd9da7.tar.gz |
be more careful about OOB source pixels in the scanline rescaler, and
less certain about why the standalone scaler might have faileds
BUG=
R=reed@google.com
Author: humper@google.com
Review URL: https://codereview.chromium.org/100473011
git-svn-id: http://skia.googlecode.com/svn/trunk/src@12619 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | core/SkBitmapFilter.cpp | 8 | ||||
-rw-r--r-- | core/SkBitmapProcState.cpp | 2 |
2 files changed, 4 insertions, 6 deletions
diff --git a/core/SkBitmapFilter.cpp b/core/SkBitmapFilter.cpp index f0666254..8c11f7c4 100644 --- a/core/SkBitmapFilter.cpp +++ b/core/SkBitmapFilter.cpp @@ -40,14 +40,14 @@ void highQualityFilter(ColorPacker pack, const SkBitmapProcState& s, int x, int SkScalar fr = 0, fg = 0, fb = 0, fa = 0; int y0 = SkClampMax(SkScalarCeilToInt(srcPt.fY-s.getBitmapFilter()->width()), maxY); - int y1 = SkClampMax(SkScalarFloorToInt(srcPt.fY+s.getBitmapFilter()->width()), maxY); + int y1 = SkClampMax(SkScalarFloorToInt(srcPt.fY+s.getBitmapFilter()->width()+1), maxY); int x0 = SkClampMax(SkScalarCeilToInt(srcPt.fX-s.getBitmapFilter()->width()), maxX); - int x1 = SkClampMax(SkScalarFloorToInt(srcPt.fX+s.getBitmapFilter()->width()), maxX); + int x1 = SkClampMax(SkScalarFloorToInt(srcPt.fX+s.getBitmapFilter()->width())+1, maxX); - for (int srcY = y0; srcY <= y1; srcY++) { + for (int srcY = y0; srcY < y1; srcY++) { SkScalar yWeight = s.getBitmapFilter()->lookupScalar((srcPt.fY - srcY)); - for (int srcX = x0; srcX <= x1 ; srcX++) { + for (int srcX = x0; srcX < x1 ; srcX++) { SkScalar xWeight = s.getBitmapFilter()->lookupScalar((srcPt.fX - srcX)); SkScalar combined_weight = SkScalarMul(xWeight, yWeight); diff --git a/core/SkBitmapProcState.cpp b/core/SkBitmapProcState.cpp index c93a2b5c..39f6a780 100644 --- a/core/SkBitmapProcState.cpp +++ b/core/SkBitmapProcState.cpp @@ -409,8 +409,6 @@ bool SkBitmapProcState::chooseProcs(const SkMatrix& inv, const SkPaint& paint) { // platform-specific one might succeed, so it might be premature here // to fall back to bilerp. This needs thought. - SkASSERT(fInvType > SkMatrix::kTranslate_Mask); - if (!this->setBitmapFilterProcs()) { fFilterLevel = SkPaint::kLow_FilterLevel; } |