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

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: Rebase + ready_to_run_task_namespaces_ changes 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
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/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
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
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 : client_(NULL),
466 : WorkerPool(num_threads, kWorkerThreadNamePrefix),
467 client_(NULL),
468 resource_provider_(resource_provider), 465 resource_provider_(resource_provider),
469 weak_ptr_factory_(this) { 466 weak_ptr_factory_(this) {
470 } 467 }
471 468
472 RasterWorkerPool::~RasterWorkerPool() { 469 RasterWorkerPool::~RasterWorkerPool() {
473 } 470 }
474 471
475 void RasterWorkerPool::SetClient(RasterWorkerPoolClient* client) { 472 void RasterWorkerPool::SetClient(RasterWorkerPoolClient* client) {
476 client_ = client; 473 client_ = client;
477 } 474 }
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 584
588 internal::GraphNode* decode_node = CreateGraphNodeForTask( 585 internal::GraphNode* decode_node = CreateGraphNodeForTask(
589 decode_task, priority, graph); 586 decode_task, priority, graph);
590 decode_node->add_dependent(raster_node); 587 decode_node->add_dependent(raster_node);
591 } 588 }
592 589
593 return raster_node; 590 return raster_node;
594 } 591 }
595 592
596 } // namespace cc 593 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698