| 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 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 private: | 41 private: |
| 42 GrPlot* fPlot; | 42 GrPlot* fPlot; |
| 43 GrIRect16 fBounds; // only valid is fPlot != NULL | 43 GrIRect16 fBounds; // only valid is fPlot != NULL |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 // A GrAtlasedLayer encapsulates the atlasing information for a single saveLayer
. | 46 // A GrAtlasedLayer encapsulates the atlasing information for a single saveLayer
. |
| 47 // It is roughly equivalent to a GrGlyph in the font caching system | 47 // It is roughly equivalent to a GrGlyph in the font caching system |
| 48 class GrAtlasedLayer { | 48 class GrAtlasedLayer { |
| 49 public: | 49 public: |
| 50 GrAtlasedLayer() : fPictureID(SkPicture::kInvalidGenID) { } | 50 GrAtlasedLayer() : fPictureID(SK_InvalidGenID) { } |
| 51 | 51 |
| 52 uint32_t pictureID() const { return fPictureID; } | 52 uint32_t pictureID() const { return fPictureID; } |
| 53 int layerID() const { return fLayerID; } | 53 int layerID() const { return fLayerID; } |
| 54 | 54 |
| 55 void init(uint32_t pictureID, int layerID) { | 55 void init(uint32_t pictureID, int layerID) { |
| 56 fPictureID = pictureID; | 56 fPictureID = pictureID; |
| 57 fLayerID = layerID; | 57 fLayerID = layerID; |
| 58 } | 58 } |
| 59 | 59 |
| 60 private: | 60 private: |
| (...skipping 23 matching lines...) Expand all Loading... |
| 84 class PictureLayerKey; | 84 class PictureLayerKey; |
| 85 GrTHashTable<GrAtlasedLayer, PictureLayerKey, 7> fLayerHash; | 85 GrTHashTable<GrAtlasedLayer, PictureLayerKey, 7> fLayerHash; |
| 86 GrTAllocPool<GrAtlasedLayer> fLayerPool; | 86 GrTAllocPool<GrAtlasedLayer> fLayerPool; |
| 87 | 87 |
| 88 void init(); | 88 void init(); |
| 89 GrAtlasedLayer* createLayer(SkPicture* picture, int id); | 89 GrAtlasedLayer* createLayer(SkPicture* picture, int id); |
| 90 | 90 |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 #endif | 93 #endif |
| OLD | NEW |