| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/worker_pool.h" | 5 #include "cc/worker_pool.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 void WorkerPool::SetRecordRenderingStats(bool record_rendering_stats) { | 202 void WorkerPool::SetRecordRenderingStats(bool record_rendering_stats) { |
| 203 for (WorkerVector::iterator it = workers_.begin(); | 203 for (WorkerVector::iterator it = workers_.begin(); |
| 204 it != workers_.end(); ++it) { | 204 it != workers_.end(); ++it) { |
| 205 Worker* worker = *it; | 205 Worker* worker = *it; |
| 206 worker->set_record_rendering_stats(record_rendering_stats); | 206 worker->set_record_rendering_stats(record_rendering_stats); |
| 207 } | 207 } |
| 208 } | 208 } |
| 209 | 209 |
| 210 void WorkerPool::GetRenderingStats(RenderingStats* stats) { | 210 void WorkerPool::GetRenderingStats(RenderingStats* stats) { |
| 211 stats->totalRasterizeTime = base::TimeDelta(); | 211 stats->totalRasterizeTime = base::TimeDelta(); |
| 212 stats->totalRasterizeTimeForNowBinsOnPendingTree = base::TimeDelta(); |
| 212 stats->totalPixelsRasterized = 0; | 213 stats->totalPixelsRasterized = 0; |
| 213 stats->totalDeferredImageDecodeCount = 0; | 214 stats->totalDeferredImageDecodeCount = 0; |
| 214 stats->totalDeferredImageDecodeTime = base::TimeDelta(); | 215 stats->totalDeferredImageDecodeTime = base::TimeDelta(); |
| 215 for (WorkerVector::iterator it = workers_.begin(); | 216 for (WorkerVector::iterator it = workers_.begin(); |
| 216 it != workers_.end(); ++it) { | 217 it != workers_.end(); ++it) { |
| 217 Worker* worker = *it; | 218 Worker* worker = *it; |
| 218 CHECK(worker->rendering_stats()); | 219 CHECK(worker->rendering_stats()); |
| 219 stats->totalRasterizeTime += | 220 stats->totalRasterizeTime += |
| 220 worker->rendering_stats()->totalRasterizeTime; | 221 worker->rendering_stats()->totalRasterizeTime; |
| 222 stats->totalRasterizeTimeForNowBinsOnPendingTree += |
| 223 worker->rendering_stats()->totalRasterizeTimeForNowBinsOnPendingTree; |
| 221 stats->totalPixelsRasterized += | 224 stats->totalPixelsRasterized += |
| 222 worker->rendering_stats()->totalPixelsRasterized; | 225 worker->rendering_stats()->totalPixelsRasterized; |
| 223 stats->totalDeferredImageDecodeCount += | 226 stats->totalDeferredImageDecodeCount += |
| 224 worker->rendering_stats()->totalDeferredImageDecodeCount; | 227 worker->rendering_stats()->totalDeferredImageDecodeCount; |
| 225 stats->totalDeferredImageDecodeTime += | 228 stats->totalDeferredImageDecodeTime += |
| 226 worker->rendering_stats()->totalDeferredImageDecodeTime; | 229 worker->rendering_stats()->totalDeferredImageDecodeTime; |
| 227 } | 230 } |
| 228 } | 231 } |
| 229 | 232 |
| 230 WorkerPool::Worker* WorkerPool::GetWorkerForNextTask() { | 233 WorkerPool::Worker* WorkerPool::GetWorkerForNextTask() { |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 | 297 |
| 295 void WorkerPool::SortWorkersIfNeeded() { | 298 void WorkerPool::SortWorkersIfNeeded() { |
| 296 if (!workers_need_sorting_) | 299 if (!workers_need_sorting_) |
| 297 return; | 300 return; |
| 298 | 301 |
| 299 std::sort(workers_.begin(), workers_.end(), NumPendingTasksComparator()); | 302 std::sort(workers_.begin(), workers_.end(), NumPendingTasksComparator()); |
| 300 workers_need_sorting_ = false; | 303 workers_need_sorting_ = false; |
| 301 } | 304 } |
| 302 | 305 |
| 303 } // namespace cc | 306 } // namespace cc |
| OLD | NEW |