summaryrefslogtreecommitdiffstats
path: root/cc/raster_worker_pool.cc
diff options
context:
space:
mode:
authorepenner@chromium.org <epenner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-24 01:55:06 +0000
committerepenner@chromium.org <epenner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-24 01:55:06 +0000
commite9875de7440186a564a15f2399be0c32434b9c40 (patch)
treecca77b857899dac8ad8a9aa1841059ed12d5fb2b /cc/raster_worker_pool.cc
parent276e8a328ac79317d8202b1ff31018c94af01c73 (diff)
downloadchromium_src-e9875de7440186a564a15f2399be0c32434b9c40.zip
chromium_src-e9875de7440186a564a15f2399be0c32434b9c40.tar.gz
chromium_src-e9875de7440186a564a15f2399be0c32434b9c40.tar.bz2
cc: Set ui/gpu/cc/ipc/upload/raster thread priorities.
This bumps up the ui/gpu/cc/ipc threads and bumps down the upload/raster threads. The webkit thread is left alone, as it needs to by dynamically adjusted (in another patch). To reduce risk and for easier merging we do this as #ifdefs and only for Android. This bug tracks abstracting the code and doing it on all platforms: http://crbug.com/170549 BUG=164651 Review URL: https://chromiumcodereview.appspot.com/11880014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178473 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/raster_worker_pool.cc')
-rw-r--r--cc/raster_worker_pool.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/cc/raster_worker_pool.cc b/cc/raster_worker_pool.cc
index 11fa577..cc10956 100644
--- a/cc/raster_worker_pool.cc
+++ b/cc/raster_worker_pool.cc
@@ -13,6 +13,11 @@
#include "cc/picture_pile_impl.h"
#include "third_party/skia/include/core/SkDevice.h"
+#if defined(OS_ANDROID)
+// TODO(epenner): Move thread priorities to base. (crbug.com/170549)
+#include <sys/resource.h>
+#endif
+
namespace cc {
namespace {
@@ -77,6 +82,14 @@ RasterWorkerPool::Thread::~Thread() {
Stop();
}
+void RasterWorkerPool::Thread::Init() {
+#if defined(OS_ANDROID)
+ // TODO(epenner): Move thread priorities to base. (crbug.com/170549)
+ int nice_value = 10; // Idle priority.
+ setpriority(PRIO_PROCESS, base::PlatformThread::CurrentId(), nice_value);
+#endif
+}
+
RasterWorkerPool::RasterWorkerPool(size_t num_raster_threads) {
const std::string thread_name_prefix = kRasterThreadNamePrefix;
while (raster_threads_.size() < num_raster_threads) {