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

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

Issue 397443002: [not for review] Add Draw entries to window Performance Timeline Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git pull of third_party/WebKit Created 6 years, 5 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"
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/debug/trace_event.h" 12 #include "base/debug/trace_event.h"
13 #include "base/debug/trace_event_synthetic_delay.h" 13 #include "base/debug/trace_event_synthetic_delay.h"
14 #include "cc/base/swap_promise.h" 14 #include "cc/base/swap_promise.h"
15 #include "cc/debug/benchmark_instrumentation.h" 15 #include "cc/debug/benchmark_instrumentation.h"
16 #include "cc/debug/devtools_instrumentation.h" 16 #include "cc/debug/devtools_instrumentation.h"
17 #include "cc/debug/performance_draw_timing_counter.h"
17 #include "cc/input/input_handler.h" 18 #include "cc/input/input_handler.h"
18 #include "cc/output/context_provider.h" 19 #include "cc/output/context_provider.h"
19 #include "cc/output/output_surface.h" 20 #include "cc/output/output_surface.h"
20 #include "cc/quads/draw_quad.h" 21 #include "cc/quads/draw_quad.h"
21 #include "cc/resources/prioritized_resource_manager.h" 22 #include "cc/resources/prioritized_resource_manager.h"
22 #include "cc/scheduler/delay_based_time_source.h" 23 #include "cc/scheduler/delay_based_time_source.h"
23 #include "cc/scheduler/scheduler.h" 24 #include "cc/scheduler/scheduler.h"
24 #include "cc/trees/blocking_task_runner.h" 25 #include "cc/trees/blocking_task_runner.h"
25 #include "cc/trees/layer_tree_host.h" 26 #include "cc/trees/layer_tree_host.h"
26 #include "cc/trees/layer_tree_impl.h" 27 #include "cc/trees/layer_tree_impl.h"
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 714
714 if (!impl().layer_tree_host_impl->settings().impl_side_painting) { 715 if (!impl().layer_tree_host_impl->settings().impl_side_painting) {
715 DCHECK_GT(impl().layer_tree_host_impl->memory_allocation_limit_bytes(), 0u); 716 DCHECK_GT(impl().layer_tree_host_impl->memory_allocation_limit_bytes(), 0u);
716 } 717 }
717 begin_main_frame_state->memory_allocation_limit_bytes = 718 begin_main_frame_state->memory_allocation_limit_bytes =
718 impl().layer_tree_host_impl->memory_allocation_limit_bytes(); 719 impl().layer_tree_host_impl->memory_allocation_limit_bytes();
719 begin_main_frame_state->memory_allocation_priority_cutoff = 720 begin_main_frame_state->memory_allocation_priority_cutoff =
720 impl().layer_tree_host_impl->memory_allocation_priority_cutoff(); 721 impl().layer_tree_host_impl->memory_allocation_priority_cutoff();
721 begin_main_frame_state->evicted_ui_resources = 722 begin_main_frame_state->evicted_ui_resources =
722 impl().layer_tree_host_impl->EvictedUIResourcesExist(); 723 impl().layer_tree_host_impl->EvictedUIResourcesExist();
724 begin_main_frame_state->draw_info =
725 impl().layer_tree_host_impl->draw_counter()->getDrawTimingCounts();
726 impl().layer_tree_host_impl->draw_counter()->clearEvents();
727
723 Proxy::MainThreadTaskRunner()->PostTask( 728 Proxy::MainThreadTaskRunner()->PostTask(
724 FROM_HERE, 729 FROM_HERE,
725 base::Bind(&ThreadProxy::BeginMainFrame, 730 base::Bind(&ThreadProxy::BeginMainFrame,
726 main_thread_weak_ptr_, 731 main_thread_weak_ptr_,
727 base::Passed(&begin_main_frame_state))); 732 base::Passed(&begin_main_frame_state)));
728 devtools_instrumentation::DidRequestMainThreadFrame( 733 devtools_instrumentation::DidRequestMainThreadFrame(
729 impl().layer_tree_host_id); 734 impl().layer_tree_host_id);
730 impl().timing_history.DidBeginMainFrame(); 735 impl().timing_history.DidBeginMainFrame();
731 } 736 }
732 737
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 // the paint, main().commit_requested will be set to false to allow new commit 789 // the paint, main().commit_requested will be set to false to allow new commit
785 // requests to be scheduled. 790 // requests to be scheduled.
786 // On the other hand, the animate_requested flag should remain cleared 791 // On the other hand, the animate_requested flag should remain cleared
787 // here so that any animation requests generated by the apply or animate 792 // here so that any animation requests generated by the apply or animate
788 // callbacks will trigger another frame. 793 // callbacks will trigger another frame.
789 main().commit_requested = true; 794 main().commit_requested = true;
790 main().commit_request_sent_to_impl_thread = true; 795 main().commit_request_sent_to_impl_thread = true;
791 796
792 layer_tree_host()->ApplyScrollAndScale(*begin_main_frame_state->scroll_info); 797 layer_tree_host()->ApplyScrollAndScale(*begin_main_frame_state->scroll_info);
793 798
799 layer_tree_host()->RecordDrawTiming(*begin_main_frame_state->draw_info);
800
794 layer_tree_host()->WillBeginMainFrame(); 801 layer_tree_host()->WillBeginMainFrame();
795 802
796 layer_tree_host()->UpdateClientAnimations( 803 layer_tree_host()->UpdateClientAnimations(
797 begin_main_frame_state->monotonic_frame_begin_time); 804 begin_main_frame_state->monotonic_frame_begin_time);
798 layer_tree_host()->AnimateLayers( 805 layer_tree_host()->AnimateLayers(
799 begin_main_frame_state->monotonic_frame_begin_time); 806 begin_main_frame_state->monotonic_frame_begin_time);
800 blocked_main().last_monotonic_frame_begin_time = 807 blocked_main().last_monotonic_frame_begin_time =
801 begin_main_frame_state->monotonic_frame_begin_time; 808 begin_main_frame_state->monotonic_frame_begin_time;
802 809
803 // Unlink any backings that the impl thread has evicted, so that we know to 810 // Unlink any backings that the impl thread has evicted, so that we know to
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
1436 1443
1437 impl().timing_history.DidActivateSyncTree(); 1444 impl().timing_history.DidActivateSyncTree();
1438 } 1445 }
1439 1446
1440 void ThreadProxy::DidManageTiles() { 1447 void ThreadProxy::DidManageTiles() {
1441 DCHECK(IsImplThread()); 1448 DCHECK(IsImplThread());
1442 impl().scheduler->DidManageTiles(); 1449 impl().scheduler->DidManageTiles();
1443 } 1450 }
1444 1451
1445 } // namespace cc 1452 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698