OLD | NEW |
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 #ifndef GrLayerCache_DEFINED | 8 #ifndef GrLayerCache_DEFINED |
9 #define GrLayerCache_DEFINED | 9 #define GrLayerCache_DEFINED |
10 | 10 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 // and one GrPlot (for the entire atlas). As such, the GrLayerCache | 95 // and one GrPlot (for the entire atlas). As such, the GrLayerCache |
96 // roughly combines the functionality of the GrFontCache and GrTextStrike | 96 // roughly combines the functionality of the GrFontCache and GrTextStrike |
97 // classes. | 97 // classes. |
98 class GrLayerCache { | 98 class GrLayerCache { |
99 public: | 99 public: |
100 GrLayerCache(GrGpu*); | 100 GrLayerCache(GrGpu*); |
101 ~GrLayerCache(); | 101 ~GrLayerCache(); |
102 | 102 |
103 void freeAll(); | 103 void freeAll(); |
104 | 104 |
105 GrCachedLayer* findLayerOrCreate(SkPicture* picture, int id); | 105 GrCachedLayer* findLayerOrCreate(const SkPicture* picture, int id); |
106 | 106 |
107 private: | 107 private: |
108 SkAutoTUnref<GrGpu> fGpu; | 108 SkAutoTUnref<GrGpu> fGpu; |
109 SkAutoTDelete<GrAtlasMgr> fAtlasMgr; // TODO: could lazily allocate | 109 SkAutoTDelete<GrAtlasMgr> fAtlasMgr; // TODO: could lazily allocate |
110 | 110 |
111 class PictureLayerKey; | 111 class PictureLayerKey; |
112 GrTHashTable<GrCachedLayer, PictureLayerKey, 7> fLayerHash; | 112 GrTHashTable<GrCachedLayer, PictureLayerKey, 7> fLayerHash; |
113 GrTAllocPool<GrCachedLayer> fLayerPool; | 113 GrTAllocPool<GrCachedLayer> fLayerPool; |
114 | 114 |
115 void init(); | 115 void init(); |
116 GrCachedLayer* createLayer(SkPicture* picture, int id); | 116 GrCachedLayer* createLayer(const SkPicture* picture, int id); |
117 | 117 |
118 }; | 118 }; |
119 | 119 |
120 #endif | 120 #endif |
OLD | NEW |