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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 private: | 208 private: |
209 enum { | 209 enum { |
210 kColorStorageCount = 4, // more than this many colors, and we'll use sk_
malloc for the space | 210 kColorStorageCount = 4, // more than this many colors, and we'll use sk_
malloc for the space |
211 | 211 |
212 kStorageSize = kColorStorageCount * (sizeof(SkColor) + sizeof(Rec)) | 212 kStorageSize = kColorStorageCount * (sizeof(SkColor) + sizeof(Rec)) |
213 }; | 213 }; |
214 SkColor fStorage[(kStorageSize + 3) >> 2]; | 214 SkColor fStorage[(kStorageSize + 3) >> 2]; |
215 SkColor* fOrigColors; // original colors, before modulation by paint in c
ontext. | 215 SkColor* fOrigColors; // original colors, before modulation by paint in c
ontext. |
216 bool fColorsAreOpaque; | 216 bool fColorsAreOpaque; |
217 | 217 |
218 GradientShaderCache* getCache(U8CPU alpha) const; | 218 GradientShaderCache* refCache(U8CPU alpha) const; |
219 mutable SkMutex fCacheMutex; | 219 mutable SkMutex fCacheMutex; |
220 mutable SkAutoTUnref<GradientShaderCache> fCache; | 220 mutable SkAutoTUnref<GradientShaderCache> fCache; |
221 | 221 |
222 void initCommon(); | 222 void initCommon(); |
223 | 223 |
224 typedef SkShader INHERITED; | 224 typedef SkShader INHERITED; |
225 }; | 225 }; |
226 | 226 |
227 static inline int init_dither_toggle(int x, int y) { | 227 static inline int init_dither_toggle(int x, int y) { |
228 x &= 1; | 228 x &= 1; |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 GrGLUniformManager::UniformHandle fColorStartUni; | 423 GrGLUniformManager::UniformHandle fColorStartUni; |
424 GrGLUniformManager::UniformHandle fColorMidUni; | 424 GrGLUniformManager::UniformHandle fColorMidUni; |
425 GrGLUniformManager::UniformHandle fColorEndUni; | 425 GrGLUniformManager::UniformHandle fColorEndUni; |
426 | 426 |
427 typedef GrGLEffect INHERITED; | 427 typedef GrGLEffect INHERITED; |
428 }; | 428 }; |
429 | 429 |
430 #endif | 430 #endif |
431 | 431 |
432 #endif | 432 #endif |
OLD | NEW |