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

Unified Diff: src/core/SkBitmapProcState_shaderproc.h

Issue 1661613002: Use SkBitmapProcStateAutoMapper for filter samplers also (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/core/SkBitmapProcState_matrix.h ('k') | src/opts/SkBitmapProcState_matrix_neon.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapProcState_shaderproc.h
diff --git a/src/core/SkBitmapProcState_shaderproc.h b/src/core/SkBitmapProcState_shaderproc.h
index d41ff063e4dab72716ecb3be4e35c97f84c68678..1ff2e6bf2480f067499e59b7461fb7b69217e049 100644
--- a/src/core/SkBitmapProcState_shaderproc.h
+++ b/src/core/SkBitmapProcState_shaderproc.h
@@ -31,10 +31,8 @@ void SCALE_FILTER_NAME(const void* sIn, int x, int y, SkPMColor* SK_RESTRICT col
unsigned subY;
{
- SkPoint pt;
- s.fInvProc(s.fInvMatrix, SkIntToScalar(x) + SK_ScalarHalf,
- SkIntToScalar(y) + SK_ScalarHalf, &pt);
- SkFixed fy = SkScalarToFixed(pt.fY) - (s.fFilterOneY >> 1);
+ const SkBitmapProcStateAutoMapper mapper(s, x, y);
+ SkFixed fy = SkFractionalIntToFixed(mapper.y());
const unsigned maxY = s.fPixmap.height() - 1;
// compute our two Y values up front
subY = TILEY_LOW_BITS(fy, maxY);
@@ -46,7 +44,7 @@ void SCALE_FILTER_NAME(const void* sIn, int x, int y, SkPMColor* SK_RESTRICT col
row0 = (const SRCTYPE*)(srcAddr + y0 * rb);
row1 = (const SRCTYPE*)(srcAddr + y1 * rb);
// now initialize fx
- fx = SkScalarToFixed(pt.fX) - (oneX >> 1);
+ fx = SkFractionalIntToFixed(mapper.x());
}
#ifdef PREAMBLE
« no previous file with comments | « src/core/SkBitmapProcState_matrix.h ('k') | src/opts/SkBitmapProcState_matrix_neon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698