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
This commit is contained in:
parent
772443a3e6
commit
785f2e1426
@ -40,14 +40,14 @@ void highQualityFilter(ColorPacker pack, const SkBitmapProcState& s, int x, int
|
|||||||
SkScalar fr = 0, fg = 0, fb = 0, fa = 0;
|
SkScalar fr = 0, fg = 0, fb = 0, fa = 0;
|
||||||
|
|
||||||
int y0 = SkClampMax(SkScalarCeilToInt(srcPt.fY-s.getBitmapFilter()->width()), maxY);
|
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 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));
|
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 xWeight = s.getBitmapFilter()->lookupScalar((srcPt.fX - srcX));
|
||||||
|
|
||||||
SkScalar combined_weight = SkScalarMul(xWeight, yWeight);
|
SkScalar combined_weight = SkScalarMul(xWeight, yWeight);
|
||||||
|
@ -409,8 +409,6 @@ bool SkBitmapProcState::chooseProcs(const SkMatrix& inv, const SkPaint& paint) {
|
|||||||
// platform-specific one might succeed, so it might be premature here
|
// platform-specific one might succeed, so it might be premature here
|
||||||
// to fall back to bilerp. This needs thought.
|
// to fall back to bilerp. This needs thought.
|
||||||
|
|
||||||
SkASSERT(fInvType > SkMatrix::kTranslate_Mask);
|
|
||||||
|
|
||||||
if (!this->setBitmapFilterProcs()) {
|
if (!this->setBitmapFilterProcs()) {
|
||||||
fFilterLevel = SkPaint::kLow_FilterLevel;
|
fFilterLevel = SkPaint::kLow_FilterLevel;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user