| 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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 protected: | 382 protected: |
| 383 /** | 383 /** |
| 384 * Subclasses must call this. It will return a key for the part of the shade
r code controlled | 384 * Subclasses must call this. It will return a key for the part of the shade
r code controlled |
| 385 * by the base class. The subclasses must stick it in their key and then pas
s it to the below | 385 * by the base class. The subclasses must stick it in their key and then pas
s it to the below |
| 386 * emit* functions from their emitCode function. | 386 * emit* functions from their emitCode function. |
| 387 */ | 387 */ |
| 388 static uint32_t GenBaseGradientKey(const GrDrawEffect&); | 388 static uint32_t GenBaseGradientKey(const GrDrawEffect&); |
| 389 | 389 |
| 390 // Emits the uniform used as the y-coord to texture samples in derived class
es. Subclasses | 390 // Emits the uniform used as the y-coord to texture samples in derived class
es. Subclasses |
| 391 // should call this method from their emitCode(). | 391 // should call this method from their emitCode(). |
| 392 void emitUniforms(GrGLShaderBuilder* builder, uint32_t baseKey); | 392 void emitUniforms(GrGLProgramBuilder* builder, uint32_t baseKey); |
| 393 | 393 |
| 394 | 394 |
| 395 // emit code that gets a fragment's color from an expression for t; Has bran
ches for 3 separate | 395 // emit code that gets a fragment's color from an expression for t; Has bran
ches for 3 separate |
| 396 // control flows inside -- 2 color gradients, 3 color symmetric gradients (b
oth using | 396 // control flows inside -- 2 color gradients, 3 color symmetric gradients (b
oth using |
| 397 // native GLSL mix), and 4+ color gradients that use the traditional texture
lookup. | 397 // native GLSL mix), and 4+ color gradients that use the traditional texture
lookup. |
| 398 void emitColor(GrGLShaderBuilder* builder, | 398 void emitColor(GrGLProgramBuilder* builder, |
| 399 const char* gradientTValue, | 399 const char* gradientTValue, |
| 400 uint32_t baseKey, | 400 uint32_t baseKey, |
| 401 const char* outputColor, | 401 const char* outputColor, |
| 402 const char* inputColor, | 402 const char* inputColor, |
| 403 const TextureSamplerArray& samplers); | 403 const TextureSamplerArray& samplers); |
| 404 | 404 |
| 405 private: | 405 private: |
| 406 enum { | 406 enum { |
| 407 kPremulTypeKeyBitCnt = 1, | 407 kPremulTypeKeyBitCnt = 1, |
| 408 kPremulTypeMask = 1, | 408 kPremulTypeMask = 1, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 GrGLProgramDataManager::UniformHandle fColorStartUni; | 440 GrGLProgramDataManager::UniformHandle fColorStartUni; |
| 441 GrGLProgramDataManager::UniformHandle fColorMidUni; | 441 GrGLProgramDataManager::UniformHandle fColorMidUni; |
| 442 GrGLProgramDataManager::UniformHandle fColorEndUni; | 442 GrGLProgramDataManager::UniformHandle fColorEndUni; |
| 443 | 443 |
| 444 typedef GrGLEffect INHERITED; | 444 typedef GrGLEffect INHERITED; |
| 445 }; | 445 }; |
| 446 | 446 |
| 447 #endif | 447 #endif |
| 448 | 448 |
| 449 #endif | 449 #endif |
| OLD | NEW |