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

Unified Diff: cc/resources/raster_worker_pool.h

Issue 73923003: Shared Raster Worker Threads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moving number of raster thread API to RasterWorkerPool + comments Created 6 years, 11 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
Index: cc/resources/raster_worker_pool.h
diff --git a/cc/resources/raster_worker_pool.h b/cc/resources/raster_worker_pool.h
old mode 100644
new mode 100755
index fac2fd845ce81db11136a986f0437db89f6e8867..6bdb537ff6976520172d08f840193c32665e8051
--- a/cc/resources/raster_worker_pool.h
+++ b/cc/resources/raster_worker_pool.h
@@ -188,6 +188,14 @@ class CC_EXPORT RasterWorkerPool : public WorkerPool {
// Returns the format that needs to be used for raster task resources.
virtual ResourceFormat GetResourceFormat() const = 0;
+ // Sets the number of threads to use for running raster tasks.
+ // Can only be called once prior to GetNumRasterThreads().
+ // Caller is responsible for correct ordering.
+ static void SetNumRasterThreads();
+
+ // Gets the number of threads to use for running raster tasks.
+ static int GetNumRasterThreads();
+
// TODO(vmpstr): Figure out an elegant way to not pass this many parameters.
static RasterTask CreateRasterTask(
const Resource* resource,
@@ -218,7 +226,7 @@ class CC_EXPORT RasterWorkerPool : public WorkerPool {
typedef base::hash_map<TaskMapKey,
scoped_refptr<internal::WorkerPoolTask> > TaskMap;
- RasterWorkerPool(ResourceProvider* resource_provider, size_t num_threads);
+ explicit RasterWorkerPool(ResourceProvider* resource_provider);
virtual void OnRasterTasksFinished() = 0;
virtual void OnRasterTasksRequiredForActivationFinished() = 0;
@@ -275,6 +283,7 @@ class CC_EXPORT RasterWorkerPool : public WorkerPool {
scoped_refptr<internal::WorkerPoolTask>
raster_required_for_activation_finished_task_;
base::WeakPtrFactory<RasterWorkerPool> weak_ptr_factory_;
+ static int num_raster_threads_;
reveman 2014/01/06 07:13:12 no need for this to be in the header. put it in an
sohanjg 2014/01/06 09:57:29 Done.
};
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698