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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 uint8_t fGradFlags; | 230 uint8_t fGradFlags; |
231 | 231 |
232 struct Rec { | 232 struct Rec { |
233 SkFixed fPos; // 0...1 | 233 SkFixed fPos; // 0...1 |
234 uint32_t fScale; // (1 << 24) / range | 234 uint32_t fScale; // (1 << 24) / range |
235 }; | 235 }; |
236 Rec* fRecs; | 236 Rec* fRecs; |
237 | 237 |
238 void commonAsAGradient(GradientInfo*, bool flipGrad = false) const; | 238 void commonAsAGradient(GradientInfo*, bool flipGrad = false) const; |
239 | 239 |
| 240 virtual bool onAsLuminanceColor(SkColor*) const SK_OVERRIDE; |
| 241 |
240 /* | 242 /* |
241 * Takes in pointers to gradient color and Rec info as colorSrc and recSrc r
espectively. | 243 * Takes in pointers to gradient color and Rec info as colorSrc and recSrc r
espectively. |
242 * Count is the number of colors in the gradient | 244 * Count is the number of colors in the gradient |
243 * It will then flip all the color and rec information and return in their r
espective Dst | 245 * It will then flip all the color and rec information and return in their r
espective Dst |
244 * pointers. It is assumed that space has already been allocated for the Dst
pointers. | 246 * pointers. It is assumed that space has already been allocated for the Dst
pointers. |
245 * The rec src and dst are only assumed to be valid if count > 2 | 247 * The rec src and dst are only assumed to be valid if count > 2 |
246 */ | 248 */ |
247 static void FlipGradientColors(SkColor* colorDst, Rec* recDst, | 249 static void FlipGradientColors(SkColor* colorDst, Rec* recDst, |
248 SkColor* colorSrc, Rec* recSrc, | 250 SkColor* colorSrc, Rec* recSrc, |
249 int count); | 251 int count); |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 GrGLProgramDataManager::UniformHandle fColorStartUni; | 466 GrGLProgramDataManager::UniformHandle fColorStartUni; |
465 GrGLProgramDataManager::UniformHandle fColorMidUni; | 467 GrGLProgramDataManager::UniformHandle fColorMidUni; |
466 GrGLProgramDataManager::UniformHandle fColorEndUni; | 468 GrGLProgramDataManager::UniformHandle fColorEndUni; |
467 | 469 |
468 typedef GrGLEffect INHERITED; | 470 typedef GrGLEffect INHERITED; |
469 }; | 471 }; |
470 | 472 |
471 #endif | 473 #endif |
472 | 474 |
473 #endif | 475 #endif |
OLD | NEW |