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/resources/raster_worker_pool.h" | 5 #include "cc/resources/raster_worker_pool.h" |
6 | 6 |
7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "cc/debug/devtools_instrumentation.h" | 10 #include "cc/debug/devtools_instrumentation.h" |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
312 void RunOnOriginThread() const { | 312 void RunOnOriginThread() const { |
313 on_raster_finished_callback_.Run(this); | 313 on_raster_finished_callback_.Run(this); |
314 } | 314 } |
315 | 315 |
316 scoped_refptr<base::MessageLoopProxy> origin_loop_; | 316 scoped_refptr<base::MessageLoopProxy> origin_loop_; |
317 const Callback on_raster_finished_callback_; | 317 const Callback on_raster_finished_callback_; |
318 | 318 |
319 DISALLOW_COPY_AND_ASSIGN(RasterFinishedWorkerPoolTaskImpl); | 319 DISALLOW_COPY_AND_ASSIGN(RasterFinishedWorkerPoolTaskImpl); |
320 }; | 320 }; |
321 | 321 |
322 const char* kWorkerThreadNamePrefix = "CompositorRaster"; | |
323 | 322 |
324 } // namespace | 323 } // namespace |
325 | 324 |
326 namespace internal { | 325 namespace internal { |
327 | 326 |
328 RasterWorkerPoolTask::RasterWorkerPoolTask( | 327 RasterWorkerPoolTask::RasterWorkerPoolTask( |
329 const Resource* resource, TaskVector* dependencies) | 328 const Resource* resource, TaskVector* dependencies) |
330 : did_run_(false), | 329 : did_run_(false), |
331 did_complete_(false), | 330 did_complete_(false), |
332 was_canceled_(false), | 331 was_canceled_(false), |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
454 skia::LazyPixelRef* pixel_ref, | 453 skia::LazyPixelRef* pixel_ref, |
455 int layer_id, | 454 int layer_id, |
456 RenderingStatsInstrumentation* stats_instrumentation, | 455 RenderingStatsInstrumentation* stats_instrumentation, |
457 const Task::Reply& reply) { | 456 const Task::Reply& reply) { |
458 return Task(new ImageDecodeWorkerPoolTaskImpl(pixel_ref, | 457 return Task(new ImageDecodeWorkerPoolTaskImpl(pixel_ref, |
459 layer_id, | 458 layer_id, |
460 stats_instrumentation, | 459 stats_instrumentation, |
461 reply)); | 460 reply)); |
462 } | 461 } |
463 | 462 |
464 RasterWorkerPool::RasterWorkerPool(ResourceProvider* resource_provider, | 463 RasterWorkerPool::RasterWorkerPool(ResourceProvider* resource_provider) |
465 size_t num_threads) | 464 : WorkerPool(), |
reveman
2013/12/28 14:45:48
nit: WorkerPool() not needed.
sohanjg
2013/12/30 06:49:36
Done.
| |
466 : WorkerPool(num_threads, kWorkerThreadNamePrefix), | |
467 client_(NULL), | 465 client_(NULL), |
468 resource_provider_(resource_provider), | 466 resource_provider_(resource_provider), |
469 weak_ptr_factory_(this) { | 467 weak_ptr_factory_(this) { |
470 } | 468 } |
471 | 469 |
472 RasterWorkerPool::~RasterWorkerPool() { | 470 RasterWorkerPool::~RasterWorkerPool() { |
473 } | 471 } |
474 | 472 |
475 void RasterWorkerPool::SetClient(RasterWorkerPoolClient* client) { | 473 void RasterWorkerPool::SetClient(RasterWorkerPoolClient* client) { |
476 client_ = client; | 474 client_ = client; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
587 | 585 |
588 internal::GraphNode* decode_node = CreateGraphNodeForTask( | 586 internal::GraphNode* decode_node = CreateGraphNodeForTask( |
589 decode_task, priority, graph); | 587 decode_task, priority, graph); |
590 decode_node->add_dependent(raster_node); | 588 decode_node->add_dependent(raster_node); |
591 } | 589 } |
592 | 590 |
593 return raster_node; | 591 return raster_node; |
594 } | 592 } |
595 | 593 |
596 } // namespace cc | 594 } // namespace cc |
OLD | NEW |