Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Unified Diff: src/core/SkBitmapProcState_matrix.h

Issue 1539083002: [Reland] Repeating SkBitmapProcState rounding bias (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: corrected comment Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/core/SkBitmapProcState_matrix.h
diff --git a/src/core/SkBitmapProcState_matrix.h b/src/core/SkBitmapProcState_matrix.h
index 42a5ab6e2242cc5ab6a1cad60de664492281c5ee..bdab846496c82d8b30aed4295052e219932b8400 100644
--- a/src/core/SkBitmapProcState_matrix.h
+++ b/src/core/SkBitmapProcState_matrix.h
@@ -64,14 +64,12 @@ void SCALE_FILTER_NAME(const SkBitmapProcState& s,
SkPoint pt;
s.fInvProc(s.fInvMatrix, SkIntToScalar(x) + SK_ScalarHalf,
SkIntToScalar(y) + SK_ScalarHalf, &pt);
- const SkFixed fy = SkScalarToFixed(pt.fY) - (s.fFilterOneY >> 1)
- + bitmap_sampler_inv_bias(s.fInvMatrix.getScaleY());
+ const SkFixed fy = SkScalarToFixed(pt.fY) - (s.fFilterOneY >> 1);
const unsigned maxY = s.fPixmap.height() - 1;
// compute our two Y values up front
*xy++ = PACK_FILTER_Y_NAME(fy, maxY, s.fFilterOneY PREAMBLE_ARG_Y);
// now initialize fx
- fx = SkScalarToFractionalInt(pt.fX) - (SkFixedToFractionalInt(one) >> 1)
- + bitmap_sampler_inv_bias(s.fInvMatrix.getScaleX());
+ fx = SkScalarToFractionalInt(pt.fX) - (SkFixedToFractionalInt(one) >> 1);
}
#ifdef CHECK_FOR_DECAL
@@ -104,10 +102,8 @@ void AFFINE_FILTER_NAME(const SkBitmapProcState& s,
SkFixed oneX = s.fFilterOneX;
SkFixed oneY = s.fFilterOneY;
- SkFixed fx = SkScalarToFixed(srcPt.fX) - (oneX >> 1)
- + bitmap_sampler_inv_bias(s.fInvMatrix.getScaleX());
- SkFixed fy = SkScalarToFixed(srcPt.fY) - (oneY >> 1)
- + bitmap_sampler_inv_bias(s.fInvMatrix.getScaleY());
+ SkFixed fx = SkScalarToFixed(srcPt.fX) - (oneX >> 1);
+ SkFixed fy = SkScalarToFixed(srcPt.fY) - (oneY >> 1);
SkFixed dx = s.fInvSx;
SkFixed dy = s.fInvKy;
unsigned maxX = s.fPixmap.width() - 1;

Powered by Google App Engine
This is Rietveld 408576698