summaryrefslogtreecommitdiff
path: root/libs/hwui/GradientCache.cpp
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2016-02-06 01:39:34 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2016-02-06 01:39:34 +0000
commit807842acfacbc12a6ef0234e20ef3f91e669c06f (patch)
treea7dd12556c57405bc5129c917db91ef6f82d67c9 /libs/hwui/GradientCache.cpp
parent2068bb8bb06303997697ecaaa2e7063835a972b6 (diff)
parent48a8f431fa52ae2ee25ffba9d20676f03bb710ff (diff)
Merge "Move several property queries to Properties class"
Diffstat (limited to 'libs/hwui/GradientCache.cpp')
-rw-r--r--libs/hwui/GradientCache.cpp17
1 files changed, 1 insertions, 16 deletions
diff --git a/libs/hwui/GradientCache.cpp b/libs/hwui/GradientCache.cpp
index eec9ed16939e..11293d61211b 100644
--- a/libs/hwui/GradientCache.cpp
+++ b/libs/hwui/GradientCache.cpp
@@ -65,17 +65,9 @@ int GradientCacheEntry::compare(const GradientCacheEntry& lhs, const GradientCac
GradientCache::GradientCache(Extensions& extensions)
: mCache(LruCache<GradientCacheEntry, Texture*>::kUnlimitedCapacity)
, mSize(0)
- , mMaxSize(MB(DEFAULT_GRADIENT_CACHE_SIZE))
+ , mMaxSize(Properties::gradientCacheSize)
, mUseFloatTexture(extensions.hasFloatTextures())
, mHasNpot(extensions.hasNPot()){
- char property[PROPERTY_VALUE_MAX];
- if (property_get(PROPERTY_GRADIENT_CACHE_SIZE, property, nullptr) > 0) {
- INIT_LOGD(" Setting gradient cache size to %sMB", property);
- setMaxSize(MB(atof(property)));
- } else {
- INIT_LOGD(" Using default gradient cache size of %.2fMB", DEFAULT_GRADIENT_CACHE_SIZE);
- }
-
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &mMaxTextureSize);
mCache.setOnEntryRemovedListener(this);
@@ -97,13 +89,6 @@ uint32_t GradientCache::getMaxSize() {
return mMaxSize;
}
-void GradientCache::setMaxSize(uint32_t maxSize) {
- mMaxSize = maxSize;
- while (mSize > mMaxSize) {
- mCache.removeOldest();
- }
-}
-
///////////////////////////////////////////////////////////////////////////////
// Callbacks
///////////////////////////////////////////////////////////////////////////////