Index: cc/output/output_surface.cc |
diff --git a/cc/output/output_surface.cc b/cc/output/output_surface.cc |
index 15112f6dc042405ea652fe0427aa7df0fc93ec4e..ba02b4108293da865b8200f7c8a9861f16e44daf 100644 |
--- a/cc/output/output_surface.cc |
+++ b/cc/output/output_surface.cc |
@@ -177,8 +177,11 @@ void OutputSurface::BeginFrame(const BeginFrameArgs& args) { |
} |
} |
-base::TimeDelta OutputSurface::RetroactiveBeginFramePeriod() { |
- return BeginFrameArgs::DefaultRetroactiveBeginFramePeriod(); |
+base::TimeTicks OutputSurface::RetroactiveBeginFrameDeadline() { |
+ 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() { |
@@ -193,14 +196,8 @@ void OutputSurface::PostCheckForRetroactiveBeginFrame() { |
void OutputSurface::CheckForRetroactiveBeginFrame() { |
TRACE_EVENT0("cc", "OutputSurface::CheckForRetroactiveBeginFrame"); |
- base::TimeTicks now = base::TimeTicks::Now(); |
- base::TimeTicks alternative_deadline = |
- skipped_begin_frame_args_.frame_time + |
- RetroactiveBeginFramePeriod(); |
- if (now < skipped_begin_frame_args_.deadline || |
- now < alternative_deadline) { |
+ if (base::TimeTicks::Now() < RetroactiveBeginFrameDeadline()) |
BeginFrame(skipped_begin_frame_args_); |
- } |
} |
void OutputSurface::DidSwapBuffers() { |