summaryrefslogtreecommitdiffstats
path: root/libs/hwui/PatchCache.h
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2010-10-08 18:36:15 -0700
committerRomain Guy <romainguy@google.com>2010-10-08 18:36:57 -0700
commit2728f961614a385df1f056fc24803a9f65c90fab (patch)
treec09ff5c42f949f4b9e76e197108cc5a506113ca3 /libs/hwui/PatchCache.h
parent8550c4c7b5952b7a4e1e0ede95c9492d03099a13 (diff)
downloadframeworks_base-2728f961614a385df1f056fc24803a9f65c90fab.zip
frameworks_base-2728f961614a385df1f056fc24803a9f65c90fab.tar.gz
frameworks_base-2728f961614a385df1f056fc24803a9f65c90fab.tar.bz2
Don't update 9patches on every frame.
Change-Id: I7ffb2365f83e0453e7d0a0cdcb3fc9308b305238
Diffstat (limited to 'libs/hwui/PatchCache.h')
-rw-r--r--libs/hwui/PatchCache.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/libs/hwui/PatchCache.h b/libs/hwui/PatchCache.h
index b077469..08f78a3 100644
--- a/libs/hwui/PatchCache.h
+++ b/libs/hwui/PatchCache.h
@@ -17,8 +17,9 @@
#ifndef ANDROID_UI_PATCH_CACHE_H
#define ANDROID_UI_PATCH_CACHE_H
+#include <utils/KeyedVector.h>
+
#include "Patch.h"
-#include "GenerationCache.h"
namespace android {
namespace uirenderer {
@@ -41,23 +42,21 @@ namespace uirenderer {
// Cache
///////////////////////////////////////////////////////////////////////////////
-class PatchCache: public OnEntryRemoved<PatchDescription, Patch*> {
+class PatchCache {
public:
PatchCache();
PatchCache(uint32_t maxCapacity);
~PatchCache();
- /**
- * Used as a callback when an entry is removed from the cache.
- * Do not invoke directly.
- */
- void operator()(PatchDescription& description, Patch*& mesh);
-
- Patch* get(uint32_t width, uint32_t height);
+ Patch* get(const float bitmapWidth, const float bitmapHeight,
+ const float pixelWidth, const float pixelHeight,
+ const int32_t* xDivs, const int32_t* yDivs,
+ const uint32_t width, const uint32_t height);
void clear();
private:
- GenerationCache<PatchDescription, Patch*> mCache;
+ uint32_t mMaxEntries;
+ KeyedVector<PatchDescription, Patch*> mCache;
}; // class PatchCache
}; // namespace uirenderer