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

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: Pdf 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « src/effects/gradients/SkGradientShader.cpp ('k') | src/effects/gradients/SkTwoPointConicalGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698