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

Unified Diff: src/core/SkBitmapProcState_matrix_template.h

Issue 1529833003: Repeating SkBitmapProcState rounding bias (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: v2 (SkBitmapProcStateAutoMapper) 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_matrix.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapProcState_matrix_template.h
diff --git a/src/core/SkBitmapProcState_matrix_template.h b/src/core/SkBitmapProcState_matrix_template.h
index 468013c30da958fda88e9cb60e53e04ad18263e2..9d639b8a04fafc9cb4104e0738ab26edbc755e5c 100644
--- a/src/core/SkBitmapProcState_matrix_template.h
+++ b/src/core/SkBitmapProcState_matrix_template.h
@@ -22,13 +22,10 @@ void NoFilterProc_Scale(const SkBitmapProcState& s, uint32_t xy[],
const unsigned maxX = s.fPixmap.width() - 1;
SkFractionalInt fx;
{
- SkPoint pt;
- s.fInvProc(s.fInvMatrix, SkIntToScalar(x) + SK_ScalarHalf,
- SkIntToScalar(y) + SK_ScalarHalf, &pt);
- fx = SkScalarToFractionalInt(pt.fY);
+ const SkBitmapProcStateAutoMapper mapper(s, x ,y);
const unsigned maxY = s.fPixmap.height() - 1;
- *xy++ = TileProc::Y(s, SkFractionalIntToFixed(fx), maxY);
- fx = SkScalarToFractionalInt(pt.fX);
+ *xy++ = TileProc::Y(s, mapper.y(), maxY);
+ fx = SkFixedToFractionalInt(mapper.x());
}
if (0 == maxX) {
@@ -80,13 +77,9 @@ void NoFilterProc_Affine(const SkBitmapProcState& s, uint32_t xy[],
SkMatrix::kScale_Mask |
SkMatrix::kAffine_Mask)) == 0);
- SkPoint srcPt;
- s.fInvProc(s.fInvMatrix,
- SkIntToScalar(x) + SK_ScalarHalf,
- SkIntToScalar(y) + SK_ScalarHalf, &srcPt);
-
- SkFractionalInt fx = SkScalarToFractionalInt(srcPt.fX);
- SkFractionalInt fy = SkScalarToFractionalInt(srcPt.fY);
+ const SkBitmapProcStateAutoMapper mapper(s, x ,y);
+ SkFractionalInt fx = SkFixedToFractionalInt(mapper.x());
+ SkFractionalInt fy = SkFixedToFractionalInt(mapper.y());
SkFractionalInt dx = s.fInvSxFractionalInt;
SkFractionalInt dy = s.fInvKyFractionalInt;
int maxX = s.fPixmap.width() - 1;
@@ -107,6 +100,7 @@ void NoFilterProc_Persp(const SkBitmapProcState& s, uint32_t* SK_RESTRICT xy,
int maxX = s.fPixmap.width() - 1;
int maxY = s.fPixmap.height() - 1;
+ // TODO: inv bias support
SkPerspIter iter(s.fInvMatrix,
SkIntToScalar(x) + SK_ScalarHalf,
SkIntToScalar(y) + SK_ScalarHalf, count);
« no previous file with comments | « src/core/SkBitmapProcState_matrix.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698