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

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

Issue 1436663003: Implement multi-color-stops in linear gradients using Sk4f (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix win warnings Created 5 years, 1 month 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
« no previous file with comments | « no previous file | src/effects/gradients/SkLinearGradient.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 SkColor* colorSrc, Rec* recSrc, 252 SkColor* colorSrc, Rec* recSrc,
253 int count); 253 int count);
254 254
255 private: 255 private:
256 enum { 256 enum {
257 kColorStorageCount = 4, // more than this many colors, and we'll use sk_ malloc for the space 257 kColorStorageCount = 4, // more than this many colors, and we'll use sk_ malloc for the space
258 258
259 kStorageSize = kColorStorageCount * (sizeof(SkColor) + sizeof(SkScalar) + sizeof(Rec)) 259 kStorageSize = kColorStorageCount * (sizeof(SkColor) + sizeof(SkScalar) + sizeof(Rec))
260 }; 260 };
261 SkColor fStorage[(kStorageSize + 3) >> 2]; 261 SkColor fStorage[(kStorageSize + 3) >> 2];
262 public:
262 SkColor* fOrigColors; // original colors, before modulation by paint in c ontext. 263 SkColor* fOrigColors; // original colors, before modulation by paint in c ontext.
263 SkScalar* fOrigPos; // original positions 264 SkScalar* fOrigPos; // original positions
265
266 bool colorsAreOpaque() const { return fColorsAreOpaque; }
267
268 private:
264 bool fColorsAreOpaque; 269 bool fColorsAreOpaque;
265 270
266 GradientShaderCache* refCache(U8CPU alpha, bool dither) const; 271 GradientShaderCache* refCache(U8CPU alpha, bool dither) const;
267 mutable SkMutex fCacheMutex; 272 mutable SkMutex fCacheMutex;
268 mutable SkAutoTUnref<GradientShaderCache> fCache; 273 mutable SkAutoTUnref<GradientShaderCache> fCache;
269 274
270 void initCommon(); 275 void initCommon();
271 276
272 typedef SkShader INHERITED; 277 typedef SkShader INHERITED;
273 }; 278 };
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 GrGLSLProgramDataManager::UniformHandle fColorStartUni; 454 GrGLSLProgramDataManager::UniformHandle fColorStartUni;
450 GrGLSLProgramDataManager::UniformHandle fColorMidUni; 455 GrGLSLProgramDataManager::UniformHandle fColorMidUni;
451 GrGLSLProgramDataManager::UniformHandle fColorEndUni; 456 GrGLSLProgramDataManager::UniformHandle fColorEndUni;
452 457
453 typedef GrGLSLFragmentProcessor INHERITED; 458 typedef GrGLSLFragmentProcessor INHERITED;
454 }; 459 };
455 460
456 #endif 461 #endif
457 462
458 #endif 463 #endif
OLDNEW
« no previous file with comments | « no previous file | src/effects/gradients/SkLinearGradient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698