| OLD | NEW |
| 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 24 matching lines...) Expand all Loading... |
| 35 #include "cc/layers/layer_iterator.h" | 35 #include "cc/layers/layer_iterator.h" |
| 36 #include "cc/layers/layer_settings.h" | 36 #include "cc/layers/layer_settings.h" |
| 37 #include "cc/layers/painted_scrollbar_layer.h" | 37 #include "cc/layers/painted_scrollbar_layer.h" |
| 38 #include "cc/resources/ui_resource_request.h" | 38 #include "cc/resources/ui_resource_request.h" |
| 39 #include "cc/scheduler/begin_frame_source.h" | 39 #include "cc/scheduler/begin_frame_source.h" |
| 40 #include "cc/trees/draw_property_utils.h" | 40 #include "cc/trees/draw_property_utils.h" |
| 41 #include "cc/trees/layer_tree_host_client.h" | 41 #include "cc/trees/layer_tree_host_client.h" |
| 42 #include "cc/trees/layer_tree_host_common.h" | 42 #include "cc/trees/layer_tree_host_common.h" |
| 43 #include "cc/trees/layer_tree_host_impl.h" | 43 #include "cc/trees/layer_tree_host_impl.h" |
| 44 #include "cc/trees/layer_tree_impl.h" | 44 #include "cc/trees/layer_tree_impl.h" |
| 45 #include "cc/trees/proxy_main.h" |
| 45 #include "cc/trees/single_thread_proxy.h" | 46 #include "cc/trees/single_thread_proxy.h" |
| 46 #include "cc/trees/thread_proxy.h" | 47 #include "cc/trees/threaded_channel.h" |
| 47 #include "cc/trees/tree_synchronizer.h" | 48 #include "cc/trees/tree_synchronizer.h" |
| 48 #include "ui/gfx/geometry/size_conversions.h" | 49 #include "ui/gfx/geometry/size_conversions.h" |
| 49 #include "ui/gfx/geometry/vector2d_conversions.h" | 50 #include "ui/gfx/geometry/vector2d_conversions.h" |
| 50 | 51 |
| 51 namespace { | 52 namespace { |
| 52 static base::StaticAtomicSequenceNumber s_layer_tree_host_sequence_number; | 53 static base::StaticAtomicSequenceNumber s_layer_tree_host_sequence_number; |
| 53 } | 54 } |
| 54 | 55 |
| 55 namespace cc { | 56 namespace cc { |
| 56 | 57 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 rendering_stats_instrumentation_->set_record_rendering_stats( | 134 rendering_stats_instrumentation_->set_record_rendering_stats( |
| 134 debug_state_.RecordRenderingStats()); | 135 debug_state_.RecordRenderingStats()); |
| 135 } | 136 } |
| 136 | 137 |
| 137 void LayerTreeHost::InitializeThreaded( | 138 void LayerTreeHost::InitializeThreaded( |
| 138 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 139 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
| 139 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, | 140 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, |
| 140 scoped_ptr<BeginFrameSource> external_begin_frame_source) { | 141 scoped_ptr<BeginFrameSource> external_begin_frame_source) { |
| 141 task_runner_provider_ = | 142 task_runner_provider_ = |
| 142 TaskRunnerProvider::Create(main_task_runner, impl_task_runner); | 143 TaskRunnerProvider::Create(main_task_runner, impl_task_runner); |
| 143 InitializeProxy(ThreadProxy::Create(this, task_runner_provider_.get(), | 144 scoped_ptr<ProxyMain> proxy_main = |
| 144 std::move(external_begin_frame_source))); | 145 ProxyMain::Create(this, task_runner_provider_.get(), |
| 146 std::move(external_begin_frame_source)); |
| 147 proxy_main->SetChannel( |
| 148 ThreadedChannel::Create(proxy_main.get(), task_runner_provider_.get())); |
| 149 InitializeProxy(std::move(proxy_main)); |
| 145 } | 150 } |
| 146 | 151 |
| 147 void LayerTreeHost::InitializeSingleThreaded( | 152 void LayerTreeHost::InitializeSingleThreaded( |
| 148 LayerTreeHostSingleThreadClient* single_thread_client, | 153 LayerTreeHostSingleThreadClient* single_thread_client, |
| 149 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 154 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
| 150 scoped_ptr<BeginFrameSource> external_begin_frame_source) { | 155 scoped_ptr<BeginFrameSource> external_begin_frame_source) { |
| 151 task_runner_provider_ = TaskRunnerProvider::Create(main_task_runner, nullptr); | 156 task_runner_provider_ = TaskRunnerProvider::Create(main_task_runner, nullptr); |
| 152 InitializeProxy(SingleThreadProxy::Create( | 157 InitializeProxy(SingleThreadProxy::Create( |
| 153 this, single_thread_client, task_runner_provider_.get(), | 158 this, single_thread_client, task_runner_provider_.get(), |
| 154 std::move(external_begin_frame_source))); | 159 std::move(external_begin_frame_source))); |
| (...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1245 return animation_host_ ? animation_host_->HasAnyAnimation(layer->id()) | 1250 return animation_host_ ? animation_host_->HasAnyAnimation(layer->id()) |
| 1246 : false; | 1251 : false; |
| 1247 } | 1252 } |
| 1248 | 1253 |
| 1249 bool LayerTreeHost::HasActiveAnimation(const Layer* layer) const { | 1254 bool LayerTreeHost::HasActiveAnimation(const Layer* layer) const { |
| 1250 return animation_host_ ? animation_host_->HasActiveAnimation(layer->id()) | 1255 return animation_host_ ? animation_host_->HasActiveAnimation(layer->id()) |
| 1251 : false; | 1256 : false; |
| 1252 } | 1257 } |
| 1253 | 1258 |
| 1254 } // namespace cc | 1259 } // namespace cc |
| OLD | NEW |