| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/surfaces/display_scheduler.h" | 5 #include "cc/surfaces/display_scheduler.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/test/null_task_runner.h" | 8 #include "base/test/null_task_runner.h" |
| 9 #include "base/test/simple_test_tick_clock.h" | 9 #include "base/test/simple_test_tick_clock.h" |
| 10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 EXPECT_EQ(late_deadline, scheduler_->DesiredBeginFrameDeadlineTimeForTest()); | 379 EXPECT_EQ(late_deadline, scheduler_->DesiredBeginFrameDeadlineTimeForTest()); |
| 380 | 380 |
| 381 // Don't draw and swap in deadline while swap throttled. | 381 // Don't draw and swap in deadline while swap throttled. |
| 382 EXPECT_EQ(3, client_->draw_and_swap_count()); | 382 EXPECT_EQ(3, client_->draw_and_swap_count()); |
| 383 scheduler_->BeginFrameDeadlineForTest(); | 383 scheduler_->BeginFrameDeadlineForTest(); |
| 384 EXPECT_EQ(3, client_->draw_and_swap_count()); | 384 EXPECT_EQ(3, client_->draw_and_swap_count()); |
| 385 | 385 |
| 386 // Deadline triggers normally once not swap throttled. | 386 // Deadline triggers normally once not swap throttled. |
| 387 // Damage from previous BeginFrame should cary over, so don't damage again. | 387 // Damage from previous BeginFrame should cary over, so don't damage again. |
| 388 base::TimeTicks expected_deadline = | 388 base::TimeTicks expected_deadline = |
| 389 scheduler_->LastUsedBeginFrameArgs().deadline - | 389 scheduler_->LastUsedBeginFrameArgs().deadline; |
| 390 BeginFrameArgs::DefaultEstimatedParentDrawTime(); | |
| 391 scheduler_->DidSwapBuffersComplete(); | 390 scheduler_->DidSwapBuffersComplete(); |
| 392 BeginFrameForTest(); | 391 BeginFrameForTest(); |
| 393 EXPECT_EQ(expected_deadline, | 392 EXPECT_EQ(expected_deadline, |
| 394 scheduler_->DesiredBeginFrameDeadlineTimeForTest()); | 393 scheduler_->DesiredBeginFrameDeadlineTimeForTest()); |
| 395 // Still waiting for surface 2. Once it updates, deadline should trigger | 394 // Still waiting for surface 2. Once it updates, deadline should trigger |
| 396 // immediately again. | 395 // immediately again. |
| 397 scheduler_->SurfaceDamaged(sid2); | 396 scheduler_->SurfaceDamaged(sid2); |
| 398 EXPECT_EQ(scheduler_->DesiredBeginFrameDeadlineTimeForTest(), | 397 EXPECT_EQ(scheduler_->DesiredBeginFrameDeadlineTimeForTest(), |
| 399 base::TimeTicks()); | 398 base::TimeTicks()); |
| 400 // Draw and swap now that we aren't throttled. | 399 // Draw and swap now that we aren't throttled. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 | 436 |
| 438 scheduler_->SetRootSurfaceResourcesLocked(true); | 437 scheduler_->SetRootSurfaceResourcesLocked(true); |
| 439 EXPECT_EQ(count++, scheduler_->scheduler_begin_frame_deadline_count()); | 438 EXPECT_EQ(count++, scheduler_->scheduler_begin_frame_deadline_count()); |
| 440 | 439 |
| 441 scheduler_->OutputSurfaceLost(); | 440 scheduler_->OutputSurfaceLost(); |
| 442 EXPECT_EQ(count++, scheduler_->scheduler_begin_frame_deadline_count()); | 441 EXPECT_EQ(count++, scheduler_->scheduler_begin_frame_deadline_count()); |
| 443 } | 442 } |
| 444 | 443 |
| 445 } // namespace | 444 } // namespace |
| 446 } // namespace cc | 445 } // namespace cc |
| OLD | NEW |