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

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: 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
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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 return x & 0xFFFF; 169 return x & 0xFFFF;
170 } 170 }
171 171
172 // Visual Studio 2010 (MSC_VER=1600) optimizes bit-shift code incorrectly. 172 // Visual Studio 2010 (MSC_VER=1600) optimizes bit-shift code incorrectly.
173 // See http://code.google.com/p/skia/issues/detail?id=472 173 // See http://code.google.com/p/skia/issues/detail?id=472
174 #if defined(_MSC_VER) && (_MSC_VER >= 1600) 174 #if defined(_MSC_VER) && (_MSC_VER >= 1600)
175 #pragma optimize("", off) 175 #pragma optimize("", off)
176 #endif 176 #endif
177 177
178 static inline U16CPU fixed_mirror(SkFixed x) { 178 static inline U16CPU fixed_mirror(SkFixed x) {
179 SkFixed s = x << 15 >> 31; 179 SkFixed s = x * (1 << 15) >> 31;
180 // s is FFFFFFFF if we're on an odd interval, or 0 if an even interval 180 // s is FFFFFFFF if we're on an odd interval, or 0 if an even interval
181 return (x ^ s) & 0xFFFF; 181 return (x ^ s) & 0xFFFF;
182 } 182 }
183 183
184 #if defined(_MSC_VER) && (_MSC_VER >= 1600) 184 #if defined(_MSC_VER) && (_MSC_VER >= 1600)
185 #pragma optimize("", on) 185 #pragma optimize("", on)
186 #endif 186 #endif
187 187
188 static SkBitmapProcState::FixedTileProc choose_tile_proc(unsigned m) { 188 static SkBitmapProcState::FixedTileProc choose_tile_proc(unsigned m) {
189 if (SkShader::kClamp_TileMode == m) { 189 if (SkShader::kClamp_TileMode == m) {
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« include/core/SkFixed.h ('K') | « include/core/SkFixed.h ('k') | src/core/SkEdge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698