| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 SkColor* fColors; | 92 const SkColor* fColors; |
| 93 const SkScalar* fPos; | 93 const SkScalar* fPos; |
| 94 int fCount; | 94 int fCount; |
| 95 SkShader::TileMode fTileMode; | 95 SkShader::TileMode fTileMode; |
| 96 SkUnitMapper* fMapper; | 96 SkUnitMapper* fMapper; |
| 97 uint32_t fFlags; | 97 uint32_t fGradFlags; |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 public: | 100 public: |
| 101 SkGradientShaderBase(const Descriptor& desc); | 101 SkGradientShaderBase(const Descriptor& desc); |
| 102 virtual ~SkGradientShaderBase(); | 102 virtual ~SkGradientShaderBase(); |
| 103 | 103 |
| 104 virtual bool setContext(const SkBitmap&, const SkPaint&, const SkMatrix&) SK
_OVERRIDE; | 104 virtual bool setContext(const SkBitmap&, const SkPaint&, const SkMatrix&) SK
_OVERRIDE; |
| 105 virtual uint32_t getFlags() SK_OVERRIDE { return fFlags; } | 105 virtual uint32_t getFlags() SK_OVERRIDE { return fFlags; } |
| 106 virtual bool isOpaque() const SK_OVERRIDE; | 106 virtual bool isOpaque() const SK_OVERRIDE; |
| 107 | 107 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 132 kTwo_GpuColorType, | 132 kTwo_GpuColorType, |
| 133 kThree_GpuColorType, // Symmetric three color | 133 kThree_GpuColorType, // Symmetric three color |
| 134 kTexture_GpuColorType | 134 kTexture_GpuColorType |
| 135 }; | 135 }; |
| 136 | 136 |
| 137 // Determines and returns the gradient is a two color gradient, symmetric th
ree color gradient | 137 // Determines and returns the gradient is a two color gradient, symmetric th
ree color gradient |
| 138 // or other (texture gradient). If it is two or symmetric three color, the c
olors array will | 138 // or other (texture gradient). If it is two or symmetric three color, the c
olors array will |
| 139 // also be filled with the gradient colors | 139 // also be filled with the gradient colors |
| 140 GpuColorType getGpuColorType(SkColor colors[3]) const; | 140 GpuColorType getGpuColorType(SkColor colors[3]) const; |
| 141 | 141 |
| 142 uint32_t getFlags() const { return fGradFlags; } | 142 uint32_t getGradFlags() const { return fGradFlags; } |
| 143 | 143 |
| 144 protected: | 144 protected: |
| 145 SkGradientShaderBase(SkReadBuffer& ); | 145 SkGradientShaderBase(SkReadBuffer& ); |
| 146 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; | 146 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; |
| 147 SK_TO_STRING_OVERRIDE() | 147 SK_TO_STRING_OVERRIDE() |
| 148 | 148 |
| 149 SkUnitMapper* fMapper; | 149 SkUnitMapper* fMapper; |
| 150 SkMatrix fPtsToUnit; // set by subclass | 150 SkMatrix fPtsToUnit; // set by subclass |
| 151 SkMatrix fDstToIndex; | 151 SkMatrix fDstToIndex; |
| 152 SkMatrix::MapXYProc fDstToIndexProc; | 152 SkMatrix::MapXYProc fDstToIndexProc; |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 GrGLUniformManager::UniformHandle fColorStartUni; | 399 GrGLUniformManager::UniformHandle fColorStartUni; |
| 400 GrGLUniformManager::UniformHandle fColorMidUni; | 400 GrGLUniformManager::UniformHandle fColorMidUni; |
| 401 GrGLUniformManager::UniformHandle fColorEndUni; | 401 GrGLUniformManager::UniformHandle fColorEndUni; |
| 402 | 402 |
| 403 typedef GrGLEffect INHERITED; | 403 typedef GrGLEffect INHERITED; |
| 404 }; | 404 }; |
| 405 | 405 |
| 406 #endif | 406 #endif |
| 407 | 407 |
| 408 #endif | 408 #endif |
| OLD | NEW |