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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 884243004: cc: Record frame timing composite events in the tracker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index d89bad30481ac47b8f9aaf27ccbaa723e278c452..c9241a3d271256a6b33eeab0de844b582510d5ae 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -229,7 +229,8 @@ LayerTreeHostImpl::LayerTreeHostImpl(
gpu_memory_buffer_manager_(gpu_memory_buffer_manager),
id_(id),
requires_high_res_to_draw_(false),
- required_for_draw_tile_is_top_of_raster_queue_(false) {
+ required_for_draw_tile_is_top_of_raster_queue_(false),
+ frame_timing_tracker_(FrameTimingTracker::Create()) {
DCHECK(proxy_->IsImplThread());
DidVisibilityChange(this, visible_);
animation_registrar_->set_supports_scroll_animations(
@@ -801,6 +802,18 @@ DrawResult LayerTreeHostImpl::CalculateRenderPasses(
*it,
occlusion_tracker,
&append_quads_data);
+
+ // For layers that represent themselves, add composite frame timing
+ // requests if the visible rect intersects the requested rect.
+ const std::vector<FrameTimingRequest>& frame_timing_requests =
+ it->frame_timing_requests();
+ for (const auto& request : frame_timing_requests) {
danakj 2015/02/02 21:19:06 you could just : it->frame_timing_requests()) ? a
vmpstr 2015/02/02 22:32:05 Done.
+ if (request.rect().Intersects(it->visible_content_rect())) {
danakj 2015/02/02 21:19:06 you need to map this VCR to layer space
vmpstr 2015/02/02 22:32:05 Done.
+ current_composite_events_.push_back(
+ FrameTimingTracker::FrameAndRectIds(
+ active_tree_->source_frame_number(), request.id()));
+ }
+ }
}
++layers_drawn;
@@ -1049,6 +1062,7 @@ DrawResult LayerTreeHostImpl::PrepareToDraw(FrameData* frame) {
if (draw_result != DRAW_SUCCESS) {
DCHECK(!output_surface_->capabilities()
.draw_and_swap_full_viewport_every_frame);
+ current_composite_events_.clear();
danakj 2015/02/02 21:19:06 if you make this a member of the |frame| then you
vmpstr 2015/02/02 22:32:05 Done.
return draw_result;
}
@@ -1437,6 +1451,12 @@ void LayerTreeHostImpl::DrawLayers(FrameData* frame,
TRACE_EVENT0("cc", "LayerTreeHostImpl::DrawLayers");
DCHECK(CanDraw());
+ if (!current_composite_events_.empty()) {
+ frame_timing_tracker_->SaveTimeStamps(base::TimeTicks::Now(),
danakj 2015/02/02 21:19:06 should we use the frame time instead of now?
vmpstr 2015/02/02 22:32:05 Done. I think that works. According to the spec, w
+ current_composite_events_);
+ current_composite_events_.clear();
+ }
+
if (frame->has_no_damage) {
TRACE_EVENT_INSTANT0("cc", "EarlyOut_NoDamage", TRACE_EVENT_SCOPE_THREAD);
DCHECK(!output_surface_->capabilities()
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698