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

Side by Side Diff: cc/resources/raster_worker_pool.cc

Issue 73923003: Shared Raster Worker Threads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Build Error for Mac, macro conflict, moving setter to WorkerPool. 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 unified diff | Download patch
« no previous file with comments | « cc/resources/raster_worker_pool.h ('k') | cc/resources/raster_worker_pool_perftest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/debug/trace_event_synthetic_delay.h" 7 #include "base/debug/trace_event_synthetic_delay.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 private: 403 private:
404 virtual ~RasterRequiredForActivationFinishedWorkerPoolTaskImpl() {} 404 virtual ~RasterRequiredForActivationFinishedWorkerPoolTaskImpl() {}
405 405
406 base::TimeTicks activation_delay_end_time_; 406 base::TimeTicks activation_delay_end_time_;
407 const size_t tasks_required_for_activation_count_; 407 const size_t tasks_required_for_activation_count_;
408 408
409 DISALLOW_COPY_AND_ASSIGN( 409 DISALLOW_COPY_AND_ASSIGN(
410 RasterRequiredForActivationFinishedWorkerPoolTaskImpl); 410 RasterRequiredForActivationFinishedWorkerPoolTaskImpl);
411 }; 411 };
412 412
413 const char* kWorkerThreadNamePrefix = "CompositorRaster";
414 413
415 } // namespace 414 } // namespace
416 415
417 namespace internal { 416 namespace internal {
418 417
419 RasterWorkerPoolTask::RasterWorkerPoolTask(const Resource* resource, 418 RasterWorkerPoolTask::RasterWorkerPoolTask(const Resource* resource,
420 TaskVector* dependencies, 419 TaskVector* dependencies,
421 bool use_gpu_rasterization) 420 bool use_gpu_rasterization)
422 : did_run_(false), 421 : did_run_(false),
423 did_complete_(false), 422 did_complete_(false),
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 int layer_id, 549 int layer_id,
551 RenderingStatsInstrumentation* stats_instrumentation, 550 RenderingStatsInstrumentation* stats_instrumentation,
552 const Task::Reply& reply) { 551 const Task::Reply& reply) {
553 return Task(new ImageDecodeWorkerPoolTaskImpl(pixel_ref, 552 return Task(new ImageDecodeWorkerPoolTaskImpl(pixel_ref,
554 layer_id, 553 layer_id,
555 stats_instrumentation, 554 stats_instrumentation,
556 reply)); 555 reply));
557 } 556 }
558 557
559 RasterWorkerPool::RasterWorkerPool(ResourceProvider* resource_provider, 558 RasterWorkerPool::RasterWorkerPool(ResourceProvider* resource_provider,
560 ContextProvider* context_provider, 559 ContextProvider* context_provider)
561 size_t num_threads) 560 : client_(NULL),
562 : WorkerPool(num_threads, kWorkerThreadNamePrefix),
563 client_(NULL),
564 resource_provider_(resource_provider), 561 resource_provider_(resource_provider),
565 context_provider_(context_provider), 562 context_provider_(context_provider),
566 weak_ptr_factory_(this) { 563 weak_ptr_factory_(this) {
567 } 564 }
568 565
569 RasterWorkerPool::~RasterWorkerPool() { 566 RasterWorkerPool::~RasterWorkerPool() {
570 } 567 }
571 568
572 void RasterWorkerPool::SetClient(RasterWorkerPoolClient* client) { 569 void RasterWorkerPool::SetClient(RasterWorkerPoolClient* client) {
573 client_ = client; 570 client_ = client;
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 727
731 internal::GraphNode* decode_node = CreateGraphNodeForTask( 728 internal::GraphNode* decode_node = CreateGraphNodeForTask(
732 decode_task, priority, graph); 729 decode_task, priority, graph);
733 decode_node->add_dependent(raster_node); 730 decode_node->add_dependent(raster_node);
734 } 731 }
735 732
736 return raster_node; 733 return raster_node;
737 } 734 }
738 735
739 } // namespace cc 736 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/raster_worker_pool.h ('k') | cc/resources/raster_worker_pool_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698