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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 SkColor* colorSrc, Rec* recSrc, | 252 SkColor* colorSrc, Rec* recSrc, |
253 int count); | 253 int count); |
254 | 254 |
255 private: | 255 private: |
256 enum { | 256 enum { |
257 kColorStorageCount = 4, // more than this many colors, and we'll use sk_
malloc for the space | 257 kColorStorageCount = 4, // more than this many colors, and we'll use sk_
malloc for the space |
258 | 258 |
259 kStorageSize = kColorStorageCount * (sizeof(SkColor) + sizeof(SkScalar)
+ sizeof(Rec)) | 259 kStorageSize = kColorStorageCount * (sizeof(SkColor) + sizeof(SkScalar)
+ sizeof(Rec)) |
260 }; | 260 }; |
261 SkColor fStorage[(kStorageSize + 3) >> 2]; | 261 SkColor fStorage[(kStorageSize + 3) >> 2]; |
| 262 public: |
262 SkColor* fOrigColors; // original colors, before modulation by paint in c
ontext. | 263 SkColor* fOrigColors; // original colors, before modulation by paint in c
ontext. |
263 SkScalar* fOrigPos; // original positions | 264 SkScalar* fOrigPos; // original positions |
| 265 private: |
264 bool fColorsAreOpaque; | 266 bool fColorsAreOpaque; |
265 | 267 |
266 GradientShaderCache* refCache(U8CPU alpha, bool dither) const; | 268 GradientShaderCache* refCache(U8CPU alpha, bool dither) const; |
267 mutable SkMutex fCacheMutex; | 269 mutable SkMutex fCacheMutex; |
268 mutable SkAutoTUnref<GradientShaderCache> fCache; | 270 mutable SkAutoTUnref<GradientShaderCache> fCache; |
269 | 271 |
270 void initCommon(); | 272 void initCommon(); |
271 | 273 |
272 typedef SkShader INHERITED; | 274 typedef SkShader INHERITED; |
273 }; | 275 }; |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 GrGLSLProgramDataManager::UniformHandle fColorStartUni; | 451 GrGLSLProgramDataManager::UniformHandle fColorStartUni; |
450 GrGLSLProgramDataManager::UniformHandle fColorMidUni; | 452 GrGLSLProgramDataManager::UniformHandle fColorMidUni; |
451 GrGLSLProgramDataManager::UniformHandle fColorEndUni; | 453 GrGLSLProgramDataManager::UniformHandle fColorEndUni; |
452 | 454 |
453 typedef GrGLFragmentProcessor INHERITED; | 455 typedef GrGLFragmentProcessor INHERITED; |
454 }; | 456 }; |
455 | 457 |
456 #endif | 458 #endif |
457 | 459 |
458 #endif | 460 #endif |
OLD | NEW |