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

Unified Diff: src/core/SkBitmapProcState_matrix.h

Issue 1531423003: Revert of Repeating SkBitmapProcState rounding bias (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: 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
« no previous file with comments | « src/core/SkBitmapProcState.cpp ('k') | src/core/SkBitmapProcState_matrix_template.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapProcState_matrix.h
diff --git a/src/core/SkBitmapProcState_matrix.h b/src/core/SkBitmapProcState_matrix.h
index e4212b60fe81da277efbd46bf8fe8677758143ac..42a5ab6e2242cc5ab6a1cad60de664492281c5ee 100644
--- a/src/core/SkBitmapProcState_matrix.h
+++ b/src/core/SkBitmapProcState_matrix.h
@@ -61,13 +61,17 @@
SkFractionalInt fx;
{
- const SkBitmapProcStateAutoMapper mapper(s, x ,y);
- const SkFixed fy = mapper.y() - (s.fFilterOneY >> 1);
+ 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 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 = SkFixedToFractionalInt(mapper.x() - (one >> 1));
+ fx = SkScalarToFractionalInt(pt.fX) - (SkFixedToFractionalInt(one) >> 1)
+ + bitmap_sampler_inv_bias(s.fInvMatrix.getScaleX());
}
#ifdef CHECK_FOR_DECAL
@@ -93,12 +97,17 @@
SkMatrix::kAffine_Mask)) == 0);
PREAMBLE(s);
- const SkBitmapProcStateAutoMapper mapper(s, x ,y);
+ SkPoint srcPt;
+ s.fInvProc(s.fInvMatrix,
+ SkIntToScalar(x) + SK_ScalarHalf,
+ SkIntToScalar(y) + SK_ScalarHalf, &srcPt);
SkFixed oneX = s.fFilterOneX;
SkFixed oneY = s.fFilterOneY;
- SkFixed fx = mapper.x() - (oneX >> 1);
- SkFixed fy = mapper.y() - (oneY >> 1);
+ 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 dx = s.fInvSx;
SkFixed dy = s.fInvKy;
unsigned maxX = s.fPixmap.width() - 1;
« no previous file with comments | « src/core/SkBitmapProcState.cpp ('k') | src/core/SkBitmapProcState_matrix_template.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698