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

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: 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 398ef81895ae08bc199b823c30c9bd27861a3c29..c8ee69cb1d4fde156896fd4eb6c6d93e123f7780 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),
- is_likely_to_require_a_draw_(false) {
+ is_likely_to_require_a_draw_(false),
+ frame_timing_tracker_(FrameTimingTracker::Create()) {
DCHECK(proxy_->IsImplThread());
DidVisibilityChange(this, visible_);
animation_registrar_->set_supports_scroll_animations(
@@ -813,6 +814,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.
+ for (const auto& request : it->frame_timing_requests()) {
+ const gfx::Rect& request_content_rect =
+ it->LayerRectToContentRect(request.rect());
+ if (request_content_rect.Intersects(it->visible_content_rect())) {
+ frame->composite_events.push_back(
+ FrameTimingTracker::FrameAndRectIds(
+ active_tree_->source_frame_number(), request.id()));
+ }
+ }
}
++layers_drawn;
@@ -1438,6 +1451,11 @@ void LayerTreeHostImpl::DrawLayers(FrameData* frame,
TRACE_EVENT0("cc", "LayerTreeHostImpl::DrawLayers");
DCHECK(CanDraw());
+ if (!frame->composite_events.empty()) {
+ frame_timing_tracker_->SaveTimeStamps(frame_begin_time,
+ frame->composite_events);
+ }
+
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