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

Unified Diff: cc/output/output_surface.cc

Issue 16871016: cc: Use BeginFrameArgs (Closed) Base URL: http://git.chromium.org/chromium/src.git@bfargs2
Patch Set: Fixed all existing tests! New tests pending... Created 7 years, 5 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/output/output_surface.cc
diff --git a/cc/output/output_surface.cc b/cc/output/output_surface.cc
index 201f67cb63adcc269f0ba82c2e687b0307022414..0696df6c62dddbfcd112045775f0785158946803 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>
@@ -217,8 +218,11 @@ void OutputSurface::BeginFrame(const BeginFrameArgs& args) {
}
}
-base::TimeDelta OutputSurface::RetroactiveBeginFramePeriod() {
- return BeginFrameArgs::DefaultRetroactiveBeginFramePeriod();
+base::TimeTicks OutputSurface::RetroactiveBeginFrameDeadline() {
brianderson 2013/07/18 02:02:49 Using this RetroactiveBeginFrameDeadline instead o
+ 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() {
@@ -236,14 +240,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();
- 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() {

Powered by Google App Engine
This is Rietveld 408576698