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

Unified Diff: skia/sgl/SkBitmapProcState_matrixProcs.cpp

Issue 55044: In certain cases, the coordinates used for pattern rendering can go... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/sgl/SkBitmapProcState_matrixProcs.cpp
===================================================================
--- skia/sgl/SkBitmapProcState_matrixProcs.cpp (revision 12696)
+++ skia/sgl/SkBitmapProcState_matrixProcs.cpp (working copy)
@@ -37,8 +37,9 @@
#define TILEY_PROCF(fy, max) (((fy) & 0xFFFF) * ((max) + 1) >> 16)
#define TILEX_LOW_BITS(fx, max) ((((fx) & 0xFFFF) * ((max) + 1) >> 12) & 0xF)
#define TILEY_LOW_BITS(fy, max) ((((fy) & 0xFFFF) * ((max) + 1) >> 12) & 0xF)
-#define TILEX_TRANS(x, max) ((x) % ((max) + 1))
-#define TILEY_TRANS(y, max) ((y) % ((max) + 1))
+#define SK_MOD(a, b) (((a)%(b)) < 0 ? ((a)%(b) + (b)) : (a)%(b))
+#define TILEX_TRANS(x, max) (SK_MOD((x), ((max) + 1)))
+#define TILEY_TRANS(y, max) (SK_MOD((y), ((max) + 1)))
#include "SkBitmapProcState_matrix.h"
#define MAKENAME(suffix) GeneralXY ## suffix
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698