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

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

Issue 1316233002: Style Change: NULL->nullptr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-27 (Thursday) 10:25:06 EDT Created 5 years, 3 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
« no previous file with comments | « src/effects/gradients/SkGradientShader.cpp ('k') | src/effects/gradients/SkLinearGradient.cpp » ('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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 ~GradientShaderCache(); 130 ~GradientShaderCache();
131 131
132 const uint16_t* getCache16(); 132 const uint16_t* getCache16();
133 const SkPMColor* getCache32(); 133 const SkPMColor* getCache32();
134 134
135 SkMallocPixelRef* getCache32PixelRef() const { return fCache32PixelRef; } 135 SkMallocPixelRef* getCache32PixelRef() const { return fCache32PixelRef; }
136 136
137 unsigned getAlpha() const { return fCacheAlpha; } 137 unsigned getAlpha() const { return fCacheAlpha; }
138 138
139 private: 139 private:
140 // Working pointers. If either is NULL, we need to recompute the corresp onding cache values. 140 // Working pointers. If either is nullptr, we need to recompute the corr esponding cache values.
141 uint16_t* fCache16; 141 uint16_t* fCache16;
142 SkPMColor* fCache32; 142 SkPMColor* fCache32;
143 143
144 uint16_t* fCache16Storage; // Storage for fCache16, allocated on demand. 144 uint16_t* fCache16Storage; // Storage for fCache16, allocated on demand.
145 SkMallocPixelRef* fCache32PixelRef; 145 SkMallocPixelRef* fCache32PixelRef;
146 const unsigned fCacheAlpha; // The alpha value we used when we computed the cache. 146 const unsigned fCacheAlpha; // The alpha value we used when we computed the cache.
147 // Larger than 8bits so we can sto re uninitialized 147 // Larger than 8bits so we can sto re uninitialized
148 // value. 148 // value.
149 149
150 const SkGradientShaderBase& fShader; 150 const SkGradientShaderBase& fShader;
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 SkASSERT((pos-1) <= fColorType); 351 SkASSERT((pos-1) <= fColorType);
352 return &fColors[pos]; 352 return &fColors[pos];
353 } 353 }
354 354
355 protected: 355 protected:
356 356
357 /** Populates a pair of arrays with colors and stop info to construct a rand om gradient. 357 /** Populates a pair of arrays with colors and stop info to construct a rand om gradient.
358 The function decides whether stop values should be used or not. The retu rn value indicates 358 The function decides whether stop values should be used or not. The retu rn value indicates
359 the number of colors, which will be capped by kMaxRandomGradientColors. colors should be 359 the number of colors, which will be capped by kMaxRandomGradientColors. colors should be
360 sized to be at least kMaxRandomGradientColors. stops is a pointer to an array of at least 360 sized to be at least kMaxRandomGradientColors. stops is a pointer to an array of at least
361 size kMaxRandomGradientColors. It may be updated to NULL, indicating tha t NULL should be 361 size kMaxRandomGradientColors. It may be updated to nullptr, indicating that nullptr should be
362 passed to the gradient factory rather than the array. 362 passed to the gradient factory rather than the array.
363 */ 363 */
364 static const int kMaxRandomGradientColors = 4; 364 static const int kMaxRandomGradientColors = 4;
365 static int RandomGradientParams(SkRandom* r, 365 static int RandomGradientParams(SkRandom* r,
366 SkColor colors[kMaxRandomGradientColors], 366 SkColor colors[kMaxRandomGradientColors],
367 SkScalar** stops, 367 SkScalar** stops,
368 SkShader::TileMode* tm); 368 SkShader::TileMode* tm);
369 369
370 bool onIsEqual(const GrFragmentProcessor&) const override; 370 bool onIsEqual(const GrFragmentProcessor&) const override;
371 371
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 GrGLProgramDataManager::UniformHandle fColorStartUni; 446 GrGLProgramDataManager::UniformHandle fColorStartUni;
447 GrGLProgramDataManager::UniformHandle fColorMidUni; 447 GrGLProgramDataManager::UniformHandle fColorMidUni;
448 GrGLProgramDataManager::UniformHandle fColorEndUni; 448 GrGLProgramDataManager::UniformHandle fColorEndUni;
449 449
450 typedef GrGLFragmentProcessor INHERITED; 450 typedef GrGLFragmentProcessor INHERITED;
451 }; 451 };
452 452
453 #endif 453 #endif
454 454
455 #endif 455 #endif
OLDNEW
« no previous file with comments | « src/effects/gradients/SkGradientShader.cpp ('k') | src/effects/gradients/SkLinearGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698