| 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 |
| 11 #include "GrAtlas.h" | 11 #include "GrAtlas.h" |
| 12 #include "GrPictureUtils.h" | |
| 13 #include "GrRect.h" | 12 #include "GrRect.h" |
| 14 | 13 |
| 15 #include "SkChecksum.h" | 14 #include "SkChecksum.h" |
| 16 #include "SkMessageBus.h" | 15 #include "SkMessageBus.h" |
| 16 #include "SkPicture.h" |
| 17 #include "SkTDynamicHash.h" | 17 #include "SkTDynamicHash.h" |
| 18 | 18 |
| 19 class SkPicture; | |
| 20 | |
| 21 // Set to 0 to disable caching of hoisted layers | 19 // Set to 0 to disable caching of hoisted layers |
| 22 #define GR_CACHE_HOISTED_LAYERS 0 | 20 #define GR_CACHE_HOISTED_LAYERS 0 |
| 23 | 21 |
| 24 // The layer cache listens for these messages to purge picture-related resources
. | 22 // The layer cache listens for these messages to purge picture-related resources
. |
| 25 struct GrPictureDeletedMessage { | 23 struct GrPictureDeletedMessage { |
| 26 uint32_t pictureID; | 24 uint32_t pictureID; |
| 27 }; | 25 }; |
| 28 | 26 |
| 29 // GrPictureInfo stores the atlas plots used by a single picture. A single | 27 // GrPictureInfo stores the atlas plots used by a single picture. A single |
| 30 // plot may be used to store layers from multiple pictures. | 28 // plot may be used to store layers from multiple pictures. |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 SkASSERT(fPlotLocks[plotIdx] > 0); | 338 SkASSERT(fPlotLocks[plotIdx] > 0); |
| 341 --fPlotLocks[plotIdx]; | 339 --fPlotLocks[plotIdx]; |
| 342 } | 340 } |
| 343 | 341 |
| 344 // for testing | 342 // for testing |
| 345 friend class TestingAccess; | 343 friend class TestingAccess; |
| 346 int numLayers() const { return fLayerHash.count(); } | 344 int numLayers() const { return fLayerHash.count(); } |
| 347 }; | 345 }; |
| 348 | 346 |
| 349 #endif | 347 #endif |
| OLD | NEW |