| 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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 GrGLSLUniformHandler* uniformHandler, | 420 GrGLSLUniformHandler* uniformHandler, |
| 421 const GrGLSLCaps* caps, | 421 const GrGLSLCaps* caps, |
| 422 const GrGradientEffect&, | 422 const GrGradientEffect&, |
| 423 const char* gradientTValue, | 423 const char* gradientTValue, |
| 424 const char* outputColor, | 424 const char* outputColor, |
| 425 const char* inputColor, | 425 const char* inputColor, |
| 426 const SamplerHandle* texSamplers); | 426 const SamplerHandle* texSamplers); |
| 427 | 427 |
| 428 private: | 428 private: |
| 429 enum { | 429 enum { |
| 430 kPremulTypeKeyBitCnt = 1, | 430 // First bit for premul before/after interp |
| 431 kPremulTypeMask = 1, | 431 kPremulBeforeInterpKey = 1, |
| 432 kPremulBeforeInterpKey = kPremulTypeMask, | |
| 433 | 432 |
| 434 kTwoColorKey = 2 << kPremulTypeKeyBitCnt, | 433 // Next two bits for 2/3 color type (neither means using texture atlas) |
| 435 kThreeColorKey = 3 << kPremulTypeKeyBitCnt, | 434 kTwoColorKey = 4, |
| 436 kColorKeyMask = kTwoColorKey | kThreeColorKey, | 435 kThreeColorKey = 6, |
| 437 kColorKeyBitCnt = 2, | |
| 438 | |
| 439 // Subclasses must shift any key bits they produce up by this amount | |
| 440 // and combine with the result of GenBaseGradientKey. | |
| 441 kBaseKeyBitCnt = (kPremulTypeKeyBitCnt + kColorKeyBitCnt) | |
| 442 }; | 436 }; |
| 443 GR_STATIC_ASSERT(kBaseKeyBitCnt <= 32); | |
| 444 | 437 |
| 445 SkScalar fCachedYCoord; | 438 SkScalar fCachedYCoord; |
| 446 GrGLSLProgramDataManager::UniformHandle fFSYUni; | 439 GrGLSLProgramDataManager::UniformHandle fFSYUni; |
| 447 GrGLSLProgramDataManager::UniformHandle fColorStartUni; | 440 GrGLSLProgramDataManager::UniformHandle fColorStartUni; |
| 448 GrGLSLProgramDataManager::UniformHandle fColorMidUni; | 441 GrGLSLProgramDataManager::UniformHandle fColorMidUni; |
| 449 GrGLSLProgramDataManager::UniformHandle fColorEndUni; | 442 GrGLSLProgramDataManager::UniformHandle fColorEndUni; |
| 450 | 443 |
| 451 typedef GrGLSLFragmentProcessor INHERITED; | 444 typedef GrGLSLFragmentProcessor INHERITED; |
| 452 }; | 445 }; |
| 453 | 446 |
| 454 #endif | 447 #endif |
| 455 | 448 |
| 456 #endif | 449 #endif |
| OLD | NEW |