aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkBitmapProcState_matrix.h
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-06-13 19:39:03 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-06-13 19:39:03 +0000
commit4d0078aa5115fab8ccd8ef59519a8937ea4e8854 (patch)
tree7206ce8675f4a03b82ec3d975dd02f83c22f0578 /src/core/SkBitmapProcState_matrix.h
parent4d73ac22a1b99402fc8cff78a4eb4b27aa8fe019 (diff)
Fix calling (and checking) the decal_ functions when the input is SkFractionalInt.
The bug was to cast to SkFixed from SkFractionalInt, when what we needed to do was shift the fractional guy down to fixed. This bug was only caught on an android device w/o neon, since other configs have assembly for their matrixproc that didn't have this bug. Review URL: https://codereview.appspot.com/6303074 git-svn-id: http://skia.googlecode.com/svn/trunk@4256 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkBitmapProcState_matrix.h')
-rw-r--r--src/core/SkBitmapProcState_matrix.h17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/core/SkBitmapProcState_matrix.h b/src/core/SkBitmapProcState_matrix.h
index 5ea780e9b7..469cbf3ad4 100644
--- a/src/core/SkBitmapProcState_matrix.h
+++ b/src/core/SkBitmapProcState_matrix.h
@@ -71,12 +71,9 @@ void SCALE_NOFILTER_NAME(const SkBitmapProcState& s,
const SkFractionalInt dx = s.fInvSxFractionalInt;
#ifdef CHECK_FOR_DECAL
- // test if we don't need to apply the tile proc
- SkFixed tmpFx = SkFractionalIntToFixed(fx);
- SkFixed tmpDx = SkFractionalIntToFixed(dx);
- if ((unsigned)(tmpFx >> 16) <= maxX &&
- (unsigned)((tmpFx + tmpDx * (count - 1)) >> 16) <= maxX) {
- decal_nofilter_scale(xy, tmpFx, tmpDx, count);
+ if (can_truncate_to_fixed_for_decal(fx, dx, count, maxX)) {
+ decal_nofilter_scale(xy, SkFractionalIntToFixed(fx),
+ SkFractionalIntToFixed(dx), count);
} else
#endif
{
@@ -201,11 +198,9 @@ void SCALE_FILTER_NAME(const SkBitmapProcState& s,
}
#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(xy, (SkFixed) fx, (SkFixed) dx, count);
+ if (can_truncate_to_fixed_for_decal(fx, dx, count, maxX)) {
+ decal_filter_scale(xy, SkFractionalIntToFixed(fx),
+ SkFractionalIntToFixed(dx), count);
} else
#endif
{