From e182829f491efa1d0d217973e81c0693fbbc1338 Mon Sep 17 00:00:00 2001 From: "reed@google.com" Date: Mon, 11 Feb 2013 19:56:20 +0000 Subject: mirror of https://codereview.appspot.com/7312060/ git-svn-id: http://skia.googlecode.com/svn/trunk@7694 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/opts/SkBitmapProcState_matrix_repeat_neon.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/opts') diff --git a/src/opts/SkBitmapProcState_matrix_repeat_neon.h b/src/opts/SkBitmapProcState_matrix_repeat_neon.h index a0eb0a9e84..f57d20d35c 100644 --- a/src/opts/SkBitmapProcState_matrix_repeat_neon.h +++ b/src/opts/SkBitmapProcState_matrix_repeat_neon.h @@ -417,8 +417,8 @@ static void SCALE_FILTER_NAME(const SkBitmapProcState& s, const unsigned maxX = s.fBitmap->width() - 1; const SkFixed one = s.fFilterOneX; - const SkFixed dx = s.fInvSx; - SkFixed fx; + const SkFractionalInt dx = s.fInvSxFractionalInt; + SkFractionalInt fx; { SkPoint pt; @@ -429,20 +429,20 @@ static void SCALE_FILTER_NAME(const SkBitmapProcState& s, // compute our two Y values up front *xy++ = PACK_FILTER_Y_NAME(fy, maxY, s.fFilterOneY PREAMBLE_ARG_Y); // now initialize fx - fx = SkScalarToFixed(pt.fX) - (one >> 1); + fx = SkScalarToFractionalInt(pt.fX) - (SkFixedToFractionalInt(one) >> 1); } #ifdef CHECK_FOR_DECAL // test if we don't need to apply the tile proc - if (dx > 0 && - (unsigned)(fx >> 16) <= maxX && - (unsigned)((fx + dx * (count - 1)) >> 16) < maxX) { - decal_filter_scale_neon(xy, fx, dx, count); + if (can_truncate_to_fixed_for_decal(fx, dx, count, maxX)) { + decal_filter_scale_neon(xy, SkFractionalIntToFixed(fx), + SkFractionalIntToFixed(dx), count); } else #endif { do { - *xy++ = PACK_FILTER_X_NAME(fx, maxX, one PREAMBLE_ARG_X); + SkFixed fixedFx = SkFractionalIntToFixed(fx); + *xy++ = PACK_FILTER_X_NAME(fixedFx, maxX, one PREAMBLE_ARG_X); fx += dx; } while (--count != 0); } -- cgit v1.2.3