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

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

Issue 1416423003: Make GrGLSLProgramBuilder base class for ProgramBuilder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nit Created 5 years, 1 month 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
« no previous file with comments | « src/effects/gradients/SkGradientShader.cpp ('k') | src/effects/gradients/SkSweepGradient.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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 protected: 407 protected:
408 /** 408 /**
409 * Subclasses must call this. It will return a key for the part of the shade r code controlled 409 * Subclasses must call this. It will return a key for the part of the shade r code controlled
410 * by the base class. The subclasses must stick it in their key and then pas s it to the below 410 * by the base class. The subclasses must stick it in their key and then pas s it to the below
411 * emit* functions from their emitCode function. 411 * emit* functions from their emitCode function.
412 */ 412 */
413 static uint32_t GenBaseGradientKey(const GrProcessor&); 413 static uint32_t GenBaseGradientKey(const GrProcessor&);
414 414
415 // Emits the uniform used as the y-coord to texture samples in derived class es. Subclasses 415 // Emits the uniform used as the y-coord to texture samples in derived class es. Subclasses
416 // should call this method from their emitCode(). 416 // should call this method from their emitCode().
417 void emitUniforms(GrGLFPBuilder* builder, const GrGradientEffect&); 417 void emitUniforms(GrGLSLFPBuilder* builder, const GrGradientEffect&);
418 418
419 419
420 // emit code that gets a fragment's color from an expression for t; Has bran ches for 3 separate 420 // emit code that gets a fragment's color from an expression for t; Has bran ches for 3 separate
421 // control flows inside -- 2 color gradients, 3 color symmetric gradients (b oth using 421 // control flows inside -- 2 color gradients, 3 color symmetric gradients (b oth using
422 // native GLSL mix), and 4+ color gradients that use the traditional texture lookup. 422 // native GLSL mix), and 4+ color gradients that use the traditional texture lookup.
423 void emitColor(GrGLFPBuilder* builder, 423 void emitColor(GrGLSLFPBuilder* builder,
424 const GrGradientEffect&, 424 const GrGradientEffect&,
425 const char* gradientTValue, 425 const char* gradientTValue,
426 const char* outputColor, 426 const char* outputColor,
427 const char* inputColor, 427 const char* inputColor,
428 const TextureSamplerArray& samplers); 428 const TextureSamplerArray& samplers);
429 429
430 private: 430 private:
431 enum { 431 enum {
432 kPremulTypeKeyBitCnt = 1, 432 kPremulTypeKeyBitCnt = 1,
433 kPremulTypeMask = 1, 433 kPremulTypeMask = 1,
(...skipping 15 matching lines...) Expand all
449 GrGLSLProgramDataManager::UniformHandle fColorStartUni; 449 GrGLSLProgramDataManager::UniformHandle fColorStartUni;
450 GrGLSLProgramDataManager::UniformHandle fColorMidUni; 450 GrGLSLProgramDataManager::UniformHandle fColorMidUni;
451 GrGLSLProgramDataManager::UniformHandle fColorEndUni; 451 GrGLSLProgramDataManager::UniformHandle fColorEndUni;
452 452
453 typedef GrGLFragmentProcessor INHERITED; 453 typedef GrGLFragmentProcessor INHERITED;
454 }; 454 };
455 455
456 #endif 456 #endif
457 457
458 #endif 458 #endif
OLDNEW
« no previous file with comments | « src/effects/gradients/SkGradientShader.cpp ('k') | src/effects/gradients/SkSweepGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698