| 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 uint8_t fGradFlags; | 198 uint8_t fGradFlags; |
| 199 | 199 |
| 200 struct Rec { | 200 struct Rec { |
| 201 SkFixed fPos; // 0...1 | 201 SkFixed fPos; // 0...1 |
| 202 uint32_t fScale; // (1 << 24) / range | 202 uint32_t fScale; // (1 << 24) / range |
| 203 }; | 203 }; |
| 204 Rec* fRecs; | 204 Rec* fRecs; |
| 205 | 205 |
| 206 void commonAsAGradient(GradientInfo*) const; | 206 void commonAsAGradient(GradientInfo*) const; |
| 207 | 207 |
| 208 // Used for 2-pt conical gradients since we sort start/end cirlces by radius |
| 209 // Assumes space has already been allocated for fOrigColors |
| 210 void flipGradientColors(); |
| 211 |
| 208 private: | 212 private: |
| 209 enum { | 213 enum { |
| 210 kColorStorageCount = 4, // more than this many colors, and we'll use sk_
malloc for the space | 214 kColorStorageCount = 4, // more than this many colors, and we'll use sk_
malloc for the space |
| 211 | 215 |
| 212 kStorageSize = kColorStorageCount * (sizeof(SkColor) + sizeof(Rec)) | 216 kStorageSize = kColorStorageCount * (sizeof(SkColor) + sizeof(Rec)) |
| 213 }; | 217 }; |
| 214 SkColor fStorage[(kStorageSize + 3) >> 2]; | 218 SkColor fStorage[(kStorageSize + 3) >> 2]; |
| 215 SkColor* fOrigColors; // original colors, before modulation by paint in c
ontext. | 219 SkColor* fOrigColors; // original colors, before modulation by paint in c
ontext. |
| 216 bool fColorsAreOpaque; | 220 bool fColorsAreOpaque; |
| 217 | 221 |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 GrGLUniformManager::UniformHandle fColorStartUni; | 427 GrGLUniformManager::UniformHandle fColorStartUni; |
| 424 GrGLUniformManager::UniformHandle fColorMidUni; | 428 GrGLUniformManager::UniformHandle fColorMidUni; |
| 425 GrGLUniformManager::UniformHandle fColorEndUni; | 429 GrGLUniformManager::UniformHandle fColorEndUni; |
| 426 | 430 |
| 427 typedef GrGLEffect INHERITED; | 431 typedef GrGLEffect INHERITED; |
| 428 }; | 432 }; |
| 429 | 433 |
| 430 #endif | 434 #endif |
| 431 | 435 |
| 432 #endif | 436 #endif |
| OLD | NEW |