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

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

Issue 1137823002: Pass collected frame timing events to Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review comments. Created 5 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
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_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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 resourceless_software_draw_(false), 223 resourceless_software_draw_(false),
224 animation_registrar_(AnimationRegistrar::Create()), 224 animation_registrar_(AnimationRegistrar::Create()),
225 rendering_stats_instrumentation_(rendering_stats_instrumentation), 225 rendering_stats_instrumentation_(rendering_stats_instrumentation),
226 micro_benchmark_controller_(this), 226 micro_benchmark_controller_(this),
227 shared_bitmap_manager_(shared_bitmap_manager), 227 shared_bitmap_manager_(shared_bitmap_manager),
228 gpu_memory_buffer_manager_(gpu_memory_buffer_manager), 228 gpu_memory_buffer_manager_(gpu_memory_buffer_manager),
229 task_graph_runner_(task_graph_runner), 229 task_graph_runner_(task_graph_runner),
230 id_(id), 230 id_(id),
231 requires_high_res_to_draw_(false), 231 requires_high_res_to_draw_(false),
232 is_likely_to_require_a_draw_(false), 232 is_likely_to_require_a_draw_(false),
233 frame_timing_tracker_(FrameTimingTracker::Create()) { 233 frame_timing_tracker_(FrameTimingTracker::Create(this)) {
234 DCHECK(proxy_->IsImplThread()); 234 DCHECK(proxy_->IsImplThread());
235 DidVisibilityChange(this, visible_); 235 DidVisibilityChange(this, visible_);
236 animation_registrar_->set_supports_scroll_animations( 236 animation_registrar_->set_supports_scroll_animations(
237 proxy_->SupportsImplScrolling()); 237 proxy_->SupportsImplScrolling());
238 238
239 SetDebugState(settings.initial_debug_state); 239 SetDebugState(settings.initial_debug_state);
240 240
241 // LTHI always has an active tree. 241 // LTHI always has an active tree.
242 active_tree_ = 242 active_tree_ =
243 LayerTreeImpl::create(this, new SyncedProperty<ScaleGroup>(), 243 LayerTreeImpl::create(this, new SyncedProperty<ScaleGroup>(),
(...skipping 1919 matching lines...) Expand 10 before | Expand all | Expand 10 after
2163 active_tree_->GatherFrameTimingRequestIds(&request_ids); 2163 active_tree_->GatherFrameTimingRequestIds(&request_ids);
2164 if (request_ids.empty()) 2164 if (request_ids.empty())
2165 return; 2165 return;
2166 2166
2167 base::TimeTicks start_time = start_of_main_frame_args.frame_time; 2167 base::TimeTicks start_time = start_of_main_frame_args.frame_time;
2168 base::TimeTicks end_time = expected_next_main_frame_args.frame_time; 2168 base::TimeTicks end_time = expected_next_main_frame_args.frame_time;
2169 frame_timing_tracker_->SaveMainFrameTimeStamps( 2169 frame_timing_tracker_->SaveMainFrameTimeStamps(
2170 request_ids, start_time, end_time, active_tree_->source_frame_number()); 2170 request_ids, start_time, end_time, active_tree_->source_frame_number());
2171 } 2171 }
2172 2172
2173 void LayerTreeHostImpl::PostFrameTimingEvents(
2174 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events,
2175 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events) {
2176 client_->PostFrameTimingEventsOnImplThread(composite_events.Pass(),
2177 main_frame_events.Pass());
2178 }
2179
2173 void LayerTreeHostImpl::DestroyTileManager() { 2180 void LayerTreeHostImpl::DestroyTileManager() {
2174 tile_manager_ = nullptr; 2181 tile_manager_ = nullptr;
2175 resource_pool_ = nullptr; 2182 resource_pool_ = nullptr;
2176 staging_resource_pool_ = nullptr; 2183 staging_resource_pool_ = nullptr;
2177 tile_task_worker_pool_ = nullptr; 2184 tile_task_worker_pool_ = nullptr;
2178 single_thread_synchronous_task_graph_runner_ = nullptr; 2185 single_thread_synchronous_task_graph_runner_ = nullptr;
2179 } 2186 }
2180 2187
2181 bool LayerTreeHostImpl::IsSynchronousSingleThreaded() const { 2188 bool LayerTreeHostImpl::IsSynchronousSingleThreaded() const {
2182 return !proxy_->HasImplThread() && !settings_.single_thread_proxy_scheduler; 2189 return !proxy_->HasImplThread() && !settings_.single_thread_proxy_scheduler;
(...skipping 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after
3440 new_target.SetToMin(layer_impl->MaxScrollOffset()); 3447 new_target.SetToMin(layer_impl->MaxScrollOffset());
3441 3448
3442 curve->UpdateTarget( 3449 curve->UpdateTarget(
3443 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) 3450 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time)
3444 .InSecondsF(), 3451 .InSecondsF(),
3445 new_target); 3452 new_target);
3446 3453
3447 return true; 3454 return true;
3448 } 3455 }
3449 } // namespace cc 3456 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698