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

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

Issue 1137823002: Pass collected frame timing events to Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Send finishTime as well for Render events. Created 5 years, 7 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/thread_proxy.h" 5 #include "cc/trees/thread_proxy.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 703
704 if (!impl().layer_tree_host_impl->settings().impl_side_painting) { 704 if (!impl().layer_tree_host_impl->settings().impl_side_painting) {
705 DCHECK_GT(impl().layer_tree_host_impl->memory_allocation_limit_bytes(), 0u); 705 DCHECK_GT(impl().layer_tree_host_impl->memory_allocation_limit_bytes(), 0u);
706 } 706 }
707 begin_main_frame_state->memory_allocation_limit_bytes = 707 begin_main_frame_state->memory_allocation_limit_bytes =
708 impl().layer_tree_host_impl->memory_allocation_limit_bytes(); 708 impl().layer_tree_host_impl->memory_allocation_limit_bytes();
709 begin_main_frame_state->memory_allocation_priority_cutoff = 709 begin_main_frame_state->memory_allocation_priority_cutoff =
710 impl().layer_tree_host_impl->memory_allocation_priority_cutoff(); 710 impl().layer_tree_host_impl->memory_allocation_priority_cutoff();
711 begin_main_frame_state->evicted_ui_resources = 711 begin_main_frame_state->evicted_ui_resources =
712 impl().layer_tree_host_impl->EvictedUIResourcesExist(); 712 impl().layer_tree_host_impl->EvictedUIResourcesExist();
713 begin_main_frame_state->frame_composite_counts =
714 impl()
715 .layer_tree_host_impl->frame_timing_tracker()
716 ->GroupCompositeCountsByRectId();
717 begin_main_frame_state->frame_render_counts =
718 impl()
719 .layer_tree_host_impl->frame_timing_tracker()
720 ->GroupMainFrameCountsByRectId();
713 // TODO(vmpstr): This needs to be fixed if 721 // TODO(vmpstr): This needs to be fixed if
714 // main_frame_before_activation_enabled is set, since we might run this code 722 // main_frame_before_activation_enabled is set, since we might run this code
715 // twice before recording a duration. crbug.com/469824 723 // twice before recording a duration. crbug.com/469824
716 impl().last_begin_main_frame_args = begin_main_frame_state->begin_frame_args; 724 impl().last_begin_main_frame_args = begin_main_frame_state->begin_frame_args;
717 Proxy::MainThreadTaskRunner()->PostTask( 725 Proxy::MainThreadTaskRunner()->PostTask(
718 FROM_HERE, 726 FROM_HERE,
719 base::Bind(&ThreadProxy::BeginMainFrame, 727 base::Bind(&ThreadProxy::BeginMainFrame,
720 main_thread_weak_ptr_, 728 main_thread_weak_ptr_,
721 base::Passed(&begin_main_frame_state))); 729 base::Passed(&begin_main_frame_state)));
722 devtools_instrumentation::DidRequestMainThreadFrame( 730 devtools_instrumentation::DidRequestMainThreadFrame(
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 // requests to be scheduled. 792 // requests to be scheduled.
785 // On the other hand, the animate_requested flag should remain cleared 793 // On the other hand, the animate_requested flag should remain cleared
786 // here so that any animation requests generated by the apply or animate 794 // here so that any animation requests generated by the apply or animate
787 // callbacks will trigger another frame. 795 // callbacks will trigger another frame.
788 main().commit_requested = true; 796 main().commit_requested = true;
789 main().commit_request_sent_to_impl_thread = true; 797 main().commit_request_sent_to_impl_thread = true;
790 798
791 layer_tree_host()->ApplyScrollAndScale( 799 layer_tree_host()->ApplyScrollAndScale(
792 begin_main_frame_state->scroll_info.get()); 800 begin_main_frame_state->scroll_info.get());
793 801
802 layer_tree_host()->RecordCompositeTimings(
803 begin_main_frame_state->frame_composite_counts.get());
vmpstr 2015/05/12 23:48:25 Should we be passing ownership here instead? It's
MikeB 2015/05/21 21:53:08 That's how ApplyScrollAndScale does it, and that's
804
805 layer_tree_host()->RecordRenderTimings(
806 begin_main_frame_state->frame_render_counts.get());
807
794 layer_tree_host()->WillBeginMainFrame(); 808 layer_tree_host()->WillBeginMainFrame();
795 809
796 layer_tree_host()->BeginMainFrame(begin_main_frame_state->begin_frame_args); 810 layer_tree_host()->BeginMainFrame(begin_main_frame_state->begin_frame_args);
797 layer_tree_host()->AnimateLayers( 811 layer_tree_host()->AnimateLayers(
798 begin_main_frame_state->begin_frame_args.frame_time); 812 begin_main_frame_state->begin_frame_args.frame_time);
799 813
800 // Unlink any backings that the impl thread has evicted, so that we know to 814 // Unlink any backings that the impl thread has evicted, so that we know to
801 // re-paint them in UpdateLayers. 815 // re-paint them in UpdateLayers.
802 if (blocked_main().contents_texture_manager()) { 816 if (blocked_main().contents_texture_manager()) {
803 blocked_main().contents_texture_manager()->UnlinkAndClearEvictedBackings(); 817 blocked_main().contents_texture_manager()->UnlinkAndClearEvictedBackings();
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
1407 FROM_HERE, base::Bind(&ThreadProxy::DidCompletePageScaleAnimation, 1421 FROM_HERE, base::Bind(&ThreadProxy::DidCompletePageScaleAnimation,
1408 main_thread_weak_ptr_)); 1422 main_thread_weak_ptr_));
1409 } 1423 }
1410 1424
1411 void ThreadProxy::OnDrawForOutputSurface() { 1425 void ThreadProxy::OnDrawForOutputSurface() {
1412 DCHECK(IsImplThread()); 1426 DCHECK(IsImplThread());
1413 impl().scheduler->OnDrawForOutputSurface(); 1427 impl().scheduler->OnDrawForOutputSurface();
1414 } 1428 }
1415 1429
1416 } // namespace cc 1430 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698