Lines Matching full:scheduler
4 #include "cc/scheduler/scheduler.h"
34 void InitializeOutputSurfaceAndFirstCommit(Scheduler* scheduler) {
35 scheduler->DidCreateAndInitializeOutputSurface();
36 scheduler->SetNeedsCommit();
37 scheduler->FinishCommit();
39 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
40 scheduler->OnBeginImplFrameDeadline();
41 // We need another BeginImplFrame so Scheduler calls
43 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
44 scheduler->OnBeginImplFrameDeadline();
63 Scheduler* CreateScheduler(const SchedulerSettings& settings) {
64 scheduler_ = Scheduler::Create(this, settings, 0);
188 scoped_ptr<Scheduler> scheduler_;
194 Scheduler* scheduler = client.CreateScheduler(default_scheduler_settings);
195 scheduler->SetCanStart();
196 scheduler->SetVisible(true);
197 scheduler->SetCanDraw(true);
201 scheduler->DidCreateAndInitializeOutputSurface();
209 Scheduler* scheduler = client.CreateScheduler(scheduler_settings);
210 scheduler->SetCanStart();
211 scheduler->SetVisible(true);
212 scheduler->SetCanDraw(true);
215 InitializeOutputSurfaceAndFirstCommit(scheduler);
219 scheduler->SetNeedsCommit();
230 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
242 scheduler->OnBeginImplFrameDeadline();
248 scheduler->FinishCommit();
254 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
260 scheduler->OnBeginImplFrameDeadline();
268 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
272 scheduler->OnBeginImplFrameDeadline();
293 Scheduler* scheduler = client.CreateScheduler(scheduler_settings);
294 scheduler->SetCanStart();
295 scheduler->SetVisible(true);
296 scheduler->SetCanDraw(true);
299 InitializeOutputSurfaceAndFirstCommit(scheduler);
303 scheduler->SetNeedsCommit();
313 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
326 scheduler->SetNeedsCommit();
331 scheduler->FinishCommit();
335 scheduler->OnBeginImplFrameDeadline();
345 // Because we just swapped, the Scheduler should also request the next
352 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
364 scheduler->FinishCommit();
368 scheduler->OnBeginImplFrameDeadline();
376 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
377 scheduler->OnBeginImplFrameDeadline();
397 Scheduler* scheduler = client.CreateScheduler(scheduler_settings);
398 scheduler->SetCanStart();
399 scheduler->SetVisible(true);
400 scheduler->SetCanDraw(true);
403 InitializeOutputSurfaceAndFirstCommit(scheduler);
405 scheduler->SetNeedsRedraw();
406 EXPECT_TRUE(scheduler->RedrawPending());
411 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
414 scheduler->OnBeginImplFrameDeadline();
417 EXPECT_FALSE(scheduler->RedrawPending());
421 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
424 scheduler->OnBeginImplFrameDeadline();
426 EXPECT_FALSE(scheduler->RedrawPending());
430 scheduler->SetMainThreadNeedsLayerTextures();
436 scheduler->SetNeedsRedraw();
437 EXPECT_TRUE(scheduler->RedrawPending());
443 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
446 scheduler->OnBeginImplFrameDeadline();
448 EXPECT_TRUE(scheduler->RedrawPending());
452 scheduler->SetNeedsCommit();
460 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
470 scheduler->FinishCommit();
473 EXPECT_TRUE(scheduler->RedrawPending());
477 scheduler->OnBeginImplFrameDeadline();
480 EXPECT_FALSE(scheduler->RedrawPending());
485 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
488 scheduler->OnBeginImplFrameDeadline();
507 Scheduler* scheduler = client.CreateScheduler(scheduler_settings);
508 scheduler->SetCanStart();
509 scheduler->SetVisible(true);
510 scheduler->SetCanDraw(true);
513 InitializeOutputSurfaceAndFirstCommit(scheduler);
516 scheduler->SetNeedsCommit();
525 scheduler->SetMainThreadNeedsLayerTextures();
530 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
539 scheduler->OnBeginImplFrameDeadline();
548 scheduler->FinishCommit();
554 scheduler->SetMainThreadNeedsLayerTextures();
559 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
563 scheduler->OnBeginImplFrameDeadline();
573 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
576 scheduler->OnBeginImplFrameDeadline();
583 scheduler->SetNeedsCommit();
593 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
603 scheduler->FinishCommit();
610 scheduler->OnBeginImplFrameDeadline();
631 Scheduler* scheduler = client.CreateScheduler(scheduler_settings);
632 scheduler->SetCanStart();
633 scheduler->SetVisible(true);
634 scheduler->SetCanDraw(true);
638 scheduler->DidCreateAndInitializeOutputSurface();
640 scheduler->SetNeedsCommit();
642 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
643 scheduler->OnBeginImplFrameDeadline();
645 scheduler->FinishCommit();
646 scheduler->SetMainThreadNeedsLayerTextures();
647 scheduler->SetNeedsCommit();
651 scheduler->SetVisible(false);
656 scheduler->SetVisible(true);
664 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
704 // 1. the scheduler dropping SetNeedsRedraw requests that happen inside
706 // 2. the scheduler drawing twice inside a single tick
710 Scheduler* scheduler = client.CreateScheduler(default_scheduler_settings);
711 scheduler->SetCanStart();
712 scheduler->SetVisible(true);
713 scheduler->SetCanDraw(true);
714 InitializeOutputSurfaceAndFirstCommit(scheduler);
717 scheduler->SetNeedsRedraw();
718 EXPECT_TRUE(scheduler->RedrawPending());
722 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
723 scheduler->OnBeginImplFrameDeadline();
725 EXPECT_TRUE(scheduler->RedrawPending());
728 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
729 scheduler->OnBeginImplFrameDeadline();
731 EXPECT_FALSE(scheduler->RedrawPending());
736 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
737 scheduler->OnBeginImplFrameDeadline();
739 EXPECT_FALSE(scheduler->RedrawPending());
747 Scheduler* scheduler = client.CreateScheduler(default_scheduler_settings);
748 scheduler->SetCanStart();
749 scheduler->SetVisible(true);
750 scheduler->SetCanDraw(true);
751 InitializeOutputSurfaceAndFirstCommit(scheduler);
756 scheduler->SetNeedsRedraw();
757 EXPECT_TRUE(scheduler->RedrawPending());
762 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
763 scheduler->OnBeginImplFrameDeadline();
768 EXPECT_TRUE(scheduler->CommitPending());
769 EXPECT_TRUE(scheduler->RedrawPending());
773 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
774 scheduler->OnBeginImplFrameDeadline();
776 EXPECT_TRUE(scheduler->CommitPending());
777 EXPECT_TRUE(scheduler->RedrawPending());
782 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
783 scheduler->OnBeginImplFrameDeadline();
785 EXPECT_TRUE(scheduler->CommitPending());
786 EXPECT_FALSE(scheduler->RedrawPending());
824 // Tests for the scheduler infinite-looping on SetNeedsCommit requests that
829 Scheduler* scheduler = client.CreateScheduler(default_scheduler_settings);
830 scheduler->SetCanStart();
831 scheduler->SetVisible(true);
832 scheduler->SetCanDraw(true);
833 InitializeOutputSurfaceAndFirstCommit(scheduler);
837 scheduler->SetNeedsRedraw();
838 EXPECT_TRUE(scheduler->RedrawPending());
843 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
845 scheduler->OnBeginImplFrameDeadline();
847 EXPECT_TRUE(scheduler->CommitPending());
849 scheduler->FinishCommit();
851 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
852 scheduler->OnBeginImplFrameDeadline();
855 EXPECT_FALSE(scheduler->RedrawPending());
856 EXPECT_FALSE(scheduler->CommitPending());
861 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
862 scheduler->OnBeginImplFrameDeadline();
864 EXPECT_FALSE(scheduler->RedrawPending());
865 EXPECT_FALSE(scheduler->CommitPending());
873 Scheduler* scheduler = client.CreateScheduler(default_scheduler_settings);
874 scheduler->SetCanStart();
875 scheduler->SetVisible(true);
876 scheduler->SetCanDraw(true);
877 InitializeOutputSurfaceAndFirstCommit(scheduler);
882 scheduler->SetNeedsRedraw();
883 EXPECT_TRUE(scheduler->RedrawPending());
888 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
889 scheduler->OnBeginImplFrameDeadline();
894 EXPECT_TRUE(scheduler->CommitPending());
895 EXPECT_TRUE(scheduler->RedrawPending());
899 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
900 scheduler->OnBeginImplFrameDeadline();
902 EXPECT_TRUE(scheduler->CommitPending());
903 EXPECT_TRUE(scheduler->RedrawPending());
908 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
909 scheduler->OnBeginImplFrameDeadline();
911 EXPECT_TRUE(scheduler->CommitPending());
912 EXPECT_FALSE(scheduler->RedrawPending());
919 Scheduler* scheduler = client.CreateScheduler(default_scheduler_settings);
920 scheduler->SetCanStart();
921 scheduler->SetVisible(true);
922 scheduler->SetCanDraw(true);
923 InitializeOutputSurfaceAndFirstCommit(scheduler);
926 scheduler->SetNeedsRedraw();
927 EXPECT_TRUE(scheduler->RedrawPending());
933 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
934 scheduler->OnBeginImplFrameDeadline();
937 scheduler->SetNeedsRedraw();
938 EXPECT_TRUE(scheduler->RedrawPending());
944 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
945 scheduler->OnBeginImplFrameDeadline();
952 Scheduler* scheduler = client.CreateScheduler(default_scheduler_settings);
959 scheduler->SetCanDraw(true);
960 scheduler->SetNeedsRedraw();
961 scheduler->SetNeedsForcedCommitForReadback();
962 scheduler->FinishCommit();
971 Scheduler* scheduler = client.CreateScheduler(default_scheduler_settings);
975 scheduler->SetCanDraw(true);
976 scheduler->SetNeedsRedraw();
977 scheduler->SetNeedsForcedCommitForReadback();
978 scheduler->FinishCommit();
982 scheduler->SetNeedsForcedCommitForReadback();
983 scheduler->FinishCommit();
988 scheduler->FinishCommit();
1005 Scheduler* scheduler = client.CreateScheduler(default_scheduler_settings);
1006 scheduler->SetCanStart();
1007 scheduler->SetVisible(true);
1008 scheduler->SetCanDraw(true);
1009 InitializeOutputSurfaceAndFirstCommit(scheduler);
1014 scheduler->SetNeedsManageTiles();
1015 scheduler->SetNeedsRedraw();
1016 EXPECT_TRUE(scheduler->RedrawPending());
1017 EXPECT_TRUE(scheduler->ManageTilesPending());
1026 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
1031 scheduler->OnBeginImplFrameDeadline();
1037 EXPECT_FALSE(scheduler->RedrawPending());
1038 EXPECT_FALSE(scheduler->ManageTilesPending());
1042 scheduler->SetNeedsRedraw();
1043 EXPECT_TRUE(scheduler->RedrawPending());
1044 EXPECT_FALSE(scheduler->ManageTilesPending());
1051 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
1058 scheduler->OnBeginImplFrameDeadline();
1064 EXPECT_FALSE(scheduler->RedrawPending());
1065 EXPECT_FALSE(scheduler->ManageTilesPending());
1069 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
1072 scheduler->OnBeginImplFrameDeadline();
1080 scheduler->SetNeedsManageTiles();
1082 EXPECT_TRUE(scheduler->ManageTilesPending());
1083 EXPECT_FALSE(scheduler->RedrawPending());
1087 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
1090 scheduler->OnBeginImplFrameDeadline();
1101 Scheduler* scheduler = client.CreateScheduler(default_scheduler_settings);
1102 scheduler->SetCanStart();
1103 scheduler->SetVisible(true);
1104 scheduler->SetCanDraw(true);
1105 InitializeOutputSurfaceAndFirstCommit(scheduler);
1108 scheduler->SetNeedsManageTiles();
1109 scheduler->SetNeedsRedraw();
1111 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
1114 EXPECT_TRUE(scheduler->ManageTilesPending());
1115 scheduler->DidManageTiles();
1116 EXPECT_FALSE(scheduler->ManageTilesPending());
1119 scheduler->OnBeginImplFrameDeadline();
1123 EXPECT_FALSE(scheduler->RedrawPending());
1124 EXPECT_FALSE(scheduler->ManageTilesPending());
1127 scheduler->SetNeedsManageTiles();
1128 scheduler->SetNeedsRedraw();
1130 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
1134 scheduler->OnBeginImplFrameDeadline();
1140 EXPECT_FALSE(scheduler->RedrawPending());
1141 EXPECT_FALSE(scheduler->ManageTilesPending());
1183 Scheduler* scheduler = client.CreateScheduler(scheduler_settings);
1184 scheduler->SetCanStart();
1185 scheduler->SetVisible(true);
1186 scheduler->SetCanDraw(true);
1187 InitializeOutputSurfaceAndFirstCommit(scheduler);
1191 scheduler->SetNeedsCommit();
1192 EXPECT_FALSE(scheduler->MainThreadIsInHighLatencyMode());
1193 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
1194 EXPECT_FALSE(scheduler->MainThreadIsInHighLatencyMode());
1195 scheduler->OnBeginImplFrameDeadline();
1196 EXPECT_TRUE(scheduler->MainThreadIsInHighLatencyMode());
1197 scheduler->FinishCommit();
1198 EXPECT_TRUE(scheduler->MainThreadIsInHighLatencyMode());
1202 scheduler->SetNeedsCommit();
1203 EXPECT_TRUE(scheduler->MainThreadIsInHighLatencyMode());
1204 scheduler->BeginImplFrame(BeginFrameArgs::CreateForTesting());
1205 EXPECT_TRUE(scheduler->MainThreadIsInHighLatencyMode());
1206 scheduler->OnBeginImplFrameDeadline();
1207 EXPECT_EQ(scheduler->MainThreadIsInHighLatencyMode(),
1246 Scheduler* scheduler = client.CreateScheduler(settings);
1248 scheduler->SetCanDraw(true);
1249 scheduler->SetCanStart();
1250 scheduler->SetVisible(true);
1251 scheduler->DidCreateAndInitializeOutputSurface();
1253 scheduler->SetNeedsCommit();
1254 EXPECT_TRUE(scheduler->CommitPending());
1255 scheduler->FinishCommit();
1256 scheduler->SetNeedsRedraw();
1260 scheduler->BeginImplFrame(impl_frame_args);
1261 scheduler->OnBeginImplFrameDeadline();
1265 EXPECT_FALSE(scheduler->CommitPending());
1266 scheduler->SetNeedsCommit();
1267 EXPECT_TRUE(scheduler->CommitPending());
1276 // Scheduler::advance_commit_state_timer_'s rate.