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

Side by Side Diff: cc/surfaces/display_scheduler_unittest.cc

Issue 2854163003: [cc] Plumb BeginFrameAcks through SurfaceManager to DisplayScheduler. (Closed)
Patch Set: Track state per surface. Created 3 years, 7 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
OLDNEW
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
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 const SurfaceAggregator::SurfaceIndexMap& GetPreviousContainedSurfaces()
36 override {
37 return previous_contained_surfaces_;
38 }
39
35 void Reset() { draw_and_swap_count_ = 0; } 40 void Reset() { draw_and_swap_count_ = 0; }
36 41
37 int draw_and_swap_count() const { return draw_and_swap_count_; } 42 int draw_and_swap_count() const { return draw_and_swap_count_; }
38 43
39 protected: 44 protected:
40 int draw_and_swap_count_; 45 int draw_and_swap_count_;
46 SurfaceAggregator::SurfaceIndexMap previous_contained_surfaces_;
41 }; 47 };
42 48
43 class TestDisplayScheduler : public DisplayScheduler { 49 class TestDisplayScheduler : public DisplayScheduler {
44 public: 50 public:
45 TestDisplayScheduler(BeginFrameSource* begin_frame_source, 51 TestDisplayScheduler(BeginFrameSource* begin_frame_source,
46 base::SingleThreadTaskRunner* task_runner, 52 base::SingleThreadTaskRunner* task_runner,
47 int max_pending_swaps) 53 int max_pending_swaps)
48 : DisplayScheduler(task_runner, max_pending_swaps), 54 : DisplayScheduler(task_runner, max_pending_swaps),
49 scheduler_begin_frame_deadline_count_(0) { 55 scheduler_begin_frame_deadline_count_(0) {
50 SetBeginFrameSource(begin_frame_source); 56 SetBeginFrameSource(begin_frame_source);
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 596
591 scheduler_.SetRootSurfaceResourcesLocked(true); 597 scheduler_.SetRootSurfaceResourcesLocked(true);
592 EXPECT_EQ(++count, scheduler_.scheduler_begin_frame_deadline_count()); 598 EXPECT_EQ(++count, scheduler_.scheduler_begin_frame_deadline_count());
593 599
594 scheduler_.OutputSurfaceLost(); 600 scheduler_.OutputSurfaceLost();
595 EXPECT_EQ(++count, scheduler_.scheduler_begin_frame_deadline_count()); 601 EXPECT_EQ(++count, scheduler_.scheduler_begin_frame_deadline_count());
596 } 602 }
597 603
598 } // namespace 604 } // namespace
599 } // namespace cc 605 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698