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

Side by Side Diff: src/gpu/GrLayerCache.cpp

Issue 361663002: Fix memory leak in "Begin atlasing" (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 5 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 2014 Google Inc. 2 * Copyright 2014 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 #include "GrAtlas.h" 8 #include "GrAtlas.h"
9 #include "GrGpu.h" 9 #include "GrGpu.h"
10 #include "GrLayerCache.h" 10 #include "GrLayerCache.h"
(...skipping 29 matching lines...) Expand all
40 uint32_t fPictureID; 40 uint32_t fPictureID;
41 int fLayerID; 41 int fLayerID;
42 }; 42 };
43 43
44 GrLayerCache::GrLayerCache(GrContext* context) 44 GrLayerCache::GrLayerCache(GrContext* context)
45 : fContext(context) { 45 : fContext(context) {
46 this->initAtlas(); 46 this->initAtlas();
47 } 47 }
48 48
49 GrLayerCache::~GrLayerCache() { 49 GrLayerCache::~GrLayerCache() {
50 this->freeAll();
50 } 51 }
51 52
52 void GrLayerCache::initAtlas() { 53 void GrLayerCache::initAtlas() {
53 static const int kAtlasTextureWidth = 1024; 54 static const int kAtlasTextureWidth = 1024;
54 static const int kAtlasTextureHeight = 1024; 55 static const int kAtlasTextureHeight = 1024;
55 56
56 SkASSERT(NULL == fAtlas.get()); 57 SkASSERT(NULL == fAtlas.get());
57 58
58 // The layer cache only gets 1 plot 59 // The layer cache only gets 1 plot
59 SkISize textureSize = SkISize::Make(kAtlasTextureWidth, kAtlasTextureHeight) ; 60 SkISize textureSize = SkISize::Make(kAtlasTextureWidth, kAtlasTextureHeight) ;
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 } 164 }
164 } 165 }
165 166
166 for (int i = 0; i < toBeRemoved.count(); ++i) { 167 for (int i = 0; i < toBeRemoved.count(); ++i) {
167 this->unlock(toBeRemoved[i]); 168 this->unlock(toBeRemoved[i]);
168 169
169 PictureLayerKey key(picture->uniqueID(), toBeRemoved[i]->layerID()); 170 PictureLayerKey key(picture->uniqueID(), toBeRemoved[i]->layerID());
170 fLayerHash.remove(key, toBeRemoved[i]); 171 fLayerHash.remove(key, toBeRemoved[i]);
171 } 172 }
172 } 173 }
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