robertphillips@google.com | e930a07 | 2014-04-03 00:34:27 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2014 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #ifndef GrLayerCache_DEFINED |
| 9 | #define GrLayerCache_DEFINED |
| 10 | |
robertphillips | 4ec84da | 2014-06-24 13:10:43 -0700 | [diff] [blame] | 11 | #include "GrAtlas.h" |
robertphillips@google.com | e930a07 | 2014-04-03 00:34:27 +0000 | [diff] [blame] | 12 | #include "GrPictureUtils.h" |
| 13 | #include "GrRect.h" |
robertphillips | 3d533ac | 2014-07-20 09:40:00 -0700 | [diff] [blame] | 14 | #include "SkChecksum.h" |
| 15 | #include "SkTDynamicHash.h" |
robertphillips | d771f6b | 2014-07-22 10:18:06 -0700 | [diff] [blame] | 16 | #include "SkMessageBus.h" |
robertphillips@google.com | e930a07 | 2014-04-03 00:34:27 +0000 | [diff] [blame] | 17 | |
robertphillips@google.com | e930a07 | 2014-04-03 00:34:27 +0000 | [diff] [blame] | 18 | class SkPicture; |
| 19 | |
robertphillips | d771f6b | 2014-07-22 10:18:06 -0700 | [diff] [blame] | 20 | // The layer cache listens for these messages to purge picture-related resources. |
| 21 | struct GrPictureDeletedMessage { |
| 22 | uint32_t pictureID; |
| 23 | }; |
| 24 | |
robertphillips | 261b8a9 | 2014-07-17 08:26:44 -0700 | [diff] [blame] | 25 | // GrPictureInfo stores the atlas plots used by a single picture. A single |
| 26 | // plot may be used to store layers from multiple pictures. |
| 27 | struct GrPictureInfo { |
| 28 | public: |
robertphillips | 3d533ac | 2014-07-20 09:40:00 -0700 | [diff] [blame] | 29 | // for SkTDynamicHash - just use the pictureID as the hash key |
| 30 | static const uint32_t& GetKey(const GrPictureInfo& pictInfo) { return pictInfo.fPictureID; } |
| 31 | static uint32_t Hash(const uint32_t& key) { return SkChecksum::Mix(key); } |
| 32 | |
| 33 | // GrPictureInfo proper |
robertphillips | 261b8a9 | 2014-07-17 08:26:44 -0700 | [diff] [blame] | 34 | GrPictureInfo(uint32_t pictureID) : fPictureID(pictureID) { } |
| 35 | |
robertphillips | 3d533ac | 2014-07-20 09:40:00 -0700 | [diff] [blame] | 36 | const uint32_t fPictureID; |
robertphillips | 261b8a9 | 2014-07-17 08:26:44 -0700 | [diff] [blame] | 37 | |
| 38 | GrAtlas::ClientPlotUsage fPlotUsage; |
| 39 | }; |
| 40 | |
commit-bot@chromium.org | 365cd31 | 2014-04-11 15:53:47 +0000 | [diff] [blame] | 41 | // GrCachedLayer encapsulates the caching information for a single saveLayer. |
| 42 | // |
robertphillips | 21048b5 | 2014-07-15 19:46:35 -0700 | [diff] [blame] | 43 | // Atlased layers get a ref to the backing GrTexture while non-atlased layers |
| 44 | // get a ref to the GrTexture in which they reside. In both cases 'fRect' |
| 45 | // contains the layer's extent in its texture. |
robertphillips | 261b8a9 | 2014-07-17 08:26:44 -0700 | [diff] [blame] | 46 | // Atlased layers also get a pointer to the plot in which they reside. |
robertphillips | 0c42332 | 2014-07-31 11:02:38 -0700 | [diff] [blame] | 47 | // For non-atlased layers, the lock field just corresponds to locking in |
| 48 | // the resource cache. For atlased layers, it implements an additional level |
robertphillips | 320c923 | 2014-07-29 06:07:19 -0700 | [diff] [blame] | 49 | // of locking to allow atlased layers to be reused multiple times. |
commit-bot@chromium.org | 365cd31 | 2014-04-11 15:53:47 +0000 | [diff] [blame] | 50 | struct GrCachedLayer { |
robertphillips@google.com | e930a07 | 2014-04-03 00:34:27 +0000 | [diff] [blame] | 51 | public: |
robertphillips | 3d533ac | 2014-07-20 09:40:00 -0700 | [diff] [blame] | 52 | // For SkTDynamicHash |
| 53 | struct Key { |
robertphillips | 4815fe5 | 2014-09-16 10:32:43 -0700 | [diff] [blame^] | 54 | Key(uint32_t pictureID, int start, int stop, const SkIPoint& offset, const SkMatrix& ctm) |
robertphillips | 0c42332 | 2014-07-31 11:02:38 -0700 | [diff] [blame] | 55 | : fPictureID(pictureID) |
| 56 | , fStart(start) |
| 57 | , fStop(stop) |
robertphillips | 4815fe5 | 2014-09-16 10:32:43 -0700 | [diff] [blame^] | 58 | , fOffset(offset) |
robertphillips | 0c42332 | 2014-07-31 11:02:38 -0700 | [diff] [blame] | 59 | , fCTM(ctm) { |
| 60 | fCTM.getType(); // force initialization of type so hashes match |
robertphillips | 3d533ac | 2014-07-20 09:40:00 -0700 | [diff] [blame] | 61 | |
robertphillips | 0c42332 | 2014-07-31 11:02:38 -0700 | [diff] [blame] | 62 | // Key needs to be tightly packed. |
| 63 | GR_STATIC_ASSERT(sizeof(Key) == sizeof(uint32_t) + 2 * sizeof(int) + |
robertphillips | 4815fe5 | 2014-09-16 10:32:43 -0700 | [diff] [blame^] | 64 | 2 * sizeof(int32_t) + |
robertphillips | 0c42332 | 2014-07-31 11:02:38 -0700 | [diff] [blame] | 65 | 9 * sizeof(SkScalar) + sizeof(uint32_t)); |
robertphillips | 3d533ac | 2014-07-20 09:40:00 -0700 | [diff] [blame] | 66 | } |
| 67 | |
robertphillips | 0c42332 | 2014-07-31 11:02:38 -0700 | [diff] [blame] | 68 | bool operator==(const Key& other) const { |
| 69 | return fPictureID == other.fPictureID && |
| 70 | fStart == other.fStart && |
| 71 | fStop == other.fStop && |
robertphillips | 4815fe5 | 2014-09-16 10:32:43 -0700 | [diff] [blame^] | 72 | fOffset == other.fOffset && |
robertphillips | 0c42332 | 2014-07-31 11:02:38 -0700 | [diff] [blame] | 73 | fCTM.cheapEqualTo(other.fCTM); |
| 74 | } |
| 75 | |
| 76 | uint32_t pictureID() const { return fPictureID; } |
| 77 | int start() const { return fStart; } |
| 78 | int stop() const { return fStop; } |
robertphillips | 4815fe5 | 2014-09-16 10:32:43 -0700 | [diff] [blame^] | 79 | const SkIPoint& offset() const { return fOffset; } |
robertphillips | 0c42332 | 2014-07-31 11:02:38 -0700 | [diff] [blame] | 80 | const SkMatrix& ctm() const { return fCTM; } |
robertphillips | 3d533ac | 2014-07-20 09:40:00 -0700 | [diff] [blame] | 81 | |
| 82 | private: |
| 83 | // ID of the picture of which this layer is a part |
| 84 | const uint32_t fPictureID; |
robertphillips | 0c42332 | 2014-07-31 11:02:38 -0700 | [diff] [blame] | 85 | // The range of commands in the picture this layer represents |
| 86 | const int fStart; |
| 87 | const int fStop; |
robertphillips | 4815fe5 | 2014-09-16 10:32:43 -0700 | [diff] [blame^] | 88 | // The offset of the layer in device space |
| 89 | const SkIPoint fOffset; |
robertphillips | 0c42332 | 2014-07-31 11:02:38 -0700 | [diff] [blame] | 90 | // The CTM applied to this layer in the picture |
| 91 | SkMatrix fCTM; |
robertphillips | 3d533ac | 2014-07-20 09:40:00 -0700 | [diff] [blame] | 92 | }; |
| 93 | |
| 94 | static const Key& GetKey(const GrCachedLayer& layer) { return layer.fKey; } |
| 95 | static uint32_t Hash(const Key& key) { |
robertphillips | 0c42332 | 2014-07-31 11:02:38 -0700 | [diff] [blame] | 96 | return SkChecksum::Murmur3(reinterpret_cast<const uint32_t*>(&key), sizeof(Key)); |
robertphillips | 952841b | 2014-06-30 08:26:50 -0700 | [diff] [blame] | 97 | } |
| 98 | |
robertphillips | 3d533ac | 2014-07-20 09:40:00 -0700 | [diff] [blame] | 99 | // GrCachedLayer proper |
robertphillips | 4815fe5 | 2014-09-16 10:32:43 -0700 | [diff] [blame^] | 100 | GrCachedLayer(uint32_t pictureID, int start, int stop, |
| 101 | const SkIPoint& offset, const SkMatrix& ctm) |
| 102 | : fKey(pictureID, start, stop, offset, ctm) |
robertphillips | 3d533ac | 2014-07-20 09:40:00 -0700 | [diff] [blame] | 103 | , fTexture(NULL) |
| 104 | , fRect(GrIRect16::MakeEmpty()) |
robertphillips | 320c923 | 2014-07-29 06:07:19 -0700 | [diff] [blame] | 105 | , fPlot(NULL) |
| 106 | , fLocked(false) { |
robertphillips | 0c42332 | 2014-07-31 11:02:38 -0700 | [diff] [blame] | 107 | SkASSERT(SK_InvalidGenID != pictureID && start >= 0 && stop >= 0); |
robertphillips | 3d533ac | 2014-07-20 09:40:00 -0700 | [diff] [blame] | 108 | } |
| 109 | |
robertphillips | ed6f03e | 2014-07-30 07:31:35 -0700 | [diff] [blame] | 110 | ~GrCachedLayer() { |
| 111 | SkSafeUnref(fTexture); |
| 112 | } |
| 113 | |
robertphillips | 0c42332 | 2014-07-31 11:02:38 -0700 | [diff] [blame] | 114 | uint32_t pictureID() const { return fKey.pictureID(); } |
| 115 | int start() const { return fKey.start(); } |
| 116 | int stop() const { return fKey.stop(); } |
robertphillips | 4815fe5 | 2014-09-16 10:32:43 -0700 | [diff] [blame^] | 117 | const SkIPoint& offset() const { return fKey.offset(); } |
robertphillips | 0c42332 | 2014-07-31 11:02:38 -0700 | [diff] [blame] | 118 | const SkMatrix& ctm() const { return fKey.ctm(); } |
robertphillips@google.com | e930a07 | 2014-04-03 00:34:27 +0000 | [diff] [blame] | 119 | |
robertphillips | 952841b | 2014-06-30 08:26:50 -0700 | [diff] [blame] | 120 | void setTexture(GrTexture* texture, const GrIRect16& rect) { |
robertphillips | ed6f03e | 2014-07-30 07:31:35 -0700 | [diff] [blame] | 121 | SkRefCnt_SafeAssign(fTexture, texture); |
robertphillips | 952841b | 2014-06-30 08:26:50 -0700 | [diff] [blame] | 122 | fRect = rect; |
commit-bot@chromium.org | 365cd31 | 2014-04-11 15:53:47 +0000 | [diff] [blame] | 123 | } |
robertphillips | 952841b | 2014-06-30 08:26:50 -0700 | [diff] [blame] | 124 | GrTexture* texture() { return fTexture; } |
| 125 | const GrIRect16& rect() const { return fRect; } |
commit-bot@chromium.org | 365cd31 | 2014-04-11 15:53:47 +0000 | [diff] [blame] | 126 | |
robertphillips | 261b8a9 | 2014-07-17 08:26:44 -0700 | [diff] [blame] | 127 | void setPlot(GrPlot* plot) { |
robertphillips | 6f294af | 2014-08-18 08:50:03 -0700 | [diff] [blame] | 128 | SkASSERT(NULL == plot || NULL == fPlot); |
robertphillips | 261b8a9 | 2014-07-17 08:26:44 -0700 | [diff] [blame] | 129 | fPlot = plot; |
| 130 | } |
| 131 | GrPlot* plot() { return fPlot; } |
robertphillips | 21048b5 | 2014-07-15 19:46:35 -0700 | [diff] [blame] | 132 | |
bsalomon | 49f085d | 2014-09-05 13:34:00 -0700 | [diff] [blame] | 133 | bool isAtlased() const { return SkToBool(fPlot); } |
robertphillips | 261b8a9 | 2014-07-17 08:26:44 -0700 | [diff] [blame] | 134 | |
robertphillips | 320c923 | 2014-07-29 06:07:19 -0700 | [diff] [blame] | 135 | void setLocked(bool locked) { fLocked = locked; } |
| 136 | bool locked() const { return fLocked; } |
| 137 | |
| 138 | SkDEBUGCODE(const GrPlot* plot() const { return fPlot; }) |
robertphillips | 261b8a9 | 2014-07-17 08:26:44 -0700 | [diff] [blame] | 139 | SkDEBUGCODE(void validate(const GrTexture* backingTexture) const;) |
robertphillips | 21048b5 | 2014-07-15 19:46:35 -0700 | [diff] [blame] | 140 | |
robertphillips@google.com | e930a07 | 2014-04-03 00:34:27 +0000 | [diff] [blame] | 141 | private: |
robertphillips | 3d533ac | 2014-07-20 09:40:00 -0700 | [diff] [blame] | 142 | const Key fKey; |
commit-bot@chromium.org | 365cd31 | 2014-04-11 15:53:47 +0000 | [diff] [blame] | 143 | |
skia.committer@gmail.com | d942731 | 2014-04-12 03:05:59 +0000 | [diff] [blame] | 144 | // fTexture is a ref on the atlasing texture for atlased layers and a |
robertphillips | 320c923 | 2014-07-29 06:07:19 -0700 | [diff] [blame] | 145 | // ref on a GrTexture for non-atlased textures. |
commit-bot@chromium.org | 365cd31 | 2014-04-11 15:53:47 +0000 | [diff] [blame] | 146 | GrTexture* fTexture; |
| 147 | |
robertphillips | 21048b5 | 2014-07-15 19:46:35 -0700 | [diff] [blame] | 148 | // For both atlased and non-atlased layers 'fRect' contains the bound of |
| 149 | // the layer in whichever texture it resides. It is empty when 'fTexture' |
| 150 | // is NULL. |
robertphillips | 952841b | 2014-06-30 08:26:50 -0700 | [diff] [blame] | 151 | GrIRect16 fRect; |
robertphillips | 261b8a9 | 2014-07-17 08:26:44 -0700 | [diff] [blame] | 152 | |
| 153 | // For atlased layers, fPlot stores the atlas plot in which the layer rests. |
| 154 | // It is always NULL for non-atlased layers. |
| 155 | GrPlot* fPlot; |
robertphillips | 320c923 | 2014-07-29 06:07:19 -0700 | [diff] [blame] | 156 | |
bsalomon | 49f085d | 2014-09-05 13:34:00 -0700 | [diff] [blame] | 157 | // For non-atlased layers 'fLocked' should always match "fTexture". |
robertphillips | 320c923 | 2014-07-29 06:07:19 -0700 | [diff] [blame] | 158 | // (i.e., if there is a texture it is locked). |
| 159 | // For atlased layers, 'fLocked' is true if the layer is in a plot and |
| 160 | // actively required for rendering. If the layer is in a plot but not |
| 161 | // actively required for rendering, then 'fLocked' is false. If the |
| 162 | // layer isn't in a plot then is can never be locked. |
| 163 | bool fLocked; |
robertphillips@google.com | e930a07 | 2014-04-03 00:34:27 +0000 | [diff] [blame] | 164 | }; |
| 165 | |
| 166 | // The GrLayerCache caches pre-computed saveLayers for later rendering. |
commit-bot@chromium.org | 365cd31 | 2014-04-11 15:53:47 +0000 | [diff] [blame] | 167 | // Non-atlased layers are stored in their own GrTexture while the atlased |
| 168 | // layers share a single GrTexture. |
robertphillips | 1d86ee8 | 2014-06-24 15:08:49 -0700 | [diff] [blame] | 169 | // Unlike the GrFontCache, the GrTexture atlas only has one GrAtlas (for 8888) |
robertphillips@google.com | e930a07 | 2014-04-03 00:34:27 +0000 | [diff] [blame] | 170 | // and one GrPlot (for the entire atlas). As such, the GrLayerCache |
| 171 | // roughly combines the functionality of the GrFontCache and GrTextStrike |
| 172 | // classes. |
| 173 | class GrLayerCache { |
| 174 | public: |
robertphillips | 4ec84da | 2014-06-24 13:10:43 -0700 | [diff] [blame] | 175 | GrLayerCache(GrContext*); |
robertphillips@google.com | e930a07 | 2014-04-03 00:34:27 +0000 | [diff] [blame] | 176 | ~GrLayerCache(); |
| 177 | |
robertphillips | 4ec84da | 2014-06-24 13:10:43 -0700 | [diff] [blame] | 178 | // As a cache, the GrLayerCache can be ordered to free up all its cached |
| 179 | // elements by the GrContext |
robertphillips@google.com | e930a07 | 2014-04-03 00:34:27 +0000 | [diff] [blame] | 180 | void freeAll(); |
| 181 | |
robertphillips | 4815fe5 | 2014-09-16 10:32:43 -0700 | [diff] [blame^] | 182 | GrCachedLayer* findLayer(uint32_t pictureID, int start, int stop, |
| 183 | const SkIPoint& offset, const SkMatrix& ctm); |
robertphillips | 6f294af | 2014-08-18 08:50:03 -0700 | [diff] [blame] | 184 | GrCachedLayer* findLayerOrCreate(uint32_t pictureID, |
robertphillips | 0c42332 | 2014-07-31 11:02:38 -0700 | [diff] [blame] | 185 | int start, int stop, |
robertphillips | 4815fe5 | 2014-09-16 10:32:43 -0700 | [diff] [blame^] | 186 | const SkIPoint& offset, |
robertphillips | 0c42332 | 2014-07-31 11:02:38 -0700 | [diff] [blame] | 187 | const SkMatrix& ctm); |
robertphillips | 6f294af | 2014-08-18 08:50:03 -0700 | [diff] [blame] | 188 | |
| 189 | // Inform the cache that layer's cached image is now required. |
| 190 | // Return true if the layer must be re-rendered. Return false if the |
| 191 | // layer was found in the cache and can be reused. |
| 192 | bool lock(GrCachedLayer* layer, const GrTextureDesc& desc, bool dontAtlas); |
robertphillips | 4ec84da | 2014-06-24 13:10:43 -0700 | [diff] [blame] | 193 | |
| 194 | // Inform the cache that layer's cached image is not currently required |
| 195 | void unlock(GrCachedLayer* layer); |
robertphillips@google.com | e930a07 | 2014-04-03 00:34:27 +0000 | [diff] [blame] | 196 | |
robertphillips | d771f6b | 2014-07-22 10:18:06 -0700 | [diff] [blame] | 197 | // Setup to be notified when 'picture' is deleted |
| 198 | void trackPicture(const SkPicture* picture); |
| 199 | |
| 200 | // Cleanup after any SkPicture deletions |
| 201 | void processDeletedPictures(); |
robertphillips | 952841b | 2014-06-30 08:26:50 -0700 | [diff] [blame] | 202 | |
robertphillips | 21048b5 | 2014-07-15 19:46:35 -0700 | [diff] [blame] | 203 | SkDEBUGCODE(void validate() const;) |
| 204 | |
robertphillips@google.com | e930a07 | 2014-04-03 00:34:27 +0000 | [diff] [blame] | 205 | private: |
robertphillips | 320c923 | 2014-07-29 06:07:19 -0700 | [diff] [blame] | 206 | static const int kAtlasTextureWidth = 1024; |
| 207 | static const int kAtlasTextureHeight = 1024; |
| 208 | |
robertphillips | 261b8a9 | 2014-07-17 08:26:44 -0700 | [diff] [blame] | 209 | static const int kNumPlotsX = 2; |
| 210 | static const int kNumPlotsY = 2; |
| 211 | |
robertphillips | 320c923 | 2014-07-29 06:07:19 -0700 | [diff] [blame] | 212 | static const int kPlotWidth = kAtlasTextureWidth / kNumPlotsX; |
| 213 | static const int kPlotHeight = kAtlasTextureHeight / kNumPlotsY; |
| 214 | |
robertphillips | 4ec84da | 2014-06-24 13:10:43 -0700 | [diff] [blame] | 215 | GrContext* fContext; // pointer back to owning context |
robertphillips | 1d86ee8 | 2014-06-24 15:08:49 -0700 | [diff] [blame] | 216 | SkAutoTDelete<GrAtlas> fAtlas; // TODO: could lazily allocate |
robertphillips | 261b8a9 | 2014-07-17 08:26:44 -0700 | [diff] [blame] | 217 | |
| 218 | // We cache this information here (rather then, say, on the owning picture) |
| 219 | // because we want to be able to clean it up as needed (e.g., if a picture |
| 220 | // is leaked and never cleans itself up we still want to be able to |
| 221 | // remove the GrPictureInfo once its layers are purged from all the atlas |
| 222 | // plots). |
robertphillips | 3d533ac | 2014-07-20 09:40:00 -0700 | [diff] [blame] | 223 | SkTDynamicHash<GrPictureInfo, uint32_t> fPictureHash; |
robertphillips@google.com | e930a07 | 2014-04-03 00:34:27 +0000 | [diff] [blame] | 224 | |
robertphillips | 3d533ac | 2014-07-20 09:40:00 -0700 | [diff] [blame] | 225 | SkTDynamicHash<GrCachedLayer, GrCachedLayer::Key> fLayerHash; |
robertphillips@google.com | e930a07 | 2014-04-03 00:34:27 +0000 | [diff] [blame] | 226 | |
robertphillips | d771f6b | 2014-07-22 10:18:06 -0700 | [diff] [blame] | 227 | SkMessageBus<GrPictureDeletedMessage>::Inbox fPictDeletionInbox; |
| 228 | |
| 229 | SkAutoTUnref<SkPicture::DeletionListener> fDeletionListener; |
| 230 | |
robertphillips | 320c923 | 2014-07-29 06:07:19 -0700 | [diff] [blame] | 231 | // This implements a plot-centric locking mechanism (since the atlas |
| 232 | // backing texture is always locked). Each layer that is locked (i.e., |
| 233 | // needed for the current rendering) in a plot increments the plot lock |
| 234 | // count for that plot. Similarly, once a rendering is complete all the |
| 235 | // layers used in it decrement the lock count for the used plots. |
| 236 | // Plots with a 0 lock count are open for recycling/purging. |
| 237 | int fPlotLocks[kNumPlotsX * kNumPlotsY]; |
| 238 | |
robertphillips | 952841b | 2014-06-30 08:26:50 -0700 | [diff] [blame] | 239 | void initAtlas(); |
robertphillips | 4815fe5 | 2014-09-16 10:32:43 -0700 | [diff] [blame^] | 240 | GrCachedLayer* createLayer(uint32_t pictureID, int start, int stop, |
| 241 | const SkIPoint& offset, const SkMatrix& ctm); |
robertphillips | 6f294af | 2014-08-18 08:50:03 -0700 | [diff] [blame] | 242 | |
robertphillips | 6f294af | 2014-08-18 08:50:03 -0700 | [diff] [blame] | 243 | void purgeAll(); |
robertphillips | 952841b | 2014-06-30 08:26:50 -0700 | [diff] [blame] | 244 | |
robertphillips | d771f6b | 2014-07-22 10:18:06 -0700 | [diff] [blame] | 245 | // Remove all the layers (and unlock any resources) associated with 'pictureID' |
| 246 | void purge(uint32_t pictureID); |
| 247 | |
robertphillips | 320c923 | 2014-07-29 06:07:19 -0700 | [diff] [blame] | 248 | static bool PlausiblyAtlasable(int width, int height) { |
| 249 | return width <= kPlotWidth && height <= kPlotHeight; |
| 250 | } |
| 251 | |
robertphillips | 6f294af | 2014-08-18 08:50:03 -0700 | [diff] [blame] | 252 | void purgePlot(GrPlot* plot); |
| 253 | |
robertphillips | 320c923 | 2014-07-29 06:07:19 -0700 | [diff] [blame] | 254 | // Try to find a purgeable plot and clear it out. Return true if a plot |
| 255 | // was purged; false otherwise. |
| 256 | bool purgePlot(); |
| 257 | |
robertphillips | 952841b | 2014-06-30 08:26:50 -0700 | [diff] [blame] | 258 | // for testing |
robertphillips | d771f6b | 2014-07-22 10:18:06 -0700 | [diff] [blame] | 259 | friend class TestingAccess; |
robertphillips | 952841b | 2014-06-30 08:26:50 -0700 | [diff] [blame] | 260 | int numLayers() const { return fLayerHash.count(); } |
robertphillips@google.com | e930a07 | 2014-04-03 00:34:27 +0000 | [diff] [blame] | 261 | }; |
| 262 | |
| 263 | #endif |