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

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

Issue 1415763008: cc: Remove ThreadProxy dependency on LTHI::CurrentBeginFrameArgs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@CompositorTimingHistory2
Patch Set: 80 chars Created 5 years, 1 month 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
« no previous file with comments | « cc/trees/thread_proxy.h ('k') | components/mus/surfaces/surfaces_scheduler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 } 327 }
328 328
329 void ThreadProxy::WillBeginImplFrame(const BeginFrameArgs& args) { 329 void ThreadProxy::WillBeginImplFrame(const BeginFrameArgs& args) {
330 impl().layer_tree_host_impl->WillBeginImplFrame(args); 330 impl().layer_tree_host_impl->WillBeginImplFrame(args);
331 if (impl().last_processed_begin_main_frame_args.IsValid()) { 331 if (impl().last_processed_begin_main_frame_args.IsValid()) {
332 // Last processed begin main frame args records the frame args that we sent 332 // Last processed begin main frame args records the frame args that we sent
333 // to the main thread for the last frame that we've processed. If that is 333 // to the main thread for the last frame that we've processed. If that is
334 // set, that means the current frame is one past the frame in which we've 334 // set, that means the current frame is one past the frame in which we've
335 // finished the processing. 335 // finished the processing.
336 impl().layer_tree_host_impl->RecordMainFrameTiming( 336 impl().layer_tree_host_impl->RecordMainFrameTiming(
337 impl().last_processed_begin_main_frame_args, 337 impl().last_processed_begin_main_frame_args, args);
338 impl().layer_tree_host_impl->CurrentBeginFrameArgs());
339 impl().last_processed_begin_main_frame_args = BeginFrameArgs(); 338 impl().last_processed_begin_main_frame_args = BeginFrameArgs();
340 } 339 }
341 } 340 }
342 341
343 void ThreadProxy::OnResourcelessSoftareDrawStateChanged( 342 void ThreadProxy::OnResourcelessSoftareDrawStateChanged(
344 bool resourceless_draw) { 343 bool resourceless_draw) {
345 DCHECK(IsImplThread()); 344 DCHECK(IsImplThread());
346 impl().scheduler->SetResourcelessSoftareDraw(resourceless_draw); 345 impl().scheduler->SetResourcelessSoftareDraw(resourceless_draw);
347 } 346 }
348 347
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 return true; 554 return true;
556 } 555 }
557 556
558 void ThreadProxy::FinishAllRenderingOnImpl(CompletionEvent* completion) { 557 void ThreadProxy::FinishAllRenderingOnImpl(CompletionEvent* completion) {
559 TRACE_EVENT0("cc", "ThreadProxy::FinishAllRenderingOnImplThread"); 558 TRACE_EVENT0("cc", "ThreadProxy::FinishAllRenderingOnImplThread");
560 DCHECK(IsImplThread()); 559 DCHECK(IsImplThread());
561 impl().layer_tree_host_impl->FinishAllRendering(); 560 impl().layer_tree_host_impl->FinishAllRendering();
562 completion->Signal(); 561 completion->Signal();
563 } 562 }
564 563
565 void ThreadProxy::ScheduledActionSendBeginMainFrame() { 564 void ThreadProxy::ScheduledActionSendBeginMainFrame(
565 const BeginFrameArgs& args) {
566 unsigned int begin_frame_id = nextBeginFrameId++; 566 unsigned int begin_frame_id = nextBeginFrameId++;
567 benchmark_instrumentation::ScopedBeginFrameTask begin_frame_task( 567 benchmark_instrumentation::ScopedBeginFrameTask begin_frame_task(
568 benchmark_instrumentation::kSendBeginFrame, begin_frame_id); 568 benchmark_instrumentation::kSendBeginFrame, begin_frame_id);
569 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state( 569 scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state(
570 new BeginMainFrameAndCommitState); 570 new BeginMainFrameAndCommitState);
571 begin_main_frame_state->begin_frame_id = begin_frame_id; 571 begin_main_frame_state->begin_frame_id = begin_frame_id;
572 begin_main_frame_state->begin_frame_args = 572 begin_main_frame_state->begin_frame_args = args;
573 impl().layer_tree_host_impl->CurrentBeginFrameArgs();
574 begin_main_frame_state->scroll_info = 573 begin_main_frame_state->scroll_info =
575 impl().layer_tree_host_impl->ProcessScrollDeltas(); 574 impl().layer_tree_host_impl->ProcessScrollDeltas();
576 begin_main_frame_state->memory_allocation_limit_bytes = 575 begin_main_frame_state->memory_allocation_limit_bytes =
577 impl().layer_tree_host_impl->memory_allocation_limit_bytes(); 576 impl().layer_tree_host_impl->memory_allocation_limit_bytes();
578 begin_main_frame_state->evicted_ui_resources = 577 begin_main_frame_state->evicted_ui_resources =
579 impl().layer_tree_host_impl->EvictedUIResourcesExist(); 578 impl().layer_tree_host_impl->EvictedUIResourcesExist();
580 // TODO(vmpstr): This needs to be fixed if 579 // TODO(vmpstr): This needs to be fixed if
581 // main_frame_before_activation_enabled is set, since we might run this code 580 // main_frame_before_activation_enabled is set, since we might run this code
582 // twice before recording a duration. crbug.com/469824 581 // twice before recording a duration. crbug.com/469824
583 impl().last_begin_main_frame_args = begin_main_frame_state->begin_frame_args; 582 impl().last_begin_main_frame_args = begin_main_frame_state->begin_frame_args;
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
1187 1186
1188 base::WeakPtr<ProxyMain> ThreadProxy::GetMainWeakPtr() { 1187 base::WeakPtr<ProxyMain> ThreadProxy::GetMainWeakPtr() {
1189 return main_thread_weak_ptr_; 1188 return main_thread_weak_ptr_;
1190 } 1189 }
1191 1190
1192 base::WeakPtr<ProxyImpl> ThreadProxy::GetImplWeakPtr() { 1191 base::WeakPtr<ProxyImpl> ThreadProxy::GetImplWeakPtr() {
1193 return impl_thread_weak_ptr_; 1192 return impl_thread_weak_ptr_;
1194 } 1193 }
1195 1194
1196 } // namespace cc 1195 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/thread_proxy.h ('k') | components/mus/surfaces/surfaces_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698