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

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

Issue 313613004: Alter SkCanvas::drawPicture (devirtualize, take const SkPicture, take pointer) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add staging entry point for Chromium and Android 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
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 SkISize textureSize = SkISize::Make(kAtlasTextureWidth, kAtlasTextureHeight) ; 59 SkISize textureSize = SkISize::Make(kAtlasTextureWidth, kAtlasTextureHeight) ;
60 fAtlasMgr.reset(SkNEW_ARGS(GrAtlasMgr, (fGpu, kSkia8888_GrPixelConfig, 60 fAtlasMgr.reset(SkNEW_ARGS(GrAtlasMgr, (fGpu, kSkia8888_GrPixelConfig,
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 fAtlasMgr.free();
67 } 67 }
68 68
69 GrCachedLayer* GrLayerCache::createLayer(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 }
77 77
78 78
79 GrCachedLayer* GrLayerCache::findLayerOrCreate(SkPicture* picture, int layerID) { 79 GrCachedLayer* GrLayerCache::findLayerOrCreate(const SkPicture* picture, int lay erID) {
80 SkASSERT(picture->uniqueID() != SK_InvalidGenID); 80 SkASSERT(picture->uniqueID() != SK_InvalidGenID);
81 GrCachedLayer* layer = fLayerHash.find(PictureLayerKey(picture->uniqueID(), layerID)); 81 GrCachedLayer* layer = fLayerHash.find(PictureLayerKey(picture->uniqueID(), layerID));
82 if (NULL == layer) { 82 if (NULL == layer) {
83 layer = this->createLayer(picture, layerID); 83 layer = this->createLayer(picture, layerID);
84 } 84 }
85 return layer; 85 return layer;
86 } 86 }
OLDNEW
« include/core/SkCanvas.h ('K') | « src/gpu/GrLayerCache.h ('k') | src/gpu/GrPictureUtils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698