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

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

Issue 240303003: Fix memory leak in SkGradientShader. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: getCache -> refCache; buildBitmapShader -> refBitmapShader 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
« no previous file with comments | « src/effects/gradients/SkGradientShader.cpp ('k') | no next file » | 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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 private: 208 private:
209 enum { 209 enum {
210 kColorStorageCount = 4, // more than this many colors, and we'll use sk_ malloc for the space 210 kColorStorageCount = 4, // more than this many colors, and we'll use sk_ malloc for the space
211 211
212 kStorageSize = kColorStorageCount * (sizeof(SkColor) + sizeof(Rec)) 212 kStorageSize = kColorStorageCount * (sizeof(SkColor) + sizeof(Rec))
213 }; 213 };
214 SkColor fStorage[(kStorageSize + 3) >> 2]; 214 SkColor fStorage[(kStorageSize + 3) >> 2];
215 SkColor* fOrigColors; // original colors, before modulation by paint in c ontext. 215 SkColor* fOrigColors; // original colors, before modulation by paint in c ontext.
216 bool fColorsAreOpaque; 216 bool fColorsAreOpaque;
217 217
218 GradientShaderCache* getCache(U8CPU alpha) const; 218 GradientShaderCache* refCache(U8CPU alpha) const;
219 mutable SkMutex fCacheMutex; 219 mutable SkMutex fCacheMutex;
220 mutable SkAutoTUnref<GradientShaderCache> fCache; 220 mutable SkAutoTUnref<GradientShaderCache> fCache;
221 221
222 void initCommon(); 222 void initCommon();
223 223
224 typedef SkShader INHERITED; 224 typedef SkShader INHERITED;
225 }; 225 };
226 226
227 static inline int init_dither_toggle(int x, int y) { 227 static inline int init_dither_toggle(int x, int y) {
228 x &= 1; 228 x &= 1;
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 GrGLUniformManager::UniformHandle fColorStartUni; 423 GrGLUniformManager::UniformHandle fColorStartUni;
424 GrGLUniformManager::UniformHandle fColorMidUni; 424 GrGLUniformManager::UniformHandle fColorMidUni;
425 GrGLUniformManager::UniformHandle fColorEndUni; 425 GrGLUniformManager::UniformHandle fColorEndUni;
426 426
427 typedef GrGLEffect INHERITED; 427 typedef GrGLEffect INHERITED;
428 }; 428 };
429 429
430 #endif 430 #endif
431 431
432 #endif 432 #endif
OLDNEW
« no previous file with comments | « src/effects/gradients/SkGradientShader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698