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