summaryrefslogtreecommitdiff
path: root/libs/hwui/TextDropShadowCache.cpp
diff options
context:
space:
mode:
author Romain Guy <romainguy@google.com> 2010-08-24 17:20:20 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2010-08-24 17:20:20 -0700
commita84e02ce3cc392ccf23bbe89cdfbef650047ffe7 (patch)
tree6ddb05a329a031522ccd45c477d11556dfdb5ee1 /libs/hwui/TextDropShadowCache.cpp
parent17b4d9ea826609f26a73077975c2399f91b5ca36 (diff)
parentfb8b763f762ae21923c58d64caa729b012f40e05 (diff)
Merge "Use only one GL context per process, share chaches."
Diffstat (limited to 'libs/hwui/TextDropShadowCache.cpp')
-rw-r--r--libs/hwui/TextDropShadowCache.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/libs/hwui/TextDropShadowCache.cpp b/libs/hwui/TextDropShadowCache.cpp
index aab5bd4d347d..f95d2be3acf9 100644
--- a/libs/hwui/TextDropShadowCache.cpp
+++ b/libs/hwui/TextDropShadowCache.cpp
@@ -25,6 +25,20 @@ namespace uirenderer {
// Constructors/destructor
///////////////////////////////////////////////////////////////////////////////
+TextDropShadowCache::TextDropShadowCache():
+ mCache(GenerationCache<ShadowText, ShadowTexture*>::kUnlimitedCapacity),
+ mSize(0), mMaxSize(MB(DEFAULT_DROP_SHADOW_CACHE_SIZE)) {
+ char property[PROPERTY_VALUE_MAX];
+ if (property_get(PROPERTY_DROP_SHADOW_CACHE_SIZE, property, NULL) > 0) {
+ LOGD(" Setting drop shadow cache size to %sMB", property);
+ setMaxSize(MB(atof(property)));
+ } else {
+ LOGD(" Using default drop shadow cache size of %.2fMB", DEFAULT_DROP_SHADOW_CACHE_SIZE);
+ }
+
+ mCache.setOnEntryRemovedListener(this);
+}
+
TextDropShadowCache::TextDropShadowCache(uint32_t maxByteSize):
mCache(GenerationCache<ShadowText, ShadowTexture*>::kUnlimitedCapacity),
mSize(0), mMaxSize(maxByteSize) {