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

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

Issue 26190003: Potentially optimize some GrGLEffects for known input color values (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « src/effects/gradients/SkGradientShader.cpp ('k') | src/effects/gradients/SkLinearGradient.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 void emitUniforms(GrGLShaderBuilder* builder, EffectKey key); 364 void emitUniforms(GrGLShaderBuilder* builder, EffectKey key);
365 365
366 366
367 // emit code that gets a fragment's color from an expression for t; Has bran ches for 3 separate 367 // emit code that gets a fragment's color from an expression for t; Has bran ches for 3 separate
368 // control flows inside -- 2 color gradients, 3 color symmetric gradients (b oth using 368 // control flows inside -- 2 color gradients, 3 color symmetric gradients (b oth using
369 // native GLSL mix), and 4+ color gradients that use the traditional texture lookup. 369 // native GLSL mix), and 4+ color gradients that use the traditional texture lookup.
370 void emitColor(GrGLShaderBuilder* builder, 370 void emitColor(GrGLShaderBuilder* builder,
371 const char* gradientTValue, 371 const char* gradientTValue,
372 EffectKey key, 372 EffectKey key,
373 const char* outputColor, 373 const char* outputColor,
374 const char* inputColor, 374 const GrGLSLExpr4& inputColor,
375 const TextureSamplerArray& samplers); 375 const TextureSamplerArray& samplers);
376 376
377 private: 377 private:
378 SkScalar fCachedYCoord; 378 SkScalar fCachedYCoord;
379 GrGLUniformManager::UniformHandle fFSYUni; 379 GrGLUniformManager::UniformHandle fFSYUni;
380 GrGLUniformManager::UniformHandle fColorStartUni; 380 GrGLUniformManager::UniformHandle fColorStartUni;
381 GrGLUniformManager::UniformHandle fColorMidUni; 381 GrGLUniformManager::UniformHandle fColorMidUni;
382 GrGLUniformManager::UniformHandle fColorEndUni; 382 GrGLUniformManager::UniformHandle fColorEndUni;
383 383
384 typedef GrGLEffect INHERITED; 384 typedef GrGLEffect INHERITED;
385 }; 385 };
386 386
387 #endif 387 #endif
388 388
389 #endif 389 #endif
OLDNEW
« no previous file with comments | « src/effects/gradients/SkGradientShader.cpp ('k') | src/effects/gradients/SkLinearGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698