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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 uint16_t* fCache16Storage; // Storage for fCache16, allocated
on demand. | 135 uint16_t* fCache16Storage; // Storage for fCache16, allocated
on demand. |
136 SkMallocPixelRef* fCache32PixelRef; | 136 SkMallocPixelRef* fCache32PixelRef; |
137 const unsigned fCacheAlpha; // The alpha value we used when we
computed the cache. | 137 const unsigned fCacheAlpha; // The alpha value we used when we
computed the cache. |
138 // Larger than 8bits so we can sto
re uninitialized | 138 // Larger than 8bits so we can sto
re uninitialized |
139 // value. | 139 // value. |
140 const bool fCacheDither; // The dither flag used when we co
mputed the cache. | 140 const bool fCacheDither; // The dither flag used when we co
mputed the cache. |
141 | 141 |
142 const SkGradientShaderBase& fShader; | 142 const SkGradientShaderBase& fShader; |
143 | 143 |
144 // Make sure we only initialize the caches once. | 144 // Make sure we only initialize the caches once. |
145 bool fCache16Inited, fCache32Inited; | 145 SkOnce fCache16InitOnce, |
146 SkMutex fCache16Mutex, fCache32Mutex; | 146 fCache32InitOnce; |
147 | 147 |
148 static void initCache16(GradientShaderCache* cache); | 148 static void initCache16(GradientShaderCache* cache); |
149 static void initCache32(GradientShaderCache* cache); | 149 static void initCache32(GradientShaderCache* cache); |
150 | 150 |
151 static void Build16bitCache(uint16_t[], SkColor c0, SkColor c1, int coun
t, bool dither); | 151 static void Build16bitCache(uint16_t[], SkColor c0, SkColor c1, int coun
t, bool dither); |
152 static void Build32bitCache(SkPMColor[], SkColor c0, SkColor c1, int cou
nt, | 152 static void Build32bitCache(SkPMColor[], SkColor c0, SkColor c1, int cou
nt, |
153 U8CPU alpha, uint32_t gradFlags, bool dither
); | 153 U8CPU alpha, uint32_t gradFlags, bool dither
); |
154 }; | 154 }; |
155 | 155 |
156 class GradientShaderBaseContext : public SkShader::Context { | 156 class GradientShaderBaseContext : public SkShader::Context { |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 GrGLSLProgramDataManager::UniformHandle fColorStartUni; | 447 GrGLSLProgramDataManager::UniformHandle fColorStartUni; |
448 GrGLSLProgramDataManager::UniformHandle fColorMidUni; | 448 GrGLSLProgramDataManager::UniformHandle fColorMidUni; |
449 GrGLSLProgramDataManager::UniformHandle fColorEndUni; | 449 GrGLSLProgramDataManager::UniformHandle fColorEndUni; |
450 | 450 |
451 typedef GrGLSLFragmentProcessor INHERITED; | 451 typedef GrGLSLFragmentProcessor INHERITED; |
452 }; | 452 }; |
453 | 453 |
454 #endif | 454 #endif |
455 | 455 |
456 #endif | 456 #endif |
OLD | NEW |