From fb8b763f762ae21923c58d64caa729b012f40e05 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Mon, 23 Aug 2010 21:05:08 -0700 Subject: Use only one GL context per process, share chaches. Change-Id: Ieabaa25338d2f4b8d4fd90e7401ad6e7452eae11 --- libs/hwui/TextDropShadowCache.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libs/hwui/TextDropShadowCache.cpp') 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::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::kUnlimitedCapacity), mSize(0), mMaxSize(maxByteSize) { -- cgit v1.2.3-59-g8ed1b