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_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 begin_impl_frame_interval_(BeginFrameArgs::DefaultInterval()), | 225 begin_impl_frame_interval_(BeginFrameArgs::DefaultInterval()), |
226 animation_registrar_(AnimationRegistrar::Create()), | 226 animation_registrar_(AnimationRegistrar::Create()), |
227 rendering_stats_instrumentation_(rendering_stats_instrumentation), | 227 rendering_stats_instrumentation_(rendering_stats_instrumentation), |
228 micro_benchmark_controller_(this), | 228 micro_benchmark_controller_(this), |
229 shared_bitmap_manager_(shared_bitmap_manager), | 229 shared_bitmap_manager_(shared_bitmap_manager), |
230 gpu_memory_buffer_manager_(gpu_memory_buffer_manager), | 230 gpu_memory_buffer_manager_(gpu_memory_buffer_manager), |
231 task_graph_runner_(task_graph_runner), | 231 task_graph_runner_(task_graph_runner), |
232 id_(id), | 232 id_(id), |
233 requires_high_res_to_draw_(false), | 233 requires_high_res_to_draw_(false), |
234 is_likely_to_require_a_draw_(false), | 234 is_likely_to_require_a_draw_(false), |
235 frame_timing_tracker_(FrameTimingTracker::Create()) { | 235 frame_timing_tracker_(FrameTimingTracker::Create(this)) { |
236 DCHECK(proxy_->IsImplThread()); | 236 DCHECK(proxy_->IsImplThread()); |
237 DidVisibilityChange(this, visible_); | 237 DidVisibilityChange(this, visible_); |
238 animation_registrar_->set_supports_scroll_animations( | 238 animation_registrar_->set_supports_scroll_animations( |
239 proxy_->SupportsImplScrolling()); | 239 proxy_->SupportsImplScrolling()); |
240 | 240 |
241 SetDebugState(settings.initial_debug_state); | 241 SetDebugState(settings.initial_debug_state); |
242 | 242 |
243 // LTHI always has an active tree. | 243 // LTHI always has an active tree. |
244 active_tree_ = | 244 active_tree_ = |
245 LayerTreeImpl::create(this, new SyncedProperty<ScaleGroup>(), | 245 LayerTreeImpl::create(this, new SyncedProperty<ScaleGroup>(), |
(...skipping 1920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2166 active_tree_->GatherFrameTimingRequestIds(&request_ids); | 2166 active_tree_->GatherFrameTimingRequestIds(&request_ids); |
2167 if (request_ids.empty()) | 2167 if (request_ids.empty()) |
2168 return; | 2168 return; |
2169 | 2169 |
2170 base::TimeTicks start_time = start_of_main_frame_args.frame_time; | 2170 base::TimeTicks start_time = start_of_main_frame_args.frame_time; |
2171 base::TimeTicks end_time = expected_next_main_frame_args.frame_time; | 2171 base::TimeTicks end_time = expected_next_main_frame_args.frame_time; |
2172 frame_timing_tracker_->SaveMainFrameTimeStamps( | 2172 frame_timing_tracker_->SaveMainFrameTimeStamps( |
2173 request_ids, start_time, end_time, active_tree_->source_frame_number()); | 2173 request_ids, start_time, end_time, active_tree_->source_frame_number()); |
2174 } | 2174 } |
2175 | 2175 |
| 2176 void LayerTreeHostImpl::PostFrameTimingEvents( |
| 2177 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, |
| 2178 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) { |
| 2179 client_->PostFrameTimingEventsOnImplThread(composite_events.Pass(), |
| 2180 main_frame_events.Pass()); |
| 2181 } |
| 2182 |
2176 void LayerTreeHostImpl::DestroyTileManager() { | 2183 void LayerTreeHostImpl::DestroyTileManager() { |
2177 tile_manager_ = nullptr; | 2184 tile_manager_ = nullptr; |
2178 resource_pool_ = nullptr; | 2185 resource_pool_ = nullptr; |
2179 staging_resource_pool_ = nullptr; | 2186 staging_resource_pool_ = nullptr; |
2180 tile_task_worker_pool_ = nullptr; | 2187 tile_task_worker_pool_ = nullptr; |
2181 single_thread_synchronous_task_graph_runner_ = nullptr; | 2188 single_thread_synchronous_task_graph_runner_ = nullptr; |
2182 } | 2189 } |
2183 | 2190 |
2184 bool LayerTreeHostImpl::IsSynchronousSingleThreaded() const { | 2191 bool LayerTreeHostImpl::IsSynchronousSingleThreaded() const { |
2185 return !proxy_->HasImplThread() && !settings_.single_thread_proxy_scheduler; | 2192 return !proxy_->HasImplThread() && !settings_.single_thread_proxy_scheduler; |
(...skipping 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3442 new_target.SetToMin(layer_impl->MaxScrollOffset()); | 3449 new_target.SetToMin(layer_impl->MaxScrollOffset()); |
3443 | 3450 |
3444 curve->UpdateTarget( | 3451 curve->UpdateTarget( |
3445 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) | 3452 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) |
3446 .InSecondsF(), | 3453 .InSecondsF(), |
3447 new_target); | 3454 new_target); |
3448 | 3455 |
3449 return true; | 3456 return true; |
3450 } | 3457 } |
3451 } // namespace cc | 3458 } // namespace cc |
OLD | NEW |