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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 /////////////////////////////////////////////////////////////////////////////// | 82 /////////////////////////////////////////////////////////////////////////////// |
83 | 83 |
84 class SkGradientShaderBase : public SkShader { | 84 class SkGradientShaderBase : public SkShader { |
85 public: | 85 public: |
86 struct Descriptor { | 86 struct Descriptor { |
87 Descriptor() { | 87 Descriptor() { |
88 sk_bzero(this, sizeof(*this)); | 88 sk_bzero(this, sizeof(*this)); |
89 fTileMode = SkShader::kClamp_TileMode; | 89 fTileMode = SkShader::kClamp_TileMode; |
90 } | 90 } |
91 | 91 |
| 92 const SkMatrix* fLocalMatrix; |
92 const SkColor* fColors; | 93 const SkColor* fColors; |
93 const SkScalar* fPos; | 94 const SkScalar* fPos; |
94 int fCount; | 95 int fCount; |
95 SkShader::TileMode fTileMode; | 96 SkShader::TileMode fTileMode; |
96 uint32_t fGradFlags; | 97 uint32_t fGradFlags; |
97 }; | 98 }; |
98 | 99 |
99 public: | 100 public: |
100 SkGradientShaderBase(const Descriptor& desc, const SkMatrix* localMatrix); | 101 SkGradientShaderBase(const Descriptor& desc); |
101 virtual ~SkGradientShaderBase(); | 102 virtual ~SkGradientShaderBase(); |
102 | 103 |
103 // The cache is initialized on-demand when getCache16/32 is called. | 104 // The cache is initialized on-demand when getCache16/32 is called. |
104 class GradientShaderCache : public SkRefCnt { | 105 class GradientShaderCache : public SkRefCnt { |
105 public: | 106 public: |
106 GradientShaderCache(U8CPU alpha, const SkGradientShaderBase& shader); | 107 GradientShaderCache(U8CPU alpha, const SkGradientShaderBase& shader); |
107 ~GradientShaderCache(); | 108 ~GradientShaderCache(); |
108 | 109 |
109 const uint16_t* getCache16(); | 110 const uint16_t* getCache16(); |
110 const SkPMColor* getCache32(); | 111 const SkPMColor* getCache32(); |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 GrGLProgramDataManager::UniformHandle fColorStartUni; | 440 GrGLProgramDataManager::UniformHandle fColorStartUni; |
440 GrGLProgramDataManager::UniformHandle fColorMidUni; | 441 GrGLProgramDataManager::UniformHandle fColorMidUni; |
441 GrGLProgramDataManager::UniformHandle fColorEndUni; | 442 GrGLProgramDataManager::UniformHandle fColorEndUni; |
442 | 443 |
443 typedef GrGLEffect INHERITED; | 444 typedef GrGLEffect INHERITED; |
444 }; | 445 }; |
445 | 446 |
446 #endif | 447 #endif |
447 | 448 |
448 #endif | 449 #endif |
OLD | NEW |