Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 44 } | 44 } |
| 45 | 45 |
| 46 // Repeat | 46 // Repeat |
| 47 | 47 |
| 48 static inline SkFixed repeat_tileproc(SkFixed x) { | 48 static inline SkFixed repeat_tileproc(SkFixed x) { |
| 49 return x & 0xFFFF; | 49 return x & 0xFFFF; |
| 50 } | 50 } |
| 51 | 51 |
| 52 // Mirror | 52 // Mirror |
| 53 | 53 |
| 54 // Visual Studio 2010 (MSC_VER=1600) optimizes bit-shift code incorrectly. | |
| 55 // See http://code.google.com/p/skia/issues/detail?id=472 | |
| 56 #if defined(_MSC_VER) && (_MSC_VER >= 1600) | |
|
mtklein
2016/03/10 17:37:47
ditto
| |
| 57 #pragma optimize("", off) | |
| 58 #endif | |
| 59 | |
| 60 static inline SkFixed mirror_tileproc(SkFixed x) { | 54 static inline SkFixed mirror_tileproc(SkFixed x) { |
| 61 int s = SkLeftShift(x, 15) >> 31; | 55 int s = SkLeftShift(x, 15) >> 31; |
| 62 return (x ^ s) & 0xFFFF; | 56 return (x ^ s) & 0xFFFF; |
| 63 } | 57 } |
| 64 | 58 |
| 65 #if defined(_MSC_VER) && (_MSC_VER >= 1600) | |
| 66 #pragma optimize("", on) | |
| 67 #endif | |
| 68 | |
| 69 /////////////////////////////////////////////////////////////////////////////// | 59 /////////////////////////////////////////////////////////////////////////////// |
| 70 | 60 |
| 71 typedef SkFixed (*TileProc)(SkFixed); | 61 typedef SkFixed (*TileProc)(SkFixed); |
| 72 | 62 |
| 73 /////////////////////////////////////////////////////////////////////////////// | 63 /////////////////////////////////////////////////////////////////////////////// |
| 74 | 64 |
| 75 static const TileProc gTileProcs[] = { | 65 static const TileProc gTileProcs[] = { |
| 76 clamp_tileproc, | 66 clamp_tileproc, |
| 77 repeat_tileproc, | 67 repeat_tileproc, |
| 78 mirror_tileproc | 68 mirror_tileproc |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 457 GrGLSLProgramDataManager::UniformHandle fColorStartUni; | 447 GrGLSLProgramDataManager::UniformHandle fColorStartUni; |
| 458 GrGLSLProgramDataManager::UniformHandle fColorMidUni; | 448 GrGLSLProgramDataManager::UniformHandle fColorMidUni; |
| 459 GrGLSLProgramDataManager::UniformHandle fColorEndUni; | 449 GrGLSLProgramDataManager::UniformHandle fColorEndUni; |
| 460 | 450 |
| 461 typedef GrGLSLFragmentProcessor INHERITED; | 451 typedef GrGLSLFragmentProcessor INHERITED; |
| 462 }; | 452 }; |
| 463 | 453 |
| 464 #endif | 454 #endif |
| 465 | 455 |
| 466 #endif | 456 #endif |
| OLD | NEW |