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

Side by Side Diff: cc/trees/threaded_channel.cc

Issue 1895873006: compositor-worker: Initialize CW machinery plumbing to compositor and fire CW rAF callbacks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Include WebCompositorMutatorClient from WebLayerTreeView to allow unique_ptr usage. Created 4 years, 6 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/trees/threaded_channel.h ('k') | components/scheduler/child/compositor_worker_scheduler.h » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/trees/threaded_channel.h" 5 #include "cc/trees/threaded_channel.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
11 #include "cc/animation/animation_events.h" 11 #include "cc/animation/animation_events.h"
12 #include "cc/animation/layer_tree_mutator.h"
12 #include "cc/trees/layer_tree_host.h" 13 #include "cc/trees/layer_tree_host.h"
13 14
14 namespace cc { 15 namespace cc {
15 16
16 std::unique_ptr<ThreadedChannel> ThreadedChannel::Create( 17 std::unique_ptr<ThreadedChannel> ThreadedChannel::Create(
17 ProxyMain* proxy_main, 18 ProxyMain* proxy_main,
18 TaskRunnerProvider* task_runner_provider) { 19 TaskRunnerProvider* task_runner_provider) {
19 return base::WrapUnique( 20 return base::WrapUnique(
20 new ThreadedChannel(proxy_main, task_runner_provider)); 21 new ThreadedChannel(proxy_main, task_runner_provider));
21 } 22 }
(...skipping 25 matching lines...) Expand all
47 } 48 }
48 49
49 void ThreadedChannel::InitializeOutputSurfaceOnImpl( 50 void ThreadedChannel::InitializeOutputSurfaceOnImpl(
50 OutputSurface* output_surface) { 51 OutputSurface* output_surface) {
51 DCHECK(IsMainThread()); 52 DCHECK(IsMainThread());
52 ImplThreadTaskRunner()->PostTask( 53 ImplThreadTaskRunner()->PostTask(
53 FROM_HERE, base::Bind(&ProxyImpl::InitializeOutputSurfaceOnImpl, 54 FROM_HERE, base::Bind(&ProxyImpl::InitializeOutputSurfaceOnImpl,
54 proxy_impl_weak_ptr_, output_surface)); 55 proxy_impl_weak_ptr_, output_surface));
55 } 56 }
56 57
58 void ThreadedChannel::InitializeMutatorOnImpl(
59 std::unique_ptr<LayerTreeMutator> mutator) {
60 ImplThreadTaskRunner()->PostTask(
61 FROM_HERE,
62 base::Bind(&ProxyImpl::InitializeMutatorOnImpl, proxy_impl_weak_ptr_,
63 base::Passed(std::move(mutator))));
64 }
65
57 void ThreadedChannel::MainThreadHasStoppedFlingingOnImpl() { 66 void ThreadedChannel::MainThreadHasStoppedFlingingOnImpl() {
58 DCHECK(IsMainThread()); 67 DCHECK(IsMainThread());
59 ImplThreadTaskRunner()->PostTask( 68 ImplThreadTaskRunner()->PostTask(
60 FROM_HERE, base::Bind(&ProxyImpl::MainThreadHasStoppedFlingingOnImpl, 69 FROM_HERE, base::Bind(&ProxyImpl::MainThreadHasStoppedFlingingOnImpl,
61 proxy_impl_weak_ptr_)); 70 proxy_impl_weak_ptr_));
62 } 71 }
63 72
64 void ThreadedChannel::SetInputThrottledUntilCommitOnImpl(bool is_throttled) { 73 void ThreadedChannel::SetInputThrottledUntilCommitOnImpl(bool is_throttled) {
65 DCHECK(IsMainThread()); 74 DCHECK(IsMainThread());
66 ImplThreadTaskRunner()->PostTask( 75 ImplThreadTaskRunner()->PostTask(
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 352
344 ThreadedChannel::MainThreadOnly::~MainThreadOnly() {} 353 ThreadedChannel::MainThreadOnly::~MainThreadOnly() {}
345 354
346 ThreadedChannel::CompositorThreadOnly::CompositorThreadOnly( 355 ThreadedChannel::CompositorThreadOnly::CompositorThreadOnly(
347 base::WeakPtr<ProxyMain> proxy_main_weak_ptr) 356 base::WeakPtr<ProxyMain> proxy_main_weak_ptr)
348 : proxy_main_weak_ptr(proxy_main_weak_ptr) {} 357 : proxy_main_weak_ptr(proxy_main_weak_ptr) {}
349 358
350 ThreadedChannel::CompositorThreadOnly::~CompositorThreadOnly() {} 359 ThreadedChannel::CompositorThreadOnly::~CompositorThreadOnly() {}
351 360
352 } // namespace cc 361 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/threaded_channel.h ('k') | components/scheduler/child/compositor_worker_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698