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

Side by Side Diff: src/core/SkBitmapProcState_matrixProcs.cpp

Issue 1503423003: ubsan shift fixes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add cast to work around win compiler Created 5 years 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
« no previous file with comments | « include/core/SkTypes.h ('k') | src/core/SkEdge.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 return x & 0xFFFF; 171 return x & 0xFFFF;
172 } 172 }
173 173
174 // Visual Studio 2010 (MSC_VER=1600) optimizes bit-shift code incorrectly. 174 // Visual Studio 2010 (MSC_VER=1600) optimizes bit-shift code incorrectly.
175 // See http://code.google.com/p/skia/issues/detail?id=472 175 // See http://code.google.com/p/skia/issues/detail?id=472
176 #if defined(_MSC_VER) && (_MSC_VER >= 1600) 176 #if defined(_MSC_VER) && (_MSC_VER >= 1600)
177 #pragma optimize("", off) 177 #pragma optimize("", off)
178 #endif 178 #endif
179 179
180 static inline U16CPU fixed_mirror(SkFixed x) { 180 static inline U16CPU fixed_mirror(SkFixed x) {
181 SkFixed s = x << 15 >> 31; 181 SkFixed s = SkLeftShift(x, 15) >> 31;
182 // s is FFFFFFFF if we're on an odd interval, or 0 if an even interval 182 // s is FFFFFFFF if we're on an odd interval, or 0 if an even interval
183 return (x ^ s) & 0xFFFF; 183 return (x ^ s) & 0xFFFF;
184 } 184 }
185 185
186 #if defined(_MSC_VER) && (_MSC_VER >= 1600) 186 #if defined(_MSC_VER) && (_MSC_VER >= 1600)
187 #pragma optimize("", on) 187 #pragma optimize("", on)
188 #endif 188 #endif
189 189
190 static SkBitmapProcState::FixedTileProc choose_tile_proc(unsigned m) { 190 static SkBitmapProcState::FixedTileProc choose_tile_proc(unsigned m) {
191 if (SkShader::kClamp_TileMode == m) { 191 if (SkShader::kClamp_TileMode == m) {
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 if (SkShader::kRepeat_TileMode == fTileModeX && SkShader::kRepeat_TileMode = = fTileModeY) { 524 if (SkShader::kRepeat_TileMode == fTileModeX && SkShader::kRepeat_TileMode = = fTileModeY) {
525 return SK_ARM_NEON_WRAP(RepeatX_RepeatY_Procs)[index]; 525 return SK_ARM_NEON_WRAP(RepeatX_RepeatY_Procs)[index];
526 } 526 }
527 527
528 fTileProcX = choose_tile_proc(fTileModeX); 528 fTileProcX = choose_tile_proc(fTileModeX);
529 fTileProcY = choose_tile_proc(fTileModeY); 529 fTileProcY = choose_tile_proc(fTileModeY);
530 fTileLowBitsProcX = choose_tile_lowbits_proc(fTileModeX); 530 fTileLowBitsProcX = choose_tile_lowbits_proc(fTileModeX);
531 fTileLowBitsProcY = choose_tile_lowbits_proc(fTileModeY); 531 fTileLowBitsProcY = choose_tile_lowbits_proc(fTileModeY);
532 return GeneralXY_Procs[index]; 532 return GeneralXY_Procs[index];
533 } 533 }
OLDNEW
« no previous file with comments | « include/core/SkTypes.h ('k') | src/core/SkEdge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698