| 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 14 matching lines...) Expand all Loading... |
| 25 public: | 25 public: |
| 26 FakeDisplaySchedulerClient() : draw_and_swap_count_(0) {} | 26 FakeDisplaySchedulerClient() : draw_and_swap_count_(0) {} |
| 27 | 27 |
| 28 ~FakeDisplaySchedulerClient() override {} | 28 ~FakeDisplaySchedulerClient() override {} |
| 29 | 29 |
| 30 bool DrawAndSwap() override { | 30 bool DrawAndSwap() override { |
| 31 draw_and_swap_count_++; | 31 draw_and_swap_count_++; |
| 32 return true; | 32 return true; |
| 33 } | 33 } |
| 34 | 34 |
| 35 SurfaceManager* GetSurfaceManager() const override { return nullptr; } |
| 36 |
| 35 void Reset() { draw_and_swap_count_ = 0; } | 37 void Reset() { draw_and_swap_count_ = 0; } |
| 36 | 38 |
| 37 int draw_and_swap_count() const { return draw_and_swap_count_; } | 39 int draw_and_swap_count() const { return draw_and_swap_count_; } |
| 38 | 40 |
| 39 protected: | 41 protected: |
| 40 int draw_and_swap_count_; | 42 int draw_and_swap_count_; |
| 41 }; | 43 }; |
| 42 | 44 |
| 43 class TestDisplayScheduler : public DisplayScheduler { | 45 class TestDisplayScheduler : public DisplayScheduler { |
| 44 public: | 46 public: |
| (...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 | 570 |
| 569 scheduler_.SetRootSurfaceResourcesLocked(true); | 571 scheduler_.SetRootSurfaceResourcesLocked(true); |
| 570 EXPECT_EQ(++count, scheduler_.scheduler_begin_frame_deadline_count()); | 572 EXPECT_EQ(++count, scheduler_.scheduler_begin_frame_deadline_count()); |
| 571 | 573 |
| 572 scheduler_.OutputSurfaceLost(); | 574 scheduler_.OutputSurfaceLost(); |
| 573 EXPECT_EQ(++count, scheduler_.scheduler_begin_frame_deadline_count()); | 575 EXPECT_EQ(++count, scheduler_.scheduler_begin_frame_deadline_count()); |
| 574 } | 576 } |
| 575 | 577 |
| 576 } // namespace | 578 } // namespace |
| 577 } // namespace cc | 579 } // namespace cc |
| OLD | NEW |