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

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

Issue 1417053005: cc: Split ThreadProxy into ProxyMain and ProxyImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change ThreadedChannel::GetProxyImpl to GetProxyImplForTesting Created 5 years, 1 month 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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <stack> 8 #include <stack>
9 #include <string> 9 #include <string>
10 10
(...skipping 23 matching lines...) Expand all
34 #include "cc/layers/layer.h" 34 #include "cc/layers/layer.h"
35 #include "cc/layers/layer_iterator.h" 35 #include "cc/layers/layer_iterator.h"
36 #include "cc/layers/painted_scrollbar_layer.h" 36 #include "cc/layers/painted_scrollbar_layer.h"
37 #include "cc/resources/ui_resource_request.h" 37 #include "cc/resources/ui_resource_request.h"
38 #include "cc/scheduler/begin_frame_source.h" 38 #include "cc/scheduler/begin_frame_source.h"
39 #include "cc/trees/draw_property_utils.h" 39 #include "cc/trees/draw_property_utils.h"
40 #include "cc/trees/layer_tree_host_client.h" 40 #include "cc/trees/layer_tree_host_client.h"
41 #include "cc/trees/layer_tree_host_common.h" 41 #include "cc/trees/layer_tree_host_common.h"
42 #include "cc/trees/layer_tree_host_impl.h" 42 #include "cc/trees/layer_tree_host_impl.h"
43 #include "cc/trees/layer_tree_impl.h" 43 #include "cc/trees/layer_tree_impl.h"
44 #include "cc/trees/proxy_main.h"
44 #include "cc/trees/single_thread_proxy.h" 45 #include "cc/trees/single_thread_proxy.h"
45 #include "cc/trees/thread_proxy.h" 46 #include "cc/trees/threaded_channel.h"
46 #include "cc/trees/tree_synchronizer.h" 47 #include "cc/trees/tree_synchronizer.h"
47 #include "ui/gfx/geometry/size_conversions.h" 48 #include "ui/gfx/geometry/size_conversions.h"
48 #include "ui/gfx/geometry/vector2d_conversions.h" 49 #include "ui/gfx/geometry/vector2d_conversions.h"
49 50
50 namespace { 51 namespace {
51 static base::StaticAtomicSequenceNumber s_layer_tree_host_sequence_number; 52 static base::StaticAtomicSequenceNumber s_layer_tree_host_sequence_number;
52 } 53 }
53 54
54 namespace cc { 55 namespace cc {
55 56
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 rendering_stats_instrumentation_->set_record_rendering_stats( 133 rendering_stats_instrumentation_->set_record_rendering_stats(
133 debug_state_.RecordRenderingStats()); 134 debug_state_.RecordRenderingStats());
134 } 135 }
135 136
136 void LayerTreeHost::InitializeThreaded( 137 void LayerTreeHost::InitializeThreaded(
137 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, 138 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
138 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, 139 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner,
139 scoped_ptr<BeginFrameSource> external_begin_frame_source) { 140 scoped_ptr<BeginFrameSource> external_begin_frame_source) {
140 task_runner_provider_ = 141 task_runner_provider_ =
141 TaskRunnerProvider::Create(main_task_runner, impl_task_runner); 142 TaskRunnerProvider::Create(main_task_runner, impl_task_runner);
142 InitializeProxy(ThreadProxy::Create(this, task_runner_provider_.get(), 143 scoped_ptr<ProxyMain> proxy_main = ProxyMain::Create(
143 external_begin_frame_source.Pass())); 144 this, task_runner_provider_.get(), external_begin_frame_source.Pass());
145 scoped_ptr<ThreadedChannel> threaded_channel =
146 ThreadedChannel::Create(proxy_main.get(), task_runner_provider_.get());
147 proxy_main->SetChannel(threaded_channel.Pass());
Wez 2015/11/21 01:00:29 nit: Doesn't look like you need the |threaded_chan
Khushal 2015/11/23 20:07:19 Done.
148 InitializeProxy(proxy_main.Pass());
144 } 149 }
145 150
146 void LayerTreeHost::InitializeSingleThreaded( 151 void LayerTreeHost::InitializeSingleThreaded(
147 LayerTreeHostSingleThreadClient* single_thread_client, 152 LayerTreeHostSingleThreadClient* single_thread_client,
148 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, 153 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
149 scoped_ptr<BeginFrameSource> external_begin_frame_source) { 154 scoped_ptr<BeginFrameSource> external_begin_frame_source) {
150 task_runner_provider_ = TaskRunnerProvider::Create(main_task_runner, nullptr); 155 task_runner_provider_ = TaskRunnerProvider::Create(main_task_runner, nullptr);
151 InitializeProxy(SingleThreadProxy::Create( 156 InitializeProxy(SingleThreadProxy::Create(
152 this, single_thread_client, task_runner_provider_.get(), 157 this, single_thread_client, task_runner_provider_.get(),
153 external_begin_frame_source.Pass())); 158 external_begin_frame_source.Pass()));
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
1246 return animation_host_ ? animation_host_->HasAnyAnimation(layer->id()) 1251 return animation_host_ ? animation_host_->HasAnyAnimation(layer->id())
1247 : false; 1252 : false;
1248 } 1253 }
1249 1254
1250 bool LayerTreeHost::HasActiveAnimation(const Layer* layer) const { 1255 bool LayerTreeHost::HasActiveAnimation(const Layer* layer) const {
1251 return animation_host_ ? animation_host_->HasActiveAnimation(layer->id()) 1256 return animation_host_ ? animation_host_->HasActiveAnimation(layer->id())
1252 : false; 1257 : false;
1253 } 1258 }
1254 1259
1255 } // namespace cc 1260 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698