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

Side by Side Diff: src/gpu/GrAtlasTextContext.h

Issue 1072193009: Fix for GrAtlasTextContext memory leak (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweak Created 5 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 | « no previous file | 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 2015 Google Inc. 2 * Copyright 2015 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 GrAtlasTextContext_DEFINED 8 #ifndef GrAtlasTextContext_DEFINED
9 #define GrAtlasTextContext_DEFINED 9 #define GrAtlasTextContext_DEFINED
10 10
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 SkScalar fMaxMinScale; 245 SkScalar fMaxMinScale;
246 SkScalar fMinMaxScale; 246 SkScalar fMinMaxScale;
247 int fRunCount; 247 int fRunCount;
248 uint8_t fTextType; 248 uint8_t fTextType;
249 249
250 BitmapTextBlob() 250 BitmapTextBlob()
251 : fMaxMinScale(-SK_ScalarMax) 251 : fMaxMinScale(-SK_ScalarMax)
252 , fMinMaxScale(SK_ScalarMax) 252 , fMinMaxScale(SK_ScalarMax)
253 , fTextType(0) {} 253 , fTextType(0) {}
254 254
255 ~BitmapTextBlob() override {
256 for (int i = 0; i < fRunCount; i++) {
257 fRuns[i].~Run();
258 }
259 }
260
255 static const Key& GetKey(const BitmapTextBlob& blob) { 261 static const Key& GetKey(const BitmapTextBlob& blob) {
256 return blob.fKey; 262 return blob.fKey;
257 } 263 }
258 264
259 static uint32_t Hash(const Key& key) { 265 static uint32_t Hash(const Key& key) {
260 return SkChecksum::Murmur3(&key, sizeof(Key)); 266 return SkChecksum::Murmur3(&key, sizeof(Key));
261 } 267 }
262 268
263 void operator delete(void* p) { 269 void operator delete(void* p) {
264 BitmapTextBlob* blob = reinterpret_cast<BitmapTextBlob*>(p); 270 BitmapTextBlob* blob = reinterpret_cast<BitmapTextBlob*>(p);
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 bool fEnableDFRendering; 400 bool fEnableDFRendering;
395 SkAutoTUnref<DistanceAdjustTable> fDistanceAdjustTable; 401 SkAutoTUnref<DistanceAdjustTable> fDistanceAdjustTable;
396 402
397 friend class GrTextBlobCache; 403 friend class GrTextBlobCache;
398 friend class BitmapTextBatch; 404 friend class BitmapTextBatch;
399 405
400 typedef GrTextContext INHERITED; 406 typedef GrTextContext INHERITED;
401 }; 407 };
402 408
403 #endif 409 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698