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

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

Issue 355673002: Rename GrAtlasMgr to GrAtlas (and other cleanup) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update to ToT Created 6 years, 6 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/GrLayerCache.h ('k') | src/gpu/GrTextStrike.h » ('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 "GrAtlas.h" 8 #include "GrAtlas.h"
9 #include "GrGpu.h" 9 #include "GrGpu.h"
10 #include "GrLayerCache.h" 10 #include "GrLayerCache.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 , fLayerPool(16) { // TODO: may need to increase this later 46 , fLayerPool(16) { // TODO: may need to increase this later
47 } 47 }
48 48
49 GrLayerCache::~GrLayerCache() { 49 GrLayerCache::~GrLayerCache() {
50 } 50 }
51 51
52 void GrLayerCache::init() { 52 void GrLayerCache::init() {
53 static const int kAtlasTextureWidth = 1024; 53 static const int kAtlasTextureWidth = 1024;
54 static const int kAtlasTextureHeight = 1024; 54 static const int kAtlasTextureHeight = 1024;
55 55
56 SkASSERT(NULL == fAtlasMgr.get()); 56 SkASSERT(NULL == fAtlas.get());
57 57
58 // The layer cache only gets 1 plot 58 // The layer cache only gets 1 plot
59 SkISize textureSize = SkISize::Make(kAtlasTextureWidth, kAtlasTextureHeight) ; 59 SkISize textureSize = SkISize::Make(kAtlasTextureWidth, kAtlasTextureHeight) ;
60 fAtlasMgr.reset(SkNEW_ARGS(GrAtlasMgr, (fContext->getGpu(), kSkia8888_GrPixe lConfig, 60 fAtlas.reset(SkNEW_ARGS(GrAtlas, (fContext->getGpu(), kSkia8888_GrPixelConfi g,
61 textureSize, 1, 1, false))); 61 textureSize, 1, 1, false)));
62 } 62 }
63 63
64 void GrLayerCache::freeAll() { 64 void GrLayerCache::freeAll() {
65 fLayerHash.deleteAll(); 65 fLayerHash.deleteAll();
66 fAtlasMgr.free(); 66 fAtlas.free();
67 } 67 }
68 68
69 GrCachedLayer* GrLayerCache::createLayer(const SkPicture* picture, int layerID) { 69 GrCachedLayer* GrLayerCache::createLayer(const SkPicture* picture, int layerID) {
70 GrCachedLayer* layer = fLayerPool.alloc(); 70 GrCachedLayer* layer = fLayerPool.alloc();
71 71
72 SkASSERT(picture->uniqueID() != SK_InvalidGenID); 72 SkASSERT(picture->uniqueID() != SK_InvalidGenID);
73 layer->init(picture->uniqueID(), layerID); 73 layer->init(picture->uniqueID(), layerID);
74 fLayerHash.insert(PictureLayerKey(picture->uniqueID(), layerID), layer); 74 fLayerHash.insert(PictureLayerKey(picture->uniqueID(), layerID), layer);
75 return layer; 75 return layer;
76 } 76 }
(...skipping 23 matching lines...) Expand all
100 } 100 }
101 101
102 void GrLayerCache::unlock(GrCachedLayer* layer) { 102 void GrLayerCache::unlock(GrCachedLayer* layer) {
103 if (NULL == layer || NULL == layer->getTexture()) { 103 if (NULL == layer || NULL == layer->getTexture()) {
104 return; 104 return;
105 } 105 }
106 106
107 fContext->unlockScratchTexture(layer->getTexture()); 107 fContext->unlockScratchTexture(layer->getTexture());
108 layer->setTexture(NULL); 108 layer->setTexture(NULL);
109 } 109 }
OLDNEW
« no previous file with comments | « src/gpu/GrLayerCache.h ('k') | src/gpu/GrTextStrike.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698