Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3186)

Unified Diff: cc/resources/raster_worker_pool.cc

Issue 160023002: cc: Only make num_threads - 1 SkPicture clones. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sw renderer too Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/resources/raster_worker_pool.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/raster_worker_pool.cc
diff --git a/cc/resources/raster_worker_pool.cc b/cc/resources/raster_worker_pool.cc
index 30f684a31c701090cbbfc4ebc56ef5478d45e3bc..d6cbe673cfbca226dbaff41b3525344aea091809 100644
--- a/cc/resources/raster_worker_pool.cc
+++ b/cc/resources/raster_worker_pool.cc
@@ -450,6 +450,15 @@ class RasterRequiredForActivationFinishedWorkerPoolTaskImpl
RasterRequiredForActivationFinishedWorkerPoolTaskImpl);
};
+class RasterTaskGraphRunner : public internal::TaskGraphRunner {
+ public:
+ RasterTaskGraphRunner()
+ : internal::TaskGraphRunner(RasterWorkerPool::GetNumRasterThreads(),
+ "CompositorRaster") {}
+};
+base::LazyInstance<RasterTaskGraphRunner>::Leaky g_task_graph_runner =
+ LAZY_INSTANCE_INITIALIZER;
+
const int kDefaultNumRasterThreads = 1;
int g_num_raster_threads = 0;
@@ -554,12 +563,15 @@ void RasterWorkerPool::RasterTask::Reset() { internal_ = NULL; }
RasterWorkerPool::RasterTask::~RasterTask() {}
+// This allows an external rasterize on-demand system to run raster tasks
+// with highest priority using the same task graph runner instance.
+unsigned RasterWorkerPool::kOnDemandRasterTaskPriority = 0u;
// Task priorities that make sure raster finished tasks run before any
// remaining raster tasks.
-unsigned RasterWorkerPool::kRasterFinishedTaskPriority = 1u;
+unsigned RasterWorkerPool::kRasterFinishedTaskPriority = 2u;
unsigned RasterWorkerPool::kRasterRequiredForActivationFinishedTaskPriority =
- 0u;
-unsigned RasterWorkerPool::kRasterTaskPriorityBase = 2u;
+ 1u;
+unsigned RasterWorkerPool::kRasterTaskPriorityBase = 3u;
RasterWorkerPool::RasterWorkerPool(internal::TaskGraphRunner* task_graph_runner,
ResourceProvider* resource_provider,
@@ -590,6 +602,11 @@ int RasterWorkerPool::GetNumRasterThreads() {
}
// static
+internal::TaskGraphRunner* RasterWorkerPool::GetTaskGraphRunner() {
+ return g_task_graph_runner.Pointer();
+}
+
+// static
RasterWorkerPool::RasterTask RasterWorkerPool::CreateRasterTask(
const Resource* resource,
PicturePileImpl* picture_pile,
« no previous file with comments | « cc/resources/raster_worker_pool.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698