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

Side by Side Diff: src/effects/gradients/SkGradientShaderPriv.h

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 | « src/effects/gradients/SkClampRange.h ('k') | src/images/SkImageDecoder_libico.cpp » ('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 2012 Google Inc. 2 * Copyright 2012 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 #ifndef SkGradientShaderPriv_DEFINED 8 #ifndef SkGradientShaderPriv_DEFINED
9 #define SkGradientShaderPriv_DEFINED 9 #define SkGradientShaderPriv_DEFINED
10 10
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 // Mirror 52 // Mirror
53 53
54 // Visual Studio 2010 (MSC_VER=1600) optimizes bit-shift code incorrectly. 54 // Visual Studio 2010 (MSC_VER=1600) optimizes bit-shift code incorrectly.
55 // See http://code.google.com/p/skia/issues/detail?id=472 55 // See http://code.google.com/p/skia/issues/detail?id=472
56 #if defined(_MSC_VER) && (_MSC_VER >= 1600) 56 #if defined(_MSC_VER) && (_MSC_VER >= 1600)
57 #pragma optimize("", off) 57 #pragma optimize("", off)
58 #endif 58 #endif
59 59
60 static inline SkFixed mirror_tileproc(SkFixed x) { 60 static inline SkFixed mirror_tileproc(SkFixed x) {
61 int s = x << 15 >> 31; 61 int s = SkLeftShift(x, 15) >> 31;
62 return (x ^ s) & 0xFFFF; 62 return (x ^ s) & 0xFFFF;
63 } 63 }
64 64
65 #if defined(_MSC_VER) && (_MSC_VER >= 1600) 65 #if defined(_MSC_VER) && (_MSC_VER >= 1600)
66 #pragma optimize("", on) 66 #pragma optimize("", on)
67 #endif 67 #endif
68 68
69 /////////////////////////////////////////////////////////////////////////////// 69 ///////////////////////////////////////////////////////////////////////////////
70 70
71 typedef SkFixed (*TileProc)(SkFixed); 71 typedef SkFixed (*TileProc)(SkFixed);
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 GrGLSLProgramDataManager::UniformHandle fColorStartUni; 456 GrGLSLProgramDataManager::UniformHandle fColorStartUni;
457 GrGLSLProgramDataManager::UniformHandle fColorMidUni; 457 GrGLSLProgramDataManager::UniformHandle fColorMidUni;
458 GrGLSLProgramDataManager::UniformHandle fColorEndUni; 458 GrGLSLProgramDataManager::UniformHandle fColorEndUni;
459 459
460 typedef GrGLSLFragmentProcessor INHERITED; 460 typedef GrGLSLFragmentProcessor INHERITED;
461 }; 461 };
462 462
463 #endif 463 #endif
464 464
465 #endif 465 #endif
OLDNEW
« no previous file with comments | « src/effects/gradients/SkClampRange.h ('k') | src/images/SkImageDecoder_libico.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698