summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/CacheManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/renderthread/CacheManager.cpp')
-rw-r--r--libs/hwui/renderthread/CacheManager.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/libs/hwui/renderthread/CacheManager.cpp b/libs/hwui/renderthread/CacheManager.cpp
index 1b638c12ac7b..8eb81533fda8 100644
--- a/libs/hwui/renderthread/CacheManager.cpp
+++ b/libs/hwui/renderthread/CacheManager.cpp
@@ -28,7 +28,6 @@
#include <SkExecutor.h>
#include <SkGraphics.h>
#include <SkMathPriv.h>
-#include <gui/Surface.h>
#include <math.h>
#include <set>
@@ -40,7 +39,7 @@ namespace renderthread {
// to the screen resolution. This is meant to be a conservative default based on
// that analysis. The 4.0f is used because the default pixel format is assumed to
// be ARGB_8888.
-#define SURFACE_SIZE_MULTIPLIER (12.0f * 4.0f)
+#define SURFACE_SIZE_MULTIPLIER (5.0f * 4.0f)
#define BACKGROUND_RETENTION_PERCENTAGE (0.5f)
CacheManager::CacheManager(const DisplayInfo& display)
@@ -70,8 +69,7 @@ void CacheManager::reset(sk_sp<GrContext> context) {
if (context) {
mGrContext = std::move(context);
- mGrContext->getResourceCacheLimits(&mMaxResources, nullptr);
- mGrContext->setResourceCacheLimits(mMaxResources, mMaxResourceBytes);
+ mGrContext->setResourceCacheLimit(mMaxResourceBytes);
}
}
@@ -120,8 +118,8 @@ void CacheManager::trimMemory(TrimMemoryMode mode) {
// limits between the background and max amounts. This causes the unlocked resources
// that have persistent data to be purged in LRU order.
mGrContext->purgeUnlockedResources(true);
- mGrContext->setResourceCacheLimits(mMaxResources, mBackgroundResourceBytes);
- mGrContext->setResourceCacheLimits(mMaxResources, mMaxResourceBytes);
+ mGrContext->setResourceCacheLimit(mBackgroundResourceBytes);
+ mGrContext->setResourceCacheLimit(mMaxResourceBytes);
SkGraphics::SetFontCacheLimit(mBackgroundCpuFontCacheBytes);
SkGraphics::SetFontCacheLimit(mMaxCpuFontCacheBytes);
break;