| 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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 protected: | 408 protected: |
| 409 /** | 409 /** |
| 410 * Subclasses must call this. It will return a key for the part of the shade
r code controlled | 410 * Subclasses must call this. It will return a key for the part of the shade
r code controlled |
| 411 * by the base class. The subclasses must stick it in their key and then pas
s it to the below | 411 * by the base class. The subclasses must stick it in their key and then pas
s it to the below |
| 412 * emit* functions from their emitCode function. | 412 * emit* functions from their emitCode function. |
| 413 */ | 413 */ |
| 414 static uint32_t GenBaseGradientKey(const GrProcessor&); | 414 static uint32_t GenBaseGradientKey(const GrProcessor&); |
| 415 | 415 |
| 416 // Emits the uniform used as the y-coord to texture samples in derived class
es. Subclasses | 416 // Emits the uniform used as the y-coord to texture samples in derived class
es. Subclasses |
| 417 // should call this method from their emitCode(). | 417 // should call this method from their emitCode(). |
| 418 void emitUniforms(GrGLProgramBuilder* builder, uint32_t baseKey); | 418 void emitUniforms(GrGLFPBuilder* builder, uint32_t baseKey); |
| 419 | 419 |
| 420 | 420 |
| 421 // emit code that gets a fragment's color from an expression for t; Has bran
ches for 3 separate | 421 // emit code that gets a fragment's color from an expression for t; Has bran
ches for 3 separate |
| 422 // control flows inside -- 2 color gradients, 3 color symmetric gradients (b
oth using | 422 // control flows inside -- 2 color gradients, 3 color symmetric gradients (b
oth using |
| 423 // native GLSL mix), and 4+ color gradients that use the traditional texture
lookup. | 423 // native GLSL mix), and 4+ color gradients that use the traditional texture
lookup. |
| 424 void emitColor(GrGLProgramBuilder* builder, | 424 void emitColor(GrGLFPBuilder* builder, |
| 425 const char* gradientTValue, | 425 const char* gradientTValue, |
| 426 uint32_t baseKey, | 426 uint32_t baseKey, |
| 427 const char* outputColor, | 427 const char* outputColor, |
| 428 const char* inputColor, | 428 const char* inputColor, |
| 429 const TextureSamplerArray& samplers); | 429 const TextureSamplerArray& samplers); |
| 430 | 430 |
| 431 private: | 431 private: |
| 432 enum { | 432 enum { |
| 433 kPremulTypeKeyBitCnt = 1, | 433 kPremulTypeKeyBitCnt = 1, |
| 434 kPremulTypeMask = 1, | 434 kPremulTypeMask = 1, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 GrGLProgramDataManager::UniformHandle fColorStartUni; | 466 GrGLProgramDataManager::UniformHandle fColorStartUni; |
| 467 GrGLProgramDataManager::UniformHandle fColorMidUni; | 467 GrGLProgramDataManager::UniformHandle fColorMidUni; |
| 468 GrGLProgramDataManager::UniformHandle fColorEndUni; | 468 GrGLProgramDataManager::UniformHandle fColorEndUni; |
| 469 | 469 |
| 470 typedef GrGLFragmentProcessor INHERITED; | 470 typedef GrGLFragmentProcessor INHERITED; |
| 471 }; | 471 }; |
| 472 | 472 |
| 473 #endif | 473 #endif |
| 474 | 474 |
| 475 #endif | 475 #endif |
| OLD | NEW |