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

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

Issue 1813843002: Revert of free -> reset (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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/gpu/GrGlyph.h ('k') | src/gpu/text/GrBatchFontCache.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 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 "GrLayerAtlas.h" 8 #include "GrLayerAtlas.h"
9 #include "GrContext.h" 9 #include "GrContext.h"
10 #include "GrDrawContext.h" 10 #include "GrDrawContext.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 for (; !iter.done(); ++iter) { 91 for (; !iter.done(); ++iter) {
92 GrCachedLayer* layer = &(*iter); 92 GrCachedLayer* layer = &(*iter);
93 SkASSERT(0 == layer->uses()); 93 SkASSERT(0 == layer->uses());
94 this->unlock(layer); 94 this->unlock(layer);
95 delete layer; 95 delete layer;
96 } 96 }
97 97
98 SkASSERT(0 == fPictureHash.count()); 98 SkASSERT(0 == fPictureHash.count());
99 99
100 // The atlas only lets go of its texture when the atlas is deleted. 100 // The atlas only lets go of its texture when the atlas is deleted.
101 fAtlas.reset(); 101 fAtlas.free();
102 } 102 }
103 103
104 void GrLayerCache::initAtlas() { 104 void GrLayerCache::initAtlas() {
105 SkASSERT(nullptr == fAtlas.get()); 105 SkASSERT(nullptr == fAtlas.get());
106 GR_STATIC_ASSERT(kNumPlotsX*kNumPlotsX == GrPictureInfo::kNumPlots); 106 GR_STATIC_ASSERT(kNumPlotsX*kNumPlotsX == GrPictureInfo::kNumPlots);
107 107
108 SkISize textureSize = SkISize::Make(kAtlasTextureWidth, kAtlasTextureHeight) ; 108 SkISize textureSize = SkISize::Make(kAtlasTextureWidth, kAtlasTextureHeight) ;
109 fAtlas.reset(new GrLayerAtlas(fContext->textureProvider(), kSkia8888_GrPixel Config, 109 fAtlas.reset(new GrLayerAtlas(fContext->textureProvider(), kSkia8888_GrPixel Config,
110 kRenderTarget_GrSurfaceFlag, textureSize, 110 kRenderTarget_GrSurfaceFlag, textureSize,
111 kNumPlotsX, kNumPlotsY)); 111 kNumPlotsX, kNumPlotsY));
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 fileName.appendf("\\%d", layer->fKey.pictureID()); 548 fileName.appendf("\\%d", layer->fKey.pictureID());
549 for (int i = 0; i < layer->fKey.keySize(); ++i) { 549 for (int i = 0; i < layer->fKey.keySize(); ++i) {
550 fileName.appendf("-%d", layer->fKey.key()[i]); 550 fileName.appendf("-%d", layer->fKey.key()[i]);
551 } 551 }
552 fileName.appendf(".png"); 552 fileName.appendf(".png");
553 553
554 layer->texture()->surfacePriv().savePixels(fileName.c_str()); 554 layer->texture()->surfacePriv().savePixels(fileName.c_str());
555 } 555 }
556 } 556 }
557 #endif 557 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrGlyph.h ('k') | src/gpu/text/GrBatchFontCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698