Loading libs/hwui/pipeline/skia/SkiaPipeline.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -511,13 +511,13 @@ void SkiaPipeline::renderFrameImpl(const LayerUpdateQueue& layers, const SkRect& } void SkiaPipeline::dumpResourceCacheUsage() const { int resources, maxResources; size_t bytes, maxBytes; int resources; size_t bytes; mRenderThread.getGrContext()->getResourceCacheUsage(&resources, &bytes); mRenderThread.getGrContext()->getResourceCacheLimits(&maxResources, &maxBytes); size_t maxBytes = mRenderThread.getGrContext()->getResourceCacheLimit(); SkString log("Resource Cache Usage:\n"); log.appendf("%8d items out of %d maximum items\n", resources, maxResources); log.appendf("%8d items\n", resources); log.appendf("%8zu bytes (%.2f MB) out of %.2f MB maximum\n", bytes, bytes * (1.0f / (1024.0f * 1024.0f)), maxBytes * (1.0f / (1024.0f * 1024.0f))); Loading libs/hwui/renderthread/CacheManager.cpp +3 −4 Original line number Diff line number Diff line Loading @@ -69,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); } } Loading Loading @@ -119,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; Loading libs/hwui/renderthread/CacheManager.h +0 −1 Original line number Diff line number Diff line Loading @@ -71,7 +71,6 @@ private: sk_sp<GrContext> mGrContext; #endif int mMaxResources = 0; const size_t mMaxResourceBytes; const size_t mBackgroundResourceBytes; Loading Loading
libs/hwui/pipeline/skia/SkiaPipeline.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -511,13 +511,13 @@ void SkiaPipeline::renderFrameImpl(const LayerUpdateQueue& layers, const SkRect& } void SkiaPipeline::dumpResourceCacheUsage() const { int resources, maxResources; size_t bytes, maxBytes; int resources; size_t bytes; mRenderThread.getGrContext()->getResourceCacheUsage(&resources, &bytes); mRenderThread.getGrContext()->getResourceCacheLimits(&maxResources, &maxBytes); size_t maxBytes = mRenderThread.getGrContext()->getResourceCacheLimit(); SkString log("Resource Cache Usage:\n"); log.appendf("%8d items out of %d maximum items\n", resources, maxResources); log.appendf("%8d items\n", resources); log.appendf("%8zu bytes (%.2f MB) out of %.2f MB maximum\n", bytes, bytes * (1.0f / (1024.0f * 1024.0f)), maxBytes * (1.0f / (1024.0f * 1024.0f))); Loading
libs/hwui/renderthread/CacheManager.cpp +3 −4 Original line number Diff line number Diff line Loading @@ -69,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); } } Loading Loading @@ -119,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; Loading
libs/hwui/renderthread/CacheManager.h +0 −1 Original line number Diff line number Diff line Loading @@ -71,7 +71,6 @@ private: sk_sp<GrContext> mGrContext; #endif int mMaxResources = 0; const size_t mMaxResourceBytes; const size_t mBackgroundResourceBytes; Loading