| 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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 }; | 396 }; |
| 397 | 397 |
| 398 /////////////////////////////////////////////////////////////////////////////// | 398 /////////////////////////////////////////////////////////////////////////////// |
| 399 | 399 |
| 400 // Base class for GL gradient effects | 400 // Base class for GL gradient effects |
| 401 class GrGLGradientEffect : public GrGLEffect { | 401 class GrGLGradientEffect : public GrGLEffect { |
| 402 public: | 402 public: |
| 403 GrGLGradientEffect(const GrBackendEffectFactory& factory); | 403 GrGLGradientEffect(const GrBackendEffectFactory& factory); |
| 404 virtual ~GrGLGradientEffect(); | 404 virtual ~GrGLGradientEffect(); |
| 405 | 405 |
| 406 virtual void setData(const GrGLProgramDataManager&, const GrEffect&) SK_OVER
RIDE; | 406 virtual void setData(const GrGLProgramDataManager&, const GrDrawEffect&) SK_
OVERRIDE; |
| 407 | 407 |
| 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 GrEffect&); | 414 static uint32_t GenBaseGradientKey(const GrDrawEffect&); |
| 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(GrGLProgramBuilder* 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(GrGLProgramBuilder* builder, |
| (...skipping 41 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 GrGLEffect INHERITED; | 470 typedef GrGLEffect INHERITED; |
| 471 }; | 471 }; |
| 472 | 472 |
| 473 #endif | 473 #endif |
| 474 | 474 |
| 475 #endif | 475 #endif |
| OLD | NEW |