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

Unified Diff: src/opts/SkBitmapProcState_opts_SSE2.cpp

Issue 1656833002: Sampler bias for all nofilter flavors (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 months 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/opts/SkBitmapProcState_matrix_neon.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/opts/SkBitmapProcState_opts_SSE2.cpp
diff --git a/src/opts/SkBitmapProcState_opts_SSE2.cpp b/src/opts/SkBitmapProcState_opts_SSE2.cpp
index cffe9625e508cec2cbe1ff149f0df8909923419f..b5da8e23fa67a8607adbc660a7924d4856360192 100644
--- a/src/opts/SkBitmapProcState_opts_SSE2.cpp
+++ b/src/opts/SkBitmapProcState_opts_SSE2.cpp
@@ -374,14 +374,10 @@ void ClampX_ClampY_nofilter_scale_SSE2(const SkBitmapProcState& s,
// we store y, x, x, x, x, x
const unsigned maxX = s.fPixmap.width() - 1;
- SkFixed fx;
- SkPoint pt;
- s.fInvProc(s.fInvMatrix, SkIntToScalar(x) + SK_ScalarHalf,
- SkIntToScalar(y) + SK_ScalarHalf, &pt);
- fx = SkScalarToFixed(pt.fY);
+ const SkBitmapProcStateAutoMapper mapper(s, x, y);
const unsigned maxY = s.fPixmap.height() - 1;
- *xy++ = SkClampMax(fx >> 16, maxY);
- fx = SkScalarToFixed(pt.fX);
+ *xy++ = SkClampMax(SkFractionalIntToInt(mapper.y()), maxY);
+ SkFixed fx = SkFractionalIntToFixed(mapper.x());
if (0 == maxX) {
// all of the following X values must be 0
@@ -565,13 +561,10 @@ void ClampX_ClampY_nofilter_affine_SSE2(const SkBitmapProcState& s,
SkMatrix::kScale_Mask |
SkMatrix::kAffine_Mask)) == 0);
- SkPoint srcPt;
- s.fInvProc(s.fInvMatrix,
- SkIntToScalar(x) + SK_ScalarHalf,
- SkIntToScalar(y) + SK_ScalarHalf, &srcPt);
+ const SkBitmapProcStateAutoMapper mapper(s, x, y);
- SkFixed fx = SkScalarToFixed(srcPt.fX);
- SkFixed fy = SkScalarToFixed(srcPt.fY);
+ SkFixed fx = SkFractionalIntToFixed(mapper.x());
+ SkFixed fy = SkFractionalIntToFixed(mapper.y());
SkFixed dx = s.fInvSx;
SkFixed dy = s.fInvKy;
int maxX = s.fPixmap.width() - 1;
« no previous file with comments | « src/opts/SkBitmapProcState_matrix_neon.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698