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

Side by Side 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, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include "SkBitmapProcState.h" 1 #include "SkBitmapProcState.h"
2 #include "SkPerspIter.h" 2 #include "SkPerspIter.h"
3 #include "SkShader.h" 3 #include "SkShader.h"
4 4
5 void decal_nofilter_scale(uint32_t dst[], SkFixed fx, SkFixed dx, int count); 5 void decal_nofilter_scale(uint32_t dst[], SkFixed fx, SkFixed dx, int count);
6 void decal_filter_scale(uint32_t dst[], SkFixed fx, SkFixed dx, int count); 6 void decal_filter_scale(uint32_t dst[], SkFixed fx, SkFixed dx, int count);
7 7
8 #ifdef SK_CPU_BENDIAN 8 #ifdef SK_CPU_BENDIAN
9 #define PACK_TWO_SHORTS(pri, sec) ((pri) << 16 | (sec)) 9 #define PACK_TWO_SHORTS(pri, sec) ((pri) << 16 | (sec))
10 #else 10 #else
(...skipping 19 matching lines...) Expand all
30 #define CHECK_FOR_DECAL 30 #define CHECK_FOR_DECAL
31 #define TILEX_TRANS(x, max) SkClampMax(x, max) 31 #define TILEX_TRANS(x, max) SkClampMax(x, max)
32 #define TILEY_TRANS(y, max) SkClampMax(y, max) 32 #define TILEY_TRANS(y, max) SkClampMax(y, max)
33 #include "SkBitmapProcState_matrix.h" 33 #include "SkBitmapProcState_matrix.h"
34 34
35 #define MAKENAME(suffix) RepeatX_RepeatY ## suffix 35 #define MAKENAME(suffix) RepeatX_RepeatY ## suffix
36 #define TILEX_PROCF(fx, max) (((fx) & 0xFFFF) * ((max) + 1) >> 16) 36 #define TILEX_PROCF(fx, max) (((fx) & 0xFFFF) * ((max) + 1) >> 16)
37 #define TILEY_PROCF(fy, max) (((fy) & 0xFFFF) * ((max) + 1) >> 16) 37 #define TILEY_PROCF(fy, max) (((fy) & 0xFFFF) * ((max) + 1) >> 16)
38 #define TILEX_LOW_BITS(fx, max) ((((fx) & 0xFFFF) * ((max) + 1) >> 12) & 0xF) 38 #define TILEX_LOW_BITS(fx, max) ((((fx) & 0xFFFF) * ((max) + 1) >> 12) & 0xF)
39 #define TILEY_LOW_BITS(fy, max) ((((fy) & 0xFFFF) * ((max) + 1) >> 12) & 0xF) 39 #define TILEY_LOW_BITS(fy, max) ((((fy) & 0xFFFF) * ((max) + 1) >> 12) & 0xF)
40 #define TILEX_TRANS(x, max) ((x) % ((max) + 1)) 40 #define SK_MOD(a, b) (((a)%(b)) < 0 ? ((a)%(b) + (b)) : (a)%(b))
41 #define TILEY_TRANS(y, max) ((y) % ((max) + 1)) 41 #define TILEX_TRANS(x, max) (SK_MOD((x), ((max) + 1)))
42 #define TILEY_TRANS(y, max) (SK_MOD((y), ((max) + 1)))
42 #include "SkBitmapProcState_matrix.h" 43 #include "SkBitmapProcState_matrix.h"
43 44
44 #define MAKENAME(suffix) GeneralXY ## suffix 45 #define MAKENAME(suffix) GeneralXY ## suffix
45 #define PREAMBLE(state) SkBitmapProcState::FixedTileProc tileProcX = (st ate).fTileProcX; \ 46 #define PREAMBLE(state) SkBitmapProcState::FixedTileProc tileProcX = (st ate).fTileProcX; \
46 SkBitmapProcState::FixedTileProc tileProcY = (st ate).fTileProcY 47 SkBitmapProcState::FixedTileProc tileProcY = (st ate).fTileProcY
47 #define PREAMBLE_PARAM_X , SkBitmapProcState::FixedTileProc tileProcX 48 #define PREAMBLE_PARAM_X , SkBitmapProcState::FixedTileProc tileProcX
48 #define PREAMBLE_PARAM_Y , SkBitmapProcState::FixedTileProc tileProcY 49 #define PREAMBLE_PARAM_Y , SkBitmapProcState::FixedTileProc tileProcY
49 #define PREAMBLE_ARG_X , tileProcX 50 #define PREAMBLE_ARG_X , tileProcX
50 #define PREAMBLE_ARG_Y , tileProcY 51 #define PREAMBLE_ARG_Y , tileProcY
51 #define TILEX_PROCF(fx, max) (tileProcX(fx, max) >> 16) 52 #define TILEX_PROCF(fx, max) (tileProcX(fx, max) >> 16)
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 while ((count -= width) >= 0) 241 while ((count -= width) >= 0)
241 for (i = 0; i < width; i++) 242 for (i = 0; i < width; i++)
242 *xx++ = SkToU16(i); 243 *xx++ = SkToU16(i);
243 244
244 // final cleanup run 245 // final cleanup run
245 count += width; 246 count += width;
246 for (i = 0; i < count; i++) 247 for (i = 0; i < count; i++)
247 *xx++ = SkToU16(i); 248 *xx++ = SkToU16(i);
248 } 249 }
249 250
OLDNEW
« 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