summaryrefslogtreecommitdiff
path: root/libs/hwui/PatchCache.h
diff options
context:
space:
mode:
author Romain Guy <romainguy@google.com> 2013-06-11 16:19:24 -0700
committer Romain Guy <romainguy@google.com> 2013-06-11 17:14:59 -0700
commit4c2547fa9244e78115cde0a259291053108c3dc7 (patch)
tree4337937e216918e4febe861daa7ef093b99aff03 /libs/hwui/PatchCache.h
parentfadd2081443dd2f59f8e8143256a34b7485fe72e (diff)
Avoid 9patch cache lookups when possible
This optimization saves up to 0.3ms per frame on the Play Store's front page, on a Nexus 4 device. Change-Id: Iaa4ef33c6e3b37e175efd5b9eea9ef59b43f14f3
Diffstat (limited to 'libs/hwui/PatchCache.h')
-rw-r--r--libs/hwui/PatchCache.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/libs/hwui/PatchCache.h b/libs/hwui/PatchCache.h
index 530dad05d72c..1829b89dbfc0 100644
--- a/libs/hwui/PatchCache.h
+++ b/libs/hwui/PatchCache.h
@@ -70,8 +70,13 @@ public:
return mMeshBuffer;
}
+ uint32_t getGenerationId() const {
+ return mGenerationId;
+ }
+
private:
void clearCache();
+ void createVertexBuffer();
struct PatchDescription {
PatchDescription(): mPatch(NULL), mBitmapWidth(0), mBitmapHeight(0),
@@ -122,9 +127,11 @@ private:
uint32_t mMaxSize;
uint32_t mSize;
+ LruCache<PatchDescription, Patch*> mCache;
+
GLuint mMeshBuffer;
- LruCache<PatchDescription, Patch*> mCache;
+ uint32_t mGenerationId;
}; // class PatchCache
}; // namespace uirenderer