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

Side by Side Diff: cc/scheduler/scheduler_unittest.cc

Issue 23767011: cc: Always use SetNeedsBeginFrame to request the next BeginFrame (Closed) Base URL: http://git.chromium.org/chromium/src.git@pollForDrawTriggers
Patch Set: Created 7 years, 3 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 unified diff | Download patch
« cc/scheduler/scheduler.cc ('K') | « cc/scheduler/scheduler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/scheduler/scheduler.h" 5 #include "cc/scheduler/scheduler.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 scheduler->SetNeedsCommit(); 227 scheduler->SetNeedsCommit();
228 228
229 // Finish the commit for the first frame. 229 // Finish the commit for the first frame.
230 scheduler->FinishCommit(); 230 scheduler->FinishCommit();
231 EXPECT_SINGLE_ACTION("ScheduledActionCommit", client); 231 EXPECT_SINGLE_ACTION("ScheduledActionCommit", client);
232 client.Reset(); 232 client.Reset();
233 233
234 // Tick should draw but then begin another frame for the second commit. 234 // Tick should draw but then begin another frame for the second commit.
235 scheduler->BeginFrame(BeginFrameArgs::CreateForTesting()); 235 scheduler->BeginFrame(BeginFrameArgs::CreateForTesting());
236 EXPECT_TRUE(client.needs_begin_frame()); 236 EXPECT_TRUE(client.needs_begin_frame());
237 EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client, 0, 2); 237 EXPECT_ACTION("ScheduledActionDrawAndSwapIfPossible", client, 0, 3);
238 EXPECT_ACTION("ScheduledActionSendBeginFrameToMainThread", client, 1, 2); 238 EXPECT_ACTION("ScheduledActionSendBeginFrameToMainThread", client, 1, 3);
239 EXPECT_ACTION("SetNeedsBeginFrameOnImplThread", client, 2, 3);
danakj 2013/09/12 20:57:29 Can you update the comment here to explain the new
239 client.Reset(); 240 client.Reset();
240 241
241 // Finish the second commit to go back to quiescent state and verify we no 242 // Finish the second commit to go back to quiescent state and verify we no
242 // longer request BeginFrames. 243 // longer request BeginFrames.
243 scheduler->FinishCommit(); 244 scheduler->FinishCommit();
244 scheduler->BeginFrame(BeginFrameArgs::CreateForTesting()); 245 scheduler->BeginFrame(BeginFrameArgs::CreateForTesting());
245 EXPECT_FALSE(client.needs_begin_frame()); 246 EXPECT_FALSE(client.needs_begin_frame());
246 } 247 }
247 248
248 TEST(SchedulerTest, TextureAcquisitionCausesCommitInsteadOfDraw) { 249 TEST(SchedulerTest, TextureAcquisitionCausesCommitInsteadOfDraw) {
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 scheduler->FinishCommit(); 683 scheduler->FinishCommit();
683 EXPECT_TRUE(client.HasAction("ScheduledActionDrawAndReadback")); 684 EXPECT_TRUE(client.HasAction("ScheduledActionDrawAndReadback"));
684 685
685 // The replacement commit comes in after 2 readbacks. 686 // The replacement commit comes in after 2 readbacks.
686 client.Reset(); 687 client.Reset();
687 scheduler->FinishCommit(); 688 scheduler->FinishCommit();
688 } 689 }
689 690
690 } // namespace 691 } // namespace
691 } // namespace cc 692 } // namespace cc
OLDNEW
« cc/scheduler/scheduler.cc ('K') | « cc/scheduler/scheduler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698