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

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

Issue 14772021: cc::OutputSurfaceClient::InitializeForGL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win compile by including ContextProvider from output_surface_client.h Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « cc/scheduler/frame_rate_controller.h ('k') | cc/scheduler/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/scheduler/frame_rate_controller.h" 5 #include "cc/scheduler/frame_rate_controller.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "cc/base/thread.h" 9 #include "cc/base/thread.h"
10 #include "cc/scheduler/delay_based_time_source.h" 10 #include "cc/scheduler/delay_based_time_source.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 DCHECK_GE(max_frames_pending, 0); 81 DCHECK_GE(max_frames_pending, 0);
82 max_frames_pending_ = max_frames_pending; 82 max_frames_pending_ = max_frames_pending;
83 } 83 }
84 84
85 void FrameRateController::SetTimebaseAndInterval(base::TimeTicks timebase, 85 void FrameRateController::SetTimebaseAndInterval(base::TimeTicks timebase,
86 base::TimeDelta interval) { 86 base::TimeDelta interval) {
87 if (is_time_source_throttling_) 87 if (is_time_source_throttling_)
88 time_source_->SetTimebaseAndInterval(timebase, interval); 88 time_source_->SetTimebaseAndInterval(timebase, interval);
89 } 89 }
90 90
91 bool FrameRateController::swap_buffers_complete_supported() const {
92 return swap_buffers_complete_supported_;
93 }
94
91 void FrameRateController::SetSwapBuffersCompleteSupported(bool supported) { 95 void FrameRateController::SetSwapBuffersCompleteSupported(bool supported) {
92 swap_buffers_complete_supported_ = supported; 96 swap_buffers_complete_supported_ = supported;
93 } 97 }
94 98
95 void FrameRateController::OnTimerTick() { 99 void FrameRateController::OnTimerTick() {
96 DCHECK(active_); 100 DCHECK(active_);
97 101
98 // Check if we have too many frames in flight. 102 // Check if we have too many frames in flight.
99 bool throttled = 103 bool throttled =
100 max_frames_pending_ && num_frames_pending_ >= max_frames_pending_; 104 max_frames_pending_ && num_frames_pending_ >= max_frames_pending_;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 } 149 }
146 150
147 base::TimeTicks FrameRateController::LastTickTime() { 151 base::TimeTicks FrameRateController::LastTickTime() {
148 if (is_time_source_throttling_) 152 if (is_time_source_throttling_)
149 return time_source_->LastTickTime(); 153 return time_source_->LastTickTime();
150 154
151 return base::TimeTicks::Now(); 155 return base::TimeTicks::Now();
152 } 156 }
153 157
154 } // namespace cc 158 } // namespace cc
OLDNEW
« no previous file with comments | « cc/scheduler/frame_rate_controller.h ('k') | cc/scheduler/scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698