OSDN Git Service

Properly account for created paths in the cache
authorRomain Guy <romainguy@google.com>
Thu, 22 Aug 2013 00:35:38 +0000 (17:35 -0700)
committerRomain Guy <romainguy@google.com>
Thu, 22 Aug 2013 00:35:38 +0000 (17:35 -0700)
Change-Id: I47b89b3085cefab6daac9194e7bfd3c140b37fa2

libs/hwui/PathCache.cpp
libs/hwui/thread/TaskManager.cpp

index 70ab6e7..25afe63 100644 (file)
@@ -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;
     }
 }
index c8bfd9c..189895c 100644 (file)
@@ -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;