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

Unified Diff: cc/worker_pool.cc

Issue 12209022: cc: add rasterize time to continuous painting graph data in impl-side-painting (Closed) Base URL: http://git.chromium.org/chromium/src.git@raster
Patch Set: Created 7 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
« cc/layer_tree_host_impl.cc ('K') | « cc/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/worker_pool.cc
diff --git a/cc/worker_pool.cc b/cc/worker_pool.cc
index 5797ab473c30aa4169f7136544aef5e3fe79e870..11a2a4e9026bbdf4eb98b5efc9c9f0c1e87b6429 100644
--- a/cc/worker_pool.cc
+++ b/cc/worker_pool.cc
@@ -59,12 +59,10 @@ void WorkerPoolTask::Completed() {
WorkerPool::Worker::Worker(
WorkerPool* worker_pool,
- const std::string name,
- scoped_ptr<RenderingStats> rendering_stats)
+ const std::string name)
: base::Thread(name.c_str()),
worker_pool_(worker_pool),
- weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
- rendering_stats_(rendering_stats.Pass()) {
+ weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
Start();
DCHECK(IsRunning());
}
@@ -125,18 +123,15 @@ void WorkerPool::Worker::OnTaskCompleted() {
worker_pool_->DidNumPendingTasksChange();
}
-WorkerPool::WorkerPool(size_t num_threads, bool record_rendering_stats)
+WorkerPool::WorkerPool(size_t num_threads)
: workers_need_sorting_(false),
shutdown_(false) {
const std::string thread_name_prefix = kWorkerThreadNamePrefix;
while (workers_.size() < num_threads) {
int thread_number = workers_.size() + 1;
- scoped_ptr<RenderingStats> rendering_stats = record_rendering_stats ?
- make_scoped_ptr(new RenderingStats) : scoped_ptr<RenderingStats>();
workers_.push_back(new Worker(
this,
- thread_name_prefix + StringPrintf("Worker%d", thread_number).c_str(),
- rendering_stats.Pass()));
+ thread_name_prefix + StringPrintf("Worker%d", thread_number).c_str()));
}
}
@@ -172,6 +167,15 @@ bool WorkerPool::IsBusy() {
return worker->num_pending_tasks() >= kNumPendingTasksPerWorker;
}
+void WorkerPool::SetRecordRenderingStats(bool record_rendering_stats) {
+ for (WorkerVector::iterator it = workers_.begin();
+ it != workers_.end(); ++it) {
+ Worker* worker = *it;
+ worker->SetRenderingStats(record_rendering_stats ?
+ make_scoped_ptr(new RenderingStats) : scoped_ptr<RenderingStats>());
+ }
+}
+
void WorkerPool::GetRenderingStats(RenderingStats* stats) {
stats->totalRasterizeTime = base::TimeDelta();
stats->totalPixelsRasterized = 0;
« cc/layer_tree_host_impl.cc ('K') | « cc/worker_pool.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698