Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(550)

Side by Side Diff: src/effects/gradients/SkGradientShaderPriv.h

Issue 227623004: Add flipped gradient branch to two point conical gradient (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Cpu flip fix Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 uint8_t fGradFlags; 198 uint8_t fGradFlags;
199 199
200 struct Rec { 200 struct Rec {
201 SkFixed fPos; // 0...1 201 SkFixed fPos; // 0...1
202 uint32_t fScale; // (1 << 24) / range 202 uint32_t fScale; // (1 << 24) / range
203 }; 203 };
204 Rec* fRecs; 204 Rec* fRecs;
205 205
206 void commonAsAGradient(GradientInfo*) const; 206 void commonAsAGradient(GradientInfo*) const;
207 207
208 // V23_COMPATIBILITY_CODE
209 // Used for 2-pt conical gradients since we sort start/end cirlces by radius
210 // Assumes space has already been allocated for fOrigColors
211 void flipGradientColors();
212
208 private: 213 private:
209 enum { 214 enum {
210 kColorStorageCount = 4, // more than this many colors, and we'll use sk_ malloc for the space 215 kColorStorageCount = 4, // more than this many colors, and we'll use sk_ malloc for the space
211 216
212 kStorageSize = kColorStorageCount * (sizeof(SkColor) + sizeof(Rec)) 217 kStorageSize = kColorStorageCount * (sizeof(SkColor) + sizeof(Rec))
213 }; 218 };
214 SkColor fStorage[(kStorageSize + 3) >> 2]; 219 SkColor fStorage[(kStorageSize + 3) >> 2];
215 SkColor* fOrigColors; // original colors, before modulation by paint in c ontext. 220 SkColor* fOrigColors; // original colors, before modulation by paint in c ontext.
216 bool fColorsAreOpaque; 221 bool fColorsAreOpaque;
217 222
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 GrGLUniformManager::UniformHandle fColorStartUni; 428 GrGLUniformManager::UniformHandle fColorStartUni;
424 GrGLUniformManager::UniformHandle fColorMidUni; 429 GrGLUniformManager::UniformHandle fColorMidUni;
425 GrGLUniformManager::UniformHandle fColorEndUni; 430 GrGLUniformManager::UniformHandle fColorEndUni;
426 431
427 typedef GrGLEffect INHERITED; 432 typedef GrGLEffect INHERITED;
428 }; 433 };
429 434
430 #endif 435 #endif
431 436
432 #endif 437 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698