Chromium Code Reviews| Index: cc/output/output_surface.cc |
| diff --git a/cc/output/output_surface.cc b/cc/output/output_surface.cc |
| index 5d2c6bb6e9f5dbc1f8fd1d3787ff50ce3dbe02ce..2ab30f6437bdb315c0869fe352afa5a9ca7df149 100644 |
| --- a/cc/output/output_surface.cc |
| +++ b/cc/output/output_surface.cc |
| @@ -4,6 +4,7 @@ |
| #include "cc/output/output_surface.h" |
| +#include <algorithm> |
| #include <set> |
| #include <string> |
| #include <vector> |
| @@ -219,8 +220,13 @@ void OutputSurface::BeginFrame(const BeginFrameArgs& args) { |
| } |
| } |
| -base::TimeDelta OutputSurface::AlternateRetroactiveBeginFramePeriod() { |
| - return BeginFrameArgs::DefaultRetroactiveBeginFramePeriod(); |
| +base::TimeTicks OutputSurface::RetroactiveBeginFrameDeadline() { |
| + // TODO(brianderson): Remove the alternative deadline once we have better |
| + // deadline estimations. |
| + base::TimeTicks alternative_deadline = |
| + skipped_begin_frame_args_.frame_time + |
| + BeginFrameArgs::DefaultRetroactiveBeginFramePeriod(); |
| + return std::max(skipped_begin_frame_args_.deadline, alternative_deadline); |
| } |
| void OutputSurface::PostCheckForRetroactiveBeginFrame() { |
| @@ -238,16 +244,8 @@ void OutputSurface::PostCheckForRetroactiveBeginFrame() { |
| void OutputSurface::CheckForRetroactiveBeginFrame() { |
| TRACE_EVENT0("cc", "OutputSurface::CheckForRetroactiveBeginFrame"); |
| check_for_retroactive_begin_frame_pending_ = false; |
| - base::TimeTicks now = base::TimeTicks::Now(); |
| - // TODO(brianderson): Remove the alternative deadline once we have better |
| - // deadline estimations. |
| - base::TimeTicks alternative_deadline = |
| - skipped_begin_frame_args_.frame_time + |
| - AlternateRetroactiveBeginFramePeriod(); |
| - if (now < skipped_begin_frame_args_.deadline || |
| - now < alternative_deadline) { |
| + if (base::TimeTicks::Now() < RetroactiveBeginFrameDeadline()) |
| BeginFrame(skipped_begin_frame_args_); |
| - } |
| } |
| void OutputSurface::DidSwapBuffers() { |
| @@ -274,6 +272,8 @@ void OutputSurface::DidLoseOutputSurface() { |
| TRACE_EVENT0("cc", "OutputSurface::DidLoseOutputSurface"); |
| begin_frame_pending_ = false; |
| pending_swap_buffers_ = 0; |
| + if (frame_rate_controller_) |
|
danakj
2013/08/19 21:54:41
This seems like it could be a separate CL?
|
| + frame_rate_controller_->SetActive(false); |
| client_->DidLoseOutputSurface(); |
| } |