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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 uint8_t fGradFlags; | 207 uint8_t fGradFlags; |
208 | 208 |
209 struct Rec { | 209 struct Rec { |
210 SkFixed fPos; // 0...1 | 210 SkFixed fPos; // 0...1 |
211 uint32_t fScale; // (1 << 24) / range | 211 uint32_t fScale; // (1 << 24) / range |
212 }; | 212 }; |
213 Rec* fRecs; | 213 Rec* fRecs; |
214 | 214 |
215 void commonAsAGradient(GradientInfo*, bool flipGrad = false) const; | 215 void commonAsAGradient(GradientInfo*, bool flipGrad = false) const; |
216 | 216 |
| 217 virtual bool onAsLuminanceColor(SkColor*) const SK_OVERRIDE; |
| 218 |
217 /* | 219 /* |
218 * Takes in pointers to gradient color and Rec info as colorSrc and recSrc r
espectively. | 220 * Takes in pointers to gradient color and Rec info as colorSrc and recSrc r
espectively. |
219 * Count is the number of colors in the gradient | 221 * Count is the number of colors in the gradient |
220 * It will then flip all the color and rec information and return in their r
espective Dst | 222 * It will then flip all the color and rec information and return in their r
espective Dst |
221 * pointers. It is assumed that space has already been allocated for the Dst
pointers. | 223 * pointers. It is assumed that space has already been allocated for the Dst
pointers. |
222 * The rec src and dst are only assumed to be valid if count > 2 | 224 * The rec src and dst are only assumed to be valid if count > 2 |
223 */ | 225 */ |
224 static void FlipGradientColors(SkColor* colorDst, Rec* recDst, | 226 static void FlipGradientColors(SkColor* colorDst, Rec* recDst, |
225 SkColor* colorSrc, Rec* recSrc, | 227 SkColor* colorSrc, Rec* recSrc, |
226 int count); | 228 int count); |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 GrGLProgramDataManager::UniformHandle fColorStartUni; | 442 GrGLProgramDataManager::UniformHandle fColorStartUni; |
441 GrGLProgramDataManager::UniformHandle fColorMidUni; | 443 GrGLProgramDataManager::UniformHandle fColorMidUni; |
442 GrGLProgramDataManager::UniformHandle fColorEndUni; | 444 GrGLProgramDataManager::UniformHandle fColorEndUni; |
443 | 445 |
444 typedef GrGLEffect INHERITED; | 446 typedef GrGLEffect INHERITED; |
445 }; | 447 }; |
446 | 448 |
447 #endif | 449 #endif |
448 | 450 |
449 #endif | 451 #endif |
OLD | NEW |