| 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 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 }; | 392 }; |
| 393 | 393 |
| 394 /////////////////////////////////////////////////////////////////////////////// | 394 /////////////////////////////////////////////////////////////////////////////// |
| 395 | 395 |
| 396 // Base class for GL gradient effects | 396 // Base class for GL gradient effects |
| 397 class GrGLGradientEffect : public GrGLFragmentProcessor { | 397 class GrGLGradientEffect : public GrGLFragmentProcessor { |
| 398 public: | 398 public: |
| 399 GrGLGradientEffect(); | 399 GrGLGradientEffect(); |
| 400 virtual ~GrGLGradientEffect(); | 400 virtual ~GrGLGradientEffect(); |
| 401 | 401 |
| 402 void setData(const GrGLProgramDataManager&, const GrProcessor&) override; | 402 protected: |
| 403 void onSetData(const GrGLProgramDataManager&, const GrProcessor&) override; |
| 403 | 404 |
| 404 protected: | 405 protected: |
| 405 /** | 406 /** |
| 406 * Subclasses must call this. It will return a key for the part of the shade
r code controlled | 407 * Subclasses must call this. It will return a key for the part of the shade
r code controlled |
| 407 * by the base class. The subclasses must stick it in their key and then pas
s it to the below | 408 * by the base class. The subclasses must stick it in their key and then pas
s it to the below |
| 408 * emit* functions from their emitCode function. | 409 * emit* functions from their emitCode function. |
| 409 */ | 410 */ |
| 410 static uint32_t GenBaseGradientKey(const GrProcessor&); | 411 static uint32_t GenBaseGradientKey(const GrProcessor&); |
| 411 | 412 |
| 412 // Emits the uniform used as the y-coord to texture samples in derived class
es. Subclasses | 413 // Emits the uniform used as the y-coord to texture samples in derived class
es. Subclasses |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 GrGLProgramDataManager::UniformHandle fColorStartUni; | 447 GrGLProgramDataManager::UniformHandle fColorStartUni; |
| 447 GrGLProgramDataManager::UniformHandle fColorMidUni; | 448 GrGLProgramDataManager::UniformHandle fColorMidUni; |
| 448 GrGLProgramDataManager::UniformHandle fColorEndUni; | 449 GrGLProgramDataManager::UniformHandle fColorEndUni; |
| 449 | 450 |
| 450 typedef GrGLFragmentProcessor INHERITED; | 451 typedef GrGLFragmentProcessor INHERITED; |
| 451 }; | 452 }; |
| 452 | 453 |
| 453 #endif | 454 #endif |
| 454 | 455 |
| 455 #endif | 456 #endif |
| OLD | NEW |