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

Side by Side Diff: cc/scheduler/scheduler.cc

Issue 595973002: Moving background animation ticking from LayerTreeHostImpl into the Scheduler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scheduler-timesource-refactor
Patch Set: Small fixes. Created 6 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/animation/layer_animation_controller.cc ('k') | cc/scheduler/scheduler_settings.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/scheduler/scheduler.h" 5 #include "cc/scheduler/scheduler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include "base/auto_reset.h" 8 #include "base/auto_reset.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/debug/trace_event_argument.h" 10 #include "base/debug/trace_event_argument.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 BeginFrameSource* 56 BeginFrameSource*
57 SchedulerFrameSourcesConstructor::ConstructBackgroundFrameSource( 57 SchedulerFrameSourcesConstructor::ConstructBackgroundFrameSource(
58 Scheduler* scheduler) { 58 Scheduler* scheduler) {
59 TRACE_EVENT1("cc", 59 TRACE_EVENT1("cc",
60 "Scheduler::Scheduler()", 60 "Scheduler::Scheduler()",
61 "BackgroundFrameSource", 61 "BackgroundFrameSource",
62 "SyntheticBeginFrameSource"); 62 "SyntheticBeginFrameSource");
63 DCHECK(!(scheduler->background_frame_source_internal_)); 63 DCHECK(!(scheduler->background_frame_source_internal_));
64 scheduler->background_frame_source_internal_ = 64 scheduler->background_frame_source_internal_ =
65 SyntheticBeginFrameSource::Create(scheduler->task_runner_.get(), 65 SyntheticBeginFrameSource::Create(
66 scheduler->Now(), 66 scheduler->task_runner_.get(), scheduler->Now(),
67 base::TimeDelta::FromSeconds(1)); 67 scheduler->settings_.background_frame_interval);
68 return scheduler->background_frame_source_internal_.get(); 68 return scheduler->background_frame_source_internal_.get();
69 } 69 }
70 70
71 Scheduler::Scheduler( 71 Scheduler::Scheduler(
72 SchedulerClient* client, 72 SchedulerClient* client,
73 const SchedulerSettings& scheduler_settings, 73 const SchedulerSettings& scheduler_settings,
74 int layer_tree_host_id, 74 int layer_tree_host_id,
75 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, 75 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
76 base::PowerMonitor* power_monitor, 76 base::PowerMonitor* power_monitor,
77 SchedulerFrameSourcesConstructor* frame_sources_constructor) 77 SchedulerFrameSourcesConstructor* frame_sources_constructor)
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 } 772 }
773 773
774 bool Scheduler::IsBeginMainFrameSentOrStarted() const { 774 bool Scheduler::IsBeginMainFrameSentOrStarted() const {
775 return (state_machine_.commit_state() == 775 return (state_machine_.commit_state() ==
776 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || 776 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT ||
777 state_machine_.commit_state() == 777 state_machine_.commit_state() ==
778 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); 778 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED);
779 } 779 }
780 780
781 } // namespace cc 781 } // namespace cc
OLDNEW
« no previous file with comments | « cc/animation/layer_animation_controller.cc ('k') | cc/scheduler/scheduler_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698