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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
159 | 159 |
160 struct Rec { | 160 struct Rec { |
161 SkFixed fPos; // 0...1 | 161 SkFixed fPos; // 0...1 |
162 uint32_t fScale; // (1 << 24) / range | 162 uint32_t fScale; // (1 << 24) / range |
163 }; | 163 }; |
164 Rec* fRecs; | 164 Rec* fRecs; |
165 | 165 |
166 const uint16_t* getCache16() const; | 166 const uint16_t* getCache16() const; |
167 const SkPMColor* getCache32() const; | 167 const SkPMColor* getCache32() const; |
168 | 168 |
169 void commonAsAGradient(GradientInfo*) const; | 169 void commonAsAGradient(GradientInfo*, bool flipGrad = false) const; |
170 | |
171 // Flip the Takes in Color info for src which contains count colors at the s tart | |
bsalomon
2014/04/18 14:31:45
Flip the Takes?
| |
172 // followed by count Recs (Recs only included if count > 2). It will then fl ip all the | |
173 // color information and return in dst. | |
174 // Assumes space has been already correctly allocated for the dst | |
175 static void FlipGradientColors(SkColor* colorDst, Rec* recDst, | |
176 SkColor* colorSrc, Rec* recSrc, | |
177 int count); | |
170 | 178 |
171 // V23_COMPATIBILITY_CODE | 179 // V23_COMPATIBILITY_CODE |
172 // Used for 2-pt conical gradients since we sort start/end cirlces by radius | 180 // Used for 2-pt conical gradients since we sort start/end cirlces by radius |
173 // Assumes space has already been allocated for fOrigColors | 181 // Assumes space has already been allocated for fOrigColors |
174 void flipGradientColors(); | 182 void flipGradientColors(); |
175 | 183 |
176 private: | 184 private: |
177 enum { | 185 enum { |
178 kColorStorageCount = 4, // more than this many colors, and we'll use sk_ malloc for the space | 186 kColorStorageCount = 4, // more than this many colors, and we'll use sk_ malloc for the space |
179 | 187 |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
388 GrGLUniformManager::UniformHandle fColorStartUni; | 396 GrGLUniformManager::UniformHandle fColorStartUni; |
389 GrGLUniformManager::UniformHandle fColorMidUni; | 397 GrGLUniformManager::UniformHandle fColorMidUni; |
390 GrGLUniformManager::UniformHandle fColorEndUni; | 398 GrGLUniformManager::UniformHandle fColorEndUni; |
391 | 399 |
392 typedef GrGLEffect INHERITED; | 400 typedef GrGLEffect INHERITED; |
393 }; | 401 }; |
394 | 402 |
395 #endif | 403 #endif |
396 | 404 |
397 #endif | 405 #endif |
OLD | NEW |