From 0a8c51b1d0d66d6060afcec1eab33091d49332ae Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Wed, 21 Aug 2013 17:35:38 -0700 Subject: [PATCH] Properly account for created paths in the cache Change-Id: I47b89b3085cefab6daac9194e7bfd3c140b37fa2 --- libs/hwui/PathCache.cpp | 5 +++++ libs/hwui/thread/TaskManager.cpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libs/hwui/PathCache.cpp b/libs/hwui/PathCache.cpp index 70ab6e7df66ad..25afe63267fe5 100644 --- a/libs/hwui/PathCache.cpp +++ b/libs/hwui/PathCache.cpp @@ -283,6 +283,11 @@ void PathCache::generateTexture(const PathDescription& entry, SkBitmap* bitmap, mCache.put(entry, texture); } } else { + // It's okay to add a texture that's bigger than the cache since + // we'll trim the cache later when addToCache is set to false + if (!addToCache) { + mSize += size; + } texture->cleanup = true; } } diff --git a/libs/hwui/thread/TaskManager.cpp b/libs/hwui/thread/TaskManager.cpp index c8bfd9c881651..189895c705a64 100644 --- a/libs/hwui/thread/TaskManager.cpp +++ b/libs/hwui/thread/TaskManager.cpp @@ -29,7 +29,7 @@ namespace uirenderer { TaskManager::TaskManager() { // Get the number of available CPUs. This value does not change over time. - int cpuCount = sysconf(_SC_NPROCESSORS_ONLN); + int cpuCount = sysconf(_SC_NPROCESSORS_CONF); for (int i = 0; i < cpuCount / 2; i++) { String8 name;