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

Unified Diff: cc/test/fake_external_begin_frame_source.cc

Issue 1887243002: cc: Remove retro frames from scheduler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/test/fake_external_begin_frame_source.cc
diff --git a/cc/test/fake_external_begin_frame_source.cc b/cc/test/fake_external_begin_frame_source.cc
index fee842b25604166fa94a9aceaa35c46cf62dda67..a1ef1f2a6da1de6a7099fe17484adada5a6b995f 100644
--- a/cc/test/fake_external_begin_frame_source.cc
+++ b/cc/test/fake_external_begin_frame_source.cc
@@ -22,6 +22,18 @@ FakeExternalBeginFrameSource::~FakeExternalBeginFrameSource() {
DCHECK(CalledOnValidThread());
}
+void FakeExternalBeginFrameSource::DidFinishFrame(BeginFrameObserver* obs) {
+ DCHECK(CalledOnValidThread());
+ // Send a MISSED begin frame if necessary.
+ if (missed_begin_frame_args_.IsValid()) {
+ BeginFrameArgs last_args = obs->LastUsedBeginFrameArgs();
+ if (!last_args.IsValid() ||
+ (missed_begin_frame_args_.frame_time > last_args.frame_time)) {
+ obs->OnBeginFrame(missed_begin_frame_args_);
+ }
+ }
+}
+
void FakeExternalBeginFrameSource::OnNeedsBeginFramesChanged(
bool needs_begin_frames) {
DCHECK(CalledOnValidThread());
@@ -34,7 +46,10 @@ void FakeExternalBeginFrameSource::OnNeedsBeginFramesChanged(
void FakeExternalBeginFrameSource::TestOnBeginFrame() {
DCHECK(CalledOnValidThread());
- CallOnBeginFrame(CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE));
+ BeginFrameArgs args = CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE);
+ missed_begin_frame_args_ = args;
+ missed_begin_frame_args_.type = BeginFrameArgs::MISSED;
+ CallOnBeginFrame(args);
PostTestOnBeginFrame();
}

Powered by Google App Engine
This is Rietveld 408576698