OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2008 Google Inc. | 2 * Copyright 2008 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 // The copyright below was added in 2009, but I see no record of moto contributi ons...? | 8 // The copyright below was added in 2009, but I see no record of moto contributi ons...? |
9 | 9 |
10 /* NEON optimized code (C) COPYRIGHT 2009 Motorola | 10 /* NEON optimized code (C) COPYRIGHT 2009 Motorola |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
96 | 96 |
97 #define MAKENAME(suffix) RepeatX_RepeatY ## suffix | 97 #define MAKENAME(suffix) RepeatX_RepeatY ## suffix |
98 #define TILEX_PROCF(fx, max) SK_USHIFT16(((fx) & 0xFFFF) * ((max) + 1)) | 98 #define TILEX_PROCF(fx, max) SK_USHIFT16(((fx) & 0xFFFF) * ((max) + 1)) |
99 #define TILEY_PROCF(fy, max) SK_USHIFT16(((fy) & 0xFFFF) * ((max) + 1)) | 99 #define TILEY_PROCF(fy, max) SK_USHIFT16(((fy) & 0xFFFF) * ((max) + 1)) |
100 #define TILEX_LOW_BITS(fx, max) ((((fx) & 0xFFFF) * ((max) + 1) >> 12) & 0xF) | 100 #define TILEX_LOW_BITS(fx, max) ((((fx) & 0xFFFF) * ((max) + 1) >> 12) & 0xF) |
101 #define TILEY_LOW_BITS(fy, max) ((((fy) & 0xFFFF) * ((max) + 1) >> 12) & 0xF) | 101 #define TILEY_LOW_BITS(fy, max) ((((fy) & 0xFFFF) * ((max) + 1) >> 12) & 0xF) |
102 #include "SkBitmapProcState_matrix.h" | 102 #include "SkBitmapProcState_matrix.h" |
103 | 103 |
104 struct RepeatTileProcs { | 104 struct RepeatTileProcs { |
105 static unsigned X(const SkBitmapProcState&, SkFixed fx, int max) { | 105 static unsigned X(const SkBitmapProcState&, SkFixed fx, int max) { |
106 return SK_USHIFT16(((fx) & 0xFFFF) * ((max) + 1)); | 106 return SK_USHIFT16((long)((fx) & 0xFFFF) * ((max) + 1)); |
mtklein
2015/12/07 17:58:16
Let's do long -> int64_t? long is funky across co
| |
107 } | 107 } |
108 static unsigned Y(const SkBitmapProcState&, SkFixed fy, int max) { | 108 static unsigned Y(const SkBitmapProcState&, SkFixed fy, int max) { |
109 return SK_USHIFT16(((fy) & 0xFFFF) * ((max) + 1)); | 109 return SK_USHIFT16((long)((fy) & 0xFFFF) * ((max) + 1)); |
110 } | 110 } |
111 }; | 111 }; |
112 | 112 |
113 static SkBitmapProcState::MatrixProc RepeatX_RepeatY_Procs[] = { | 113 static SkBitmapProcState::MatrixProc RepeatX_RepeatY_Procs[] = { |
114 NoFilterProc_Scale<RepeatTileProcs, false>, | 114 NoFilterProc_Scale<RepeatTileProcs, false>, |
115 RepeatX_RepeatY_filter_scale, | 115 RepeatX_RepeatY_filter_scale, |
116 NoFilterProc_Affine<RepeatTileProcs>, | 116 NoFilterProc_Affine<RepeatTileProcs>, |
117 RepeatX_RepeatY_filter_affine, | 117 RepeatX_RepeatY_filter_affine, |
118 NoFilterProc_Persp<RepeatTileProcs>, | 118 NoFilterProc_Persp<RepeatTileProcs>, |
119 RepeatX_RepeatY_filter_persp | 119 RepeatX_RepeatY_filter_persp |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
522 if (SkShader::kRepeat_TileMode == fTileModeX && SkShader::kRepeat_TileMode = = fTileModeY) { | 522 if (SkShader::kRepeat_TileMode == fTileModeX && SkShader::kRepeat_TileMode = = fTileModeY) { |
523 return SK_ARM_NEON_WRAP(RepeatX_RepeatY_Procs)[index]; | 523 return SK_ARM_NEON_WRAP(RepeatX_RepeatY_Procs)[index]; |
524 } | 524 } |
525 | 525 |
526 fTileProcX = choose_tile_proc(fTileModeX); | 526 fTileProcX = choose_tile_proc(fTileModeX); |
527 fTileProcY = choose_tile_proc(fTileModeY); | 527 fTileProcY = choose_tile_proc(fTileModeY); |
528 fTileLowBitsProcX = choose_tile_lowbits_proc(fTileModeX); | 528 fTileLowBitsProcX = choose_tile_lowbits_proc(fTileModeX); |
529 fTileLowBitsProcY = choose_tile_lowbits_proc(fTileModeY); | 529 fTileLowBitsProcY = choose_tile_lowbits_proc(fTileModeY); |
530 return GeneralXY_Procs[index]; | 530 return GeneralXY_Procs[index]; |
531 } | 531 } |
OLD | NEW |