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
diff --git a/core/SkBitmapFilter.cpp b/core/SkBitmapFilter.cpp
index f066625..8c11f7c 100644
--- a/core/SkBitmapFilter.cpp
+++ b/core/SkBitmapFilter.cpp
@@ -40,14 +40,14 @@
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 c93a2b5..39f6a78 100644
--- a/core/SkBitmapProcState.cpp
+++ b/core/SkBitmapProcState.cpp
@@ -409,8 +409,6 @@
// 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;
}