check decal in 32.32 where we walk decal in 32.32

The debug checks caught a place in a few layout tests where it looked
like we could decal in 16.16, but the extra 32.32 precision accumulates
just enough along the line that we need to clamp the last pixel.

Looks like no GM diffs or Google3 diffs.

Change-Id: I86360021933c7bc9d5a8328809e812db0dfc5d3b
Reviewed-on: https://skia-review.googlesource.com/c/173440
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
diff --git a/src/core/SkBitmapProcState_matrix.h b/src/core/SkBitmapProcState_matrix.h
index 542e5bf..74df5d6 100644
--- a/src/core/SkBitmapProcState_matrix.h
+++ b/src/core/SkBitmapProcState_matrix.h
@@ -41,10 +41,10 @@
     }
 
 #ifdef CHECK_FOR_DECAL
-    // TODO: can_truncate_to_fixed_for_decal() is kind of misnamed now that
-    // we're not really stepping in SkFixed (16.16) anymore.
-    if (can_truncate_to_fixed_for_decal(SkFractionalIntToFixed(fx),
-                                        SkFractionalIntToFixed(dx), count, maxX)) {
+    // For historical reasons we check both ends are < maxX rather than <= maxX.
+    // TODO: try changing this?  See also can_truncate_to_fixed_for_decal().
+    if ((unsigned)SkFractionalIntToInt(fx               ) < maxX &&
+        (unsigned)SkFractionalIntToInt(fx + dx*(count-1)) < maxX) {
         while (count --> 0) {
             SkFixed fixedFx = SkFractionalIntToFixed(fx);
             SkASSERT((fixedFx >> (16 + 14)) == 0);