aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-12-11 15:35:41 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-12-11 15:35:41 +0000
commit785f2e1426b2f90cab2fdd4460d8ccd0970d987e (patch)
tree25e024702b556d2fc746a1f6bc9b3be1c70ff0f7 /src/core
parent772443a3e6428422f20ca4f40ed453a5c3604884 (diff)
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@12619 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core')
-rw-r--r--src/core/SkBitmapFilter.cpp8
-rw-r--r--src/core/SkBitmapProcState.cpp2
2 files changed, 4 insertions, 6 deletions
diff --git a/src/core/SkBitmapFilter.cpp b/src/core/SkBitmapFilter.cpp
index f06662544e..8c11f7c4c5 100644
--- a/src/core/SkBitmapFilter.cpp
+++ b/src/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/src/core/SkBitmapProcState.cpp b/src/core/SkBitmapProcState.cpp
index c93a2b5cd7..39f6a78039 100644
--- a/src/core/SkBitmapProcState.cpp
+++ b/src/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;
}