summaryrefslogtreecommitdiffstats
path: root/libs/hwui/thread
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2014-06-02 16:27:04 -0700
committerChris Craik <ccraik@google.com>2014-06-10 01:53:17 +0000
commit05f3d6e5111fd08df5cd9aae2c3d28399dc0e7f5 (patch)
tree14df3cad82b02a886b8e3a04fd4ec249e1d403e4 /libs/hwui/thread
parentfaecafce62ca39a7693669f7c9eabf2d71c633cf (diff)
downloadframeworks_base-05f3d6e5111fd08df5cd9aae2c3d28399dc0e7f5.zip
frameworks_base-05f3d6e5111fd08df5cd9aae2c3d28399dc0e7f5.tar.gz
frameworks_base-05f3d6e5111fd08df5cd9aae2c3d28399dc0e7f5.tar.bz2
Tessellate on worker threads
Tessellate and cache (where possible) shadow and round rect tessellation tasks. Change-Id: I2cfda8e11d83d51ea74af871235cf26e8f831d40
Diffstat (limited to 'libs/hwui/thread')
-rw-r--r--libs/hwui/thread/TaskManager.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/hwui/thread/TaskManager.cpp b/libs/hwui/thread/TaskManager.cpp
index 189895c..3d2b0d9 100644
--- a/libs/hwui/thread/TaskManager.cpp
+++ b/libs/hwui/thread/TaskManager.cpp
@@ -16,9 +16,10 @@
#include <sys/sysinfo.h>
+#include "TaskManager.h"
#include "Task.h"
#include "TaskProcessor.h"
-#include "TaskManager.h"
+#include "utils/MathUtils.h"
namespace android {
namespace uirenderer {
@@ -31,7 +32,8 @@ TaskManager::TaskManager() {
// Get the number of available CPUs. This value does not change over time.
int cpuCount = sysconf(_SC_NPROCESSORS_CONF);
- for (int i = 0; i < cpuCount / 2; i++) {
+ int workerCount = MathUtils::max(1, cpuCount / 2);
+ for (int i = 0; i < workerCount; i++) {
String8 name;
name.appendFormat("hwuiTask%d", i + 1);
mThreads.add(new WorkerThread(name));