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

Unified Diff: cc/scheduler/frame_rate_controller.cc

Issue 15836005: cc: Emulate BeginFrame in OutputSurfaces that don't support it natively (Closed) Base URL: http://git.chromium.org/chromium/src.git@nofrc
Patch Set: Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: cc/scheduler/frame_rate_controller.cc
diff --git a/cc/scheduler/frame_rate_controller.cc b/cc/scheduler/frame_rate_controller.cc
index 4fcea235a5504da09ba9baaf28bf0055426189e5..78ace9f76d0f337bb894cf205c83a4079b2bd471 100644
--- a/cc/scheduler/frame_rate_controller.cc
+++ b/cc/scheduler/frame_rate_controller.cc
@@ -21,7 +21,9 @@ class FrameRateControllerTimeSourceAdapter : public TimeSourceClient {
}
virtual ~FrameRateControllerTimeSourceAdapter() {}
- virtual void OnTimerTick() OVERRIDE { frame_rate_controller_->OnTimerTick(); }
+ virtual void OnTimerTick() OVERRIDE {
+ frame_rate_controller_->OnTimerTick();
+ }
private:
explicit FrameRateControllerTimeSourceAdapter(
@@ -93,6 +95,7 @@ void FrameRateController::SetSwapBuffersCompleteSupported(bool supported) {
}
void FrameRateController::OnTimerTick() {
+ TRACE_EVENT0("cc", "FrameRateController::OnTimerTick");
DCHECK(active_);
// Check if we have too many frames in flight.
@@ -100,8 +103,9 @@ void FrameRateController::OnTimerTick() {
max_frames_pending_ && num_frames_pending_ >= max_frames_pending_;
TRACE_COUNTER_ID1("cc", "ThrottledCompositor", thread_, throttled);
- if (client_)
- client_->BeginFrame(throttled);
+ if (client_) {
+ client_->FrameRateControllerTick(throttled);
+ }
if (swap_buffers_complete_supported_ && !is_time_source_throttling_ &&
!throttled)
@@ -115,9 +119,11 @@ void FrameRateController::PostManualTick() {
}
}
-void FrameRateController::ManualTick() { OnTimerTick(); }
+void FrameRateController::ManualTick() {
+ OnTimerTick();
+}
-void FrameRateController::DidSwapBuffers() {
+void FrameRateController::WillSwapBuffers() {
brianderson 2013/06/01 04:30:29 This now corresponds to a BeginFrame rather than a
if (swap_buffers_complete_supported_)
num_frames_pending_++;
else if (!is_time_source_throttling_)

Powered by Google App Engine
This is Rietveld 408576698