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

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

Issue 2778223005: Plumb activation time to main (Closed)
Patch Set: review comment Created 3 years, 8 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
« no previous file with comments | « cc/trees/proxy_main.cc ('k') | content/browser/compositor/gpu_vsync_begin_frame_source.cc » ('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/single_thread_proxy.h" 5 #include "cc/trees/single_thread_proxy.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/profiler/scoped_tracker.h" 9 #include "base/profiler/scoped_tracker.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 TRACE_EVENT1("cc", "SingleThreadProxy::OnCanDrawStateChanged", "can_draw", 312 TRACE_EVENT1("cc", "SingleThreadProxy::OnCanDrawStateChanged", "can_draw",
313 can_draw); 313 can_draw);
314 DCHECK(task_runner_provider_->IsImplThread()); 314 DCHECK(task_runner_provider_->IsImplThread());
315 if (scheduler_on_impl_thread_) 315 if (scheduler_on_impl_thread_)
316 scheduler_on_impl_thread_->SetCanDraw(can_draw); 316 scheduler_on_impl_thread_->SetCanDraw(can_draw);
317 } 317 }
318 318
319 void SingleThreadProxy::NotifyReadyToActivate() { 319 void SingleThreadProxy::NotifyReadyToActivate() {
320 TRACE_EVENT0("cc", "SingleThreadProxy::NotifyReadyToActivate"); 320 TRACE_EVENT0("cc", "SingleThreadProxy::NotifyReadyToActivate");
321 DebugScopedSetImplThread impl(task_runner_provider_); 321 DebugScopedSetImplThread impl(task_runner_provider_);
322 if (scheduler_on_impl_thread_) 322 if (scheduler_on_impl_thread_) {
323 scheduler_on_impl_thread_->NotifyReadyToActivate(); 323 // The argument to NotifyReadyToActivate is the pending-tree for computing
324 // Activation time in ProxyImpl. However this is not applicable here.
325 scheduler_on_impl_thread_->NotifyReadyToActivate(-1);
326 }
324 } 327 }
325 328
326 void SingleThreadProxy::NotifyReadyToDraw() { 329 void SingleThreadProxy::NotifyReadyToDraw() {
327 TRACE_EVENT0("cc", "SingleThreadProxy::NotifyReadyToDraw"); 330 TRACE_EVENT0("cc", "SingleThreadProxy::NotifyReadyToDraw");
328 DebugScopedSetImplThread impl(task_runner_provider_); 331 DebugScopedSetImplThread impl(task_runner_provider_);
329 if (scheduler_on_impl_thread_) 332 if (scheduler_on_impl_thread_)
330 scheduler_on_impl_thread_->NotifyReadyToDraw(); 333 scheduler_on_impl_thread_->NotifyReadyToDraw();
331 } 334 }
332 335
333 void SingleThreadProxy::SetNeedsRedrawOnImplThread() { 336 void SingleThreadProxy::SetNeedsRedrawOnImplThread() {
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 if (compositor_frame_sink_lost_) { 452 if (compositor_frame_sink_lost_) {
450 RequestNewCompositorFrameSink(); 453 RequestNewCompositorFrameSink();
451 // RequestNewCompositorFrameSink could have synchronously created an output 454 // RequestNewCompositorFrameSink could have synchronously created an output
452 // surface, so check again before returning. 455 // surface, so check again before returning.
453 if (compositor_frame_sink_lost_) 456 if (compositor_frame_sink_lost_)
454 return; 457 return;
455 } 458 }
456 459
457 BeginFrameArgs begin_frame_args(BeginFrameArgs::Create( 460 BeginFrameArgs begin_frame_args(BeginFrameArgs::Create(
458 BEGINFRAME_FROM_HERE, BeginFrameArgs::kManualSourceId, 1, 461 BEGINFRAME_FROM_HERE, BeginFrameArgs::kManualSourceId, 1,
459 frame_begin_time, base::TimeTicks(), BeginFrameArgs::DefaultInterval(), 462 BeginFrameArgs::kDefaultSourceFrameNumber, frame_begin_time,
463 base::TimeTicks(), BeginFrameArgs::DefaultInterval(),
460 BeginFrameArgs::NORMAL)); 464 BeginFrameArgs::NORMAL));
461 465
462 // Start the impl frame. 466 // Start the impl frame.
463 { 467 {
464 DebugScopedSetImplThread impl(task_runner_provider_); 468 DebugScopedSetImplThread impl(task_runner_provider_);
465 WillBeginImplFrame(begin_frame_args); 469 WillBeginImplFrame(begin_frame_args);
466 } 470 }
467 471
468 // Run the "main thread" and get it to commit. 472 // Run the "main thread" and get it to commit.
469 { 473 {
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 void SingleThreadProxy::DidFinishImplFrame() { 792 void SingleThreadProxy::DidFinishImplFrame() {
789 layer_tree_host_impl_->DidFinishImplFrame(); 793 layer_tree_host_impl_->DidFinishImplFrame();
790 #if DCHECK_IS_ON() 794 #if DCHECK_IS_ON()
791 DCHECK(inside_impl_frame_) 795 DCHECK(inside_impl_frame_)
792 << "DidFinishImplFrame called while not inside an impl frame!"; 796 << "DidFinishImplFrame called while not inside an impl frame!";
793 inside_impl_frame_ = false; 797 inside_impl_frame_ = false;
794 #endif 798 #endif
795 } 799 }
796 800
797 } // namespace cc 801 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/proxy_main.cc ('k') | content/browser/compositor/gpu_vsync_begin_frame_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698