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

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: rebase, add SkShader::CreateColorShader(c) 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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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