summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Chris Craik <ccraik@google.com> 2016-02-05 15:59:29 -0800
committer Chris Craik <ccraik@google.com> 2016-02-05 17:38:22 -0800
commit48a8f431fa52ae2ee25ffba9d20676f03bb710ff (patch)
tree2c8e1e8684320f2cd85d058aaa0f6789a4016105
parent37fd29f2842c4b92ba3ddbba2f9a5024ce103783 (diff)
Move several property queries to Properties class
bug:17478770 This removes a lot of redundant property query code, and puts the queries all in one place, so defining them automatically will be simpler in the future. Change-Id: I0428550e6081f07bc6554ffdf73b22284325abb8
-rw-r--r--libs/hwui/FboCache.cpp11
-rw-r--r--libs/hwui/GradientCache.cpp17
-rw-r--r--libs/hwui/GradientCache.h6
-rw-r--r--libs/hwui/PatchCache.cpp12
-rw-r--r--libs/hwui/PatchCache.h2
-rw-r--r--libs/hwui/PathCache.cpp15
-rw-r--r--libs/hwui/PathCache.h2
-rw-r--r--libs/hwui/Properties.cpp25
-rw-r--r--libs/hwui/Properties.h9
-rw-r--r--libs/hwui/RenderBufferCache.cpp18
-rw-r--r--libs/hwui/RenderBufferCache.h4
-rw-r--r--libs/hwui/TessellationCache.cpp18
-rw-r--r--libs/hwui/TessellationCache.h8
-rw-r--r--libs/hwui/TextDropShadowCache.cpp38
-rw-r--r--libs/hwui/TextDropShadowCache.h10
-rw-r--r--libs/hwui/TextureCache.cpp32
-rw-r--r--libs/hwui/TextureCache.h13
17 files changed, 63 insertions, 177 deletions
diff --git a/libs/hwui/FboCache.cpp b/libs/hwui/FboCache.cpp
index cca3cb7a98f1..b2181b60054f 100644
--- a/libs/hwui/FboCache.cpp
+++ b/libs/hwui/FboCache.cpp
@@ -27,15 +27,8 @@ namespace uirenderer {
// Constructors/destructor
///////////////////////////////////////////////////////////////////////////////
-FboCache::FboCache(): mMaxSize(DEFAULT_FBO_CACHE_SIZE) {
- char property[PROPERTY_VALUE_MAX];
- if (property_get(PROPERTY_FBO_CACHE_SIZE, property, nullptr) > 0) {
- INIT_LOGD(" Setting fbo cache size to %s", property);
- mMaxSize = atoi(property);
- } else {
- INIT_LOGD(" Using default fbo cache size of %d", DEFAULT_FBO_CACHE_SIZE);
- }
-}
+FboCache::FboCache()
+ : mMaxSize(Properties::fboCacheSize) {}
FboCache::~FboCache() {
clear();
diff --git a/libs/hwui/GradientCache.cpp b/libs/hwui/GradientCache.cpp
index e899ac71ff36..044c7cb65718 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
///////////////////////////////////////////////////////////////////////////////
diff --git a/libs/hwui/GradientCache.h b/libs/hwui/GradientCache.h
index b762ca7d5e5c..dccd45072522 100644
--- a/libs/hwui/GradientCache.h
+++ b/libs/hwui/GradientCache.h
@@ -123,10 +123,6 @@ public:
void clear();
/**
- * Sets the maximum size of the cache in bytes.
- */
- void setMaxSize(uint32_t maxSize);
- /**
* Returns the maximum size of the cache in bytes.
*/
uint32_t getMaxSize();
@@ -177,7 +173,7 @@ private:
LruCache<GradientCacheEntry, Texture*> mCache;
uint32_t mSize;
- uint32_t mMaxSize;
+ const uint32_t mMaxSize;
GLint mMaxTextureSize;
bool mUseFloatTexture;
diff --git a/libs/hwui/PatchCache.cpp b/libs/hwui/PatchCache.cpp
index 98812805259e..bd6feb9fc762 100644
--- a/libs/hwui/PatchCache.cpp
+++ b/libs/hwui/PatchCache.cpp
@@ -32,20 +32,12 @@ namespace uirenderer {
PatchCache::PatchCache(RenderState& renderState)
: mRenderState(renderState)
+ , mMaxSize(Properties::patchCacheSize)
, mSize(0)
, mCache(LruCache<PatchDescription, Patch*>::kUnlimitedCapacity)
, mMeshBuffer(0)
, mFreeBlocks(nullptr)
- , mGenerationId(0) {
- char property[PROPERTY_VALUE_MAX];
- if (property_get(PROPERTY_PATCH_CACHE_SIZE, property, nullptr) > 0) {
- INIT_LOGD(" Setting patch cache size to %skB", property);
- mMaxSize = KB(atoi(property));
- } else {
- INIT_LOGD(" Using default patch cache size of %.2fkB", DEFAULT_PATCH_CACHE_SIZE);
- mMaxSize = KB(DEFAULT_PATCH_CACHE_SIZE);
- }
-}
+ , mGenerationId(0) {}
PatchCache::~PatchCache() {
clear();
diff --git a/libs/hwui/PatchCache.h b/libs/hwui/PatchCache.h
index 387f79acf0ec..66ef6a0279ba 100644
--- a/libs/hwui/PatchCache.h
+++ b/libs/hwui/PatchCache.h
@@ -169,7 +169,7 @@ private:
#endif
RenderState& mRenderState;
- uint32_t mMaxSize;
+ const uint32_t mMaxSize;
uint32_t mSize;
LruCache<PatchDescription, Patch*> mCache;
diff --git a/libs/hwui/PathCache.cpp b/libs/hwui/PathCache.cpp
index bfabc1d4d94c..8f914acc5c76 100644
--- a/libs/hwui/PathCache.cpp
+++ b/libs/hwui/PathCache.cpp
@@ -135,17 +135,10 @@ static void drawPath(const SkPath *path, const SkPaint* paint, SkBitmap& bitmap,
// Cache constructor/destructor
///////////////////////////////////////////////////////////////////////////////
-PathCache::PathCache():
- mCache(LruCache<PathDescription, PathTexture*>::kUnlimitedCapacity),
- mSize(0), mMaxSize(MB(DEFAULT_PATH_CACHE_SIZE)) {
- char property[PROPERTY_VALUE_MAX];
- if (property_get(PROPERTY_PATH_CACHE_SIZE, property, nullptr) > 0) {
- INIT_LOGD(" Setting path cache size to %sMB", property);
- mMaxSize = MB(atof(property));
- } else {
- INIT_LOGD(" Using default path cache size of %.2fMB", DEFAULT_PATH_CACHE_SIZE);
- }
-
+PathCache::PathCache()
+ : mCache(LruCache<PathDescription, PathTexture*>::kUnlimitedCapacity)
+ , mSize(0)
+ , mMaxSize(Properties::pathCacheSize) {
mCache.setOnEntryRemovedListener(this);
GLint maxTextureSize;
diff --git a/libs/hwui/PathCache.h b/libs/hwui/PathCache.h
index 18f380fe3f7a..d2633aa427c5 100644
--- a/libs/hwui/PathCache.h
+++ b/libs/hwui/PathCache.h
@@ -300,7 +300,7 @@ private:
LruCache<PathDescription, PathTexture*> mCache;
uint32_t mSize;
- uint32_t mMaxSize;
+ const uint32_t mMaxSize;
GLuint mMaxTextureSize;
bool mDebugEnabled;
diff --git a/libs/hwui/Properties.cpp b/libs/hwui/Properties.cpp
index 083aeb7ed585..bbd8c7226ab2 100644
--- a/libs/hwui/Properties.cpp
+++ b/libs/hwui/Properties.cpp
@@ -37,7 +37,18 @@ bool Properties::useBufferAge = true;
bool Properties::enablePartialUpdates = true;
float Properties::textGamma = DEFAULT_TEXT_GAMMA;
-int Properties::layerPoolSize = DEFAULT_LAYER_CACHE_SIZE;
+
+int Properties::fboCacheSize = DEFAULT_FBO_CACHE_SIZE;
+int Properties::gradientCacheSize = MB(DEFAULT_GRADIENT_CACHE_SIZE);
+int Properties::layerPoolSize = MB(DEFAULT_LAYER_CACHE_SIZE);
+int Properties::patchCacheSize = KB(DEFAULT_PATCH_CACHE_SIZE);
+int Properties::pathCacheSize = MB(DEFAULT_PATH_CACHE_SIZE);
+int Properties::renderBufferCacheSize = MB(DEFAULT_RENDER_BUFFER_CACHE_SIZE);
+int Properties::tessellationCacheSize = MB(DEFAULT_VERTEX_CACHE_SIZE);
+int Properties::textDropShadowCacheSize = MB(DEFAULT_DROP_SHADOW_CACHE_SIZE);
+int Properties::textureCacheSize = MB(DEFAULT_TEXTURE_CACHE_SIZE);
+
+float Properties::textureCacheFlushRate = DEFAULT_TEXTURE_CACHE_FLUSH_RATE;
DebugLevel Properties::debugLevel = kDebugDisabled;
OverdrawColorSet Properties::overdrawColorSet = OverdrawColorSet::Default;
@@ -79,7 +90,6 @@ bool Properties::load() {
bool prevDebugOverdraw = debugOverdraw;
StencilClipDebug prevDebugStencilClip = debugStencilClip;
-
debugOverdraw = false;
if (property_get(PROPERTY_DEBUG_OVERDRAW, property, nullptr) > 0) {
INIT_LOGD(" Overdraw debug enabled: %s", property);
@@ -133,7 +143,18 @@ bool Properties::load() {
enablePartialUpdates = property_get_bool(PROPERTY_ENABLE_PARTIAL_UPDATES, true);
textGamma = property_get_float(PROPERTY_TEXT_GAMMA, DEFAULT_TEXT_GAMMA);
+
+ fboCacheSize = property_get_int(PROPERTY_FBO_CACHE_SIZE, DEFAULT_FBO_CACHE_SIZE);
+ gradientCacheSize = MB(property_get_float(PROPERTY_GRADIENT_CACHE_SIZE, DEFAULT_GRADIENT_CACHE_SIZE));
layerPoolSize = MB(property_get_float(PROPERTY_LAYER_CACHE_SIZE, DEFAULT_LAYER_CACHE_SIZE));
+ patchCacheSize = KB(property_get_float(PROPERTY_PATCH_CACHE_SIZE, DEFAULT_PATCH_CACHE_SIZE));
+ pathCacheSize = MB(property_get_float(PROPERTY_PATH_CACHE_SIZE, DEFAULT_PATH_CACHE_SIZE));
+ renderBufferCacheSize = MB(property_get_float(PROPERTY_RENDER_BUFFER_CACHE_SIZE, DEFAULT_RENDER_BUFFER_CACHE_SIZE));
+ tessellationCacheSize = MB(property_get_float(PROPERTY_VERTEX_CACHE_SIZE, DEFAULT_VERTEX_CACHE_SIZE));
+ textDropShadowCacheSize = MB(property_get_float(PROPERTY_DROP_SHADOW_CACHE_SIZE, DEFAULT_DROP_SHADOW_CACHE_SIZE));
+ textureCacheSize = MB(property_get_float(PROPERTY_TEXTURE_CACHE_SIZE, DEFAULT_TEXTURE_CACHE_SIZE));
+ textureCacheFlushRate = std::max(0.0f, std::min(1.0f,
+ property_get_float(PROPERTY_TEXTURE_CACHE_FLUSH_RATE, DEFAULT_TEXTURE_CACHE_FLUSH_RATE)));
return (prevDebugLayersUpdates != debugLayersUpdates)
|| (prevDebugOverdraw != debugOverdraw)
diff --git a/libs/hwui/Properties.h b/libs/hwui/Properties.h
index 88f1dbc98926..3e111516ac63 100644
--- a/libs/hwui/Properties.h
+++ b/libs/hwui/Properties.h
@@ -267,7 +267,16 @@ public:
static float textGamma;
+ static int fboCacheSize;
+ static int gradientCacheSize;
static int layerPoolSize;
+ static int patchCacheSize;
+ static int pathCacheSize;
+ static int renderBufferCacheSize;
+ static int tessellationCacheSize;
+ static int textDropShadowCacheSize;
+ static int textureCacheSize;
+ static float textureCacheFlushRate;
static DebugLevel debugLevel;
static OverdrawColorSet overdrawColorSet;
diff --git a/libs/hwui/RenderBufferCache.cpp b/libs/hwui/RenderBufferCache.cpp
index 11d7a6af3a6a..1ac57cdbac0c 100644
--- a/libs/hwui/RenderBufferCache.cpp
+++ b/libs/hwui/RenderBufferCache.cpp
@@ -40,16 +40,9 @@ namespace uirenderer {
// Constructors/destructor
///////////////////////////////////////////////////////////////////////////////
-RenderBufferCache::RenderBufferCache(): mSize(0), mMaxSize(MB(DEFAULT_RENDER_BUFFER_CACHE_SIZE)) {
- char property[PROPERTY_VALUE_MAX];
- if (property_get(PROPERTY_RENDER_BUFFER_CACHE_SIZE, property, nullptr) > 0) {
- INIT_LOGD(" Setting render buffer cache size to %sMB", property);
- setMaxSize(MB(atof(property)));
- } else {
- INIT_LOGD(" Using default render buffer cache size of %.2fMB",
- DEFAULT_RENDER_BUFFER_CACHE_SIZE);
- }
-}
+RenderBufferCache::RenderBufferCache()
+ : mSize(0)
+ , mMaxSize(Properties::renderBufferCacheSize) {}
RenderBufferCache::~RenderBufferCache() {
clear();
@@ -67,11 +60,6 @@ uint32_t RenderBufferCache::getMaxSize() {
return mMaxSize;
}
-void RenderBufferCache::setMaxSize(uint32_t maxSize) {
- clear();
- mMaxSize = maxSize;
-}
-
///////////////////////////////////////////////////////////////////////////////
// Caching
///////////////////////////////////////////////////////////////////////////////
diff --git a/libs/hwui/RenderBufferCache.h b/libs/hwui/RenderBufferCache.h
index 7f59ec1c48b1..f77f4c95b5ba 100644
--- a/libs/hwui/RenderBufferCache.h
+++ b/libs/hwui/RenderBufferCache.h
@@ -64,10 +64,6 @@ public:
void clear();
/**
- * Sets the maximum size of the cache in bytes.
- */
- void setMaxSize(uint32_t maxSize);
- /**
* Returns the maximum size of the cache in bytes.
*/
uint32_t getMaxSize();
diff --git a/libs/hwui/TessellationCache.cpp b/libs/hwui/TessellationCache.cpp
index fd9fb852171c..14c8f3926e31 100644
--- a/libs/hwui/TessellationCache.cpp
+++ b/libs/hwui/TessellationCache.cpp
@@ -265,18 +265,9 @@ public:
///////////////////////////////////////////////////////////////////////////////
TessellationCache::TessellationCache()
- : mSize(0)
- , mMaxSize(MB(DEFAULT_VERTEX_CACHE_SIZE))
+ : mMaxSize(Properties::tessellationCacheSize)
, mCache(LruCache<Description, Buffer*>::kUnlimitedCapacity)
, mShadowCache(LruCache<ShadowDescription, Task<vertexBuffer_pair_t*>*>::kUnlimitedCapacity) {
- char property[PROPERTY_VALUE_MAX];
- if (property_get(PROPERTY_VERTEX_CACHE_SIZE, property, nullptr) > 0) {
- INIT_LOGD(" Setting tessellation cache size to %sMB", property);
- setMaxSize(MB(atof(property)));
- } else {
- INIT_LOGD(" Using default tessellation cache size of %.2fMB", DEFAULT_VERTEX_CACHE_SIZE);
- }
-
mCache.setOnEntryRemovedListener(&mBufferRemovedListener);
mShadowCache.setOnEntryRemovedListener(&mBufferPairRemovedListener);
mDebugEnabled = Properties::debugLevel & kDebugCaches;
@@ -303,13 +294,6 @@ uint32_t TessellationCache::getMaxSize() {
return mMaxSize;
}
-void TessellationCache::setMaxSize(uint32_t maxSize) {
- mMaxSize = maxSize;
- while (mSize > mMaxSize) {
- mCache.removeOldest();
- }
-}
-
///////////////////////////////////////////////////////////////////////////////
// Caching
///////////////////////////////////////////////////////////////////////////////
diff --git a/libs/hwui/TessellationCache.h b/libs/hwui/TessellationCache.h
index 6dcc8120cf48..0bd6365db60f 100644
--- a/libs/hwui/TessellationCache.h
+++ b/libs/hwui/TessellationCache.h
@@ -131,11 +131,6 @@ public:
* Clears the cache. This causes all TessellationBuffers to be deleted.
*/
void clear();
-
- /**
- * Sets the maximum size of the cache in bytes.
- */
- void setMaxSize(uint32_t maxSize);
/**
* Returns the maximum size of the cache in bytes.
*/
@@ -198,8 +193,7 @@ private:
Buffer* getOrCreateBuffer(const Description& entry, Tessellator tessellator);
- uint32_t mSize;
- uint32_t mMaxSize;
+ const uint32_t mMaxSize;
bool mDebugEnabled;
diff --git a/libs/hwui/TextDropShadowCache.cpp b/libs/hwui/TextDropShadowCache.cpp
index 1707468f169d..fe4b3d7507b2 100644
--- a/libs/hwui/TextDropShadowCache.cpp
+++ b/libs/hwui/TextDropShadowCache.cpp
@@ -93,36 +93,21 @@ int ShadowText::compare(const ShadowText& lhs, const ShadowText& rhs) {
// Constructors/destructor
///////////////////////////////////////////////////////////////////////////////
-TextDropShadowCache::TextDropShadowCache():
- mCache(LruCache<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, nullptr) > 0) {
- INIT_LOGD(" Setting drop shadow cache size to %sMB", property);
- setMaxSize(MB(atof(property)));
- } else {
- INIT_LOGD(" Using default drop shadow cache size of %.2fMB",
- DEFAULT_DROP_SHADOW_CACHE_SIZE);
- }
-
- init();
-}
+TextDropShadowCache::TextDropShadowCache()
+ : TextDropShadowCache(Properties::textDropShadowCacheSize) {}
-TextDropShadowCache::TextDropShadowCache(uint32_t maxByteSize):
- mCache(LruCache<ShadowText, ShadowTexture*>::kUnlimitedCapacity),
- mSize(0), mMaxSize(maxByteSize) {
- init();
+TextDropShadowCache::TextDropShadowCache(uint32_t maxByteSize)
+ : mCache(LruCache<ShadowText, ShadowTexture*>::kUnlimitedCapacity)
+ , mSize(0)
+ , mMaxSize(maxByteSize) {
+ mCache.setOnEntryRemovedListener(this);
+ mDebugEnabled = Properties::debugLevel & kDebugMoreCaches;
}
TextDropShadowCache::~TextDropShadowCache() {
mCache.clear();
}
-void TextDropShadowCache::init() {
- mCache.setOnEntryRemovedListener(this);
- mDebugEnabled = Properties::debugLevel & kDebugMoreCaches;
-}
-
///////////////////////////////////////////////////////////////////////////////
// Size management
///////////////////////////////////////////////////////////////////////////////
@@ -135,13 +120,6 @@ uint32_t TextDropShadowCache::getMaxSize() {
return mMaxSize;
}
-void TextDropShadowCache::setMaxSize(uint32_t maxSize) {
- mMaxSize = maxSize;
- while (mSize > mMaxSize) {
- mCache.removeOldest();
- }
-}
-
///////////////////////////////////////////////////////////////////////////////
// Callbacks
///////////////////////////////////////////////////////////////////////////////
diff --git a/libs/hwui/TextDropShadowCache.h b/libs/hwui/TextDropShadowCache.h
index c4f3c5d96786..cf647882e5a7 100644
--- a/libs/hwui/TextDropShadowCache.h
+++ b/libs/hwui/TextDropShadowCache.h
@@ -148,10 +148,6 @@ public:
}
/**
- * Sets the maximum size of the cache in bytes.
- */
- void setMaxSize(uint32_t maxSize);
- /**
* Returns the maximum size of the cache in bytes.
*/
uint32_t getMaxSize();
@@ -161,13 +157,11 @@ public:
uint32_t getSize();
private:
- void init();
-
LruCache<ShadowText, ShadowTexture*> mCache;
uint32_t mSize;
- uint32_t mMaxSize;
- FontRenderer* mRenderer;
+ const uint32_t mMaxSize;
+ FontRenderer* mRenderer = nullptr;
bool mDebugEnabled;
}; // class TextDropShadowCache
diff --git a/libs/hwui/TextureCache.cpp b/libs/hwui/TextureCache.cpp
index 31bfa3a1ada4..ade8600ab78b 100644
--- a/libs/hwui/TextureCache.cpp
+++ b/libs/hwui/TextureCache.cpp
@@ -35,26 +35,9 @@ namespace uirenderer {
TextureCache::TextureCache()
: mCache(LruCache<uint32_t, Texture*>::kUnlimitedCapacity)
, mSize(0)
- , mMaxSize(MB(DEFAULT_TEXTURE_CACHE_SIZE))
- , mFlushRate(DEFAULT_TEXTURE_CACHE_FLUSH_RATE)
+ , mMaxSize(Properties::textureCacheSize)
+ , mFlushRate(Properties::textureCacheFlushRate)
, mAssetAtlas(nullptr) {
- char property[PROPERTY_VALUE_MAX];
- if (property_get(PROPERTY_TEXTURE_CACHE_SIZE, property, nullptr) > 0) {
- INIT_LOGD(" Setting texture cache size to %sMB", property);
- setMaxSize(MB(atof(property)));
- } else {
- INIT_LOGD(" Using default texture cache size of %.2fMB", DEFAULT_TEXTURE_CACHE_SIZE);
- }
-
- if (property_get(PROPERTY_TEXTURE_CACHE_FLUSH_RATE, property, nullptr) > 0) {
- float flushRate = atof(property);
- INIT_LOGD(" Setting texture cache flush rate to %.2f%%", flushRate * 100.0f);
- setFlushRate(flushRate);
- } else {
- INIT_LOGD(" Using default texture cache flush rate of %.2f%%",
- DEFAULT_TEXTURE_CACHE_FLUSH_RATE * 100.0f);
- }
-
mCache.setOnEntryRemovedListener(this);
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &mMaxTextureSize);
@@ -79,17 +62,6 @@ uint32_t TextureCache::getMaxSize() {
return mMaxSize;
}
-void TextureCache::setMaxSize(uint32_t maxSize) {
- mMaxSize = maxSize;
- while (mSize > mMaxSize) {
- mCache.removeOldest();
- }
-}
-
-void TextureCache::setFlushRate(float flushRate) {
- mFlushRate = std::max(0.0f, std::min(1.0f, flushRate));
-}
-
///////////////////////////////////////////////////////////////////////////////
// Callbacks
///////////////////////////////////////////////////////////////////////////////
diff --git a/libs/hwui/TextureCache.h b/libs/hwui/TextureCache.h
index 463450c81714..a4317cee73fd 100644
--- a/libs/hwui/TextureCache.h
+++ b/libs/hwui/TextureCache.h
@@ -109,10 +109,6 @@ public:
void clear();
/**
- * Sets the maximum size of the cache in bytes.
- */
- void setMaxSize(uint32_t maxSize);
- /**
* Returns the maximum size of the cache in bytes.
*/
uint32_t getMaxSize();
@@ -126,11 +122,6 @@ public:
* is defined by the flush rate.
*/
void flush();
- /**
- * Indicates the percentage of the cache to retain when a
- * memory trim is requested (see Caches::flush).
- */
- void setFlushRate(float flushRate);
void setAssetAtlas(AssetAtlas* assetAtlas);
@@ -148,10 +139,10 @@ private:
LruCache<uint32_t, Texture*> mCache;
uint32_t mSize;
- uint32_t mMaxSize;
+ const uint32_t mMaxSize;
GLint mMaxTextureSize;
- float mFlushRate;
+ const float mFlushRate;
bool mDebugEnabled;