diff options
author | Romain Guy <romainguy@google.com> | 2011-02-02 20:28:09 -0800 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2011-02-02 20:28:09 -0800 |
commit | 09b7c91de73b59aa3f679b3ae3ba299f82ec9f8a (patch) | |
tree | 9eb49f2fedb60e6df37b54216ed20f054a6f55fd /libs/hwui/LayerCache.h | |
parent | 62687ec12cb8e0b1d4044a235b1387b9a8c3b4b4 (diff) | |
download | frameworks_base-09b7c91de73b59aa3f679b3ae3ba299f82ec9f8a.zip frameworks_base-09b7c91de73b59aa3f679b3ae3ba299f82ec9f8a.tar.gz frameworks_base-09b7c91de73b59aa3f679b3ae3ba299f82ec9f8a.tar.bz2 |
Allocate layers from the layers pool.
Bug #3413433
This change will be beneficial to Launcher to avoid hiccups when
swiping pages of icons. When a layer is discarded, it is kept
in the layers pool instead of being destroyed right away. This
favors memory reuse over allocations.
Change-Id: Ifb6944ba83d6ceb67c331527c0827b26ce648eb1
Diffstat (limited to 'libs/hwui/LayerCache.h')
-rw-r--r-- | libs/hwui/LayerCache.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libs/hwui/LayerCache.h b/libs/hwui/LayerCache.h index 1333a73..d2d5f39 100644 --- a/libs/hwui/LayerCache.h +++ b/libs/hwui/LayerCache.h @@ -76,6 +76,17 @@ public: * Clears the cache. This causes all layers to be deleted. */ void clear(); + /** + * Resize the specified layer if needed. + * + * @param layer The layer to resize + * @param width The new width of the layer + * @param height The new height of the layer + * + * @return True if the layer was resized or nothing happened, false if + * a failure occurred during the resizing operation + */ + bool resize(Layer* layer, const uint32_t width, const uint32_t height); /** * Sets the maximum size of the cache in bytes. |