Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: src/effects/gradients/SkGradientShaderPriv.h

Issue 492963002: extend SkShader to report a luminance-color to be used for gamma correction (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« src/effects/gradients/SkGradientShader.cpp ('K') | « src/effects/gradients/SkGradientShader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698