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

Side by Side Diff: cc/test/fake_surface_observer.h

Issue 2854163003: [cc] Plumb BeginFrameAcks through SurfaceManager to DisplayScheduler. (Closed)
Patch Set: fix clang compile error 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
« no previous file with comments | « cc/surfaces/surface_synchronization_unittest.cc ('k') | cc/test/fake_surface_observer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CC_TEST_FAKE_SURFACE_OBSERVER_H_
6 #define CC_TEST_FAKE_SURFACE_OBSERVER_H_
7
8 #include "base/containers/flat_set.h"
9 #include "cc/output/begin_frame_args.h"
10 #include "cc/surfaces/surface_id.h"
11 #include "cc/surfaces/surface_info.h"
12 #include "cc/surfaces/surface_observer.h"
13
14 namespace cc {
15
16 class FakeSurfaceObserver : public SurfaceObserver {
17 public:
18 // If |damage_display| is true, the observer will indicate display damage when
19 // a surface is damaged.
20 explicit FakeSurfaceObserver(bool damage_display = true);
21 virtual ~FakeSurfaceObserver();
22
23 const BeginFrameAck& last_ack() const { return last_ack_; }
24
25 bool IsSurfaceDamaged(const SurfaceId& surface_id) const;
26
27 const SurfaceId& last_created_surface_id() const {
28 return last_created_surface_id_;
29 }
30
31 const SurfaceInfo& last_surface_info() const { return last_surface_info_; }
32
33 void Reset();
34
35 private:
36 // SurfaceObserver implementation:
37 void OnSurfaceDamaged(const SurfaceId& surface_id,
38 const BeginFrameAck& ack,
39 bool* changed) override;
40 void OnSurfaceCreated(const SurfaceInfo& surface_info) override;
41 void OnSurfaceDiscarded(const SurfaceId& surface_id) override {}
42 void OnSurfaceDestroyed(const SurfaceId& surface_id) override {}
43 void OnSurfaceDamageExpected(const SurfaceId& surface_id,
44 const BeginFrameArgs& args) override {}
45
46 bool damage_display_;
47 BeginFrameAck last_ack_;
48 base::flat_set<SurfaceId> damaged_surfaces_;
49 SurfaceId last_created_surface_id_;
50 SurfaceInfo last_surface_info_;
51 };
52
53 } // namespace cc
54
55 #endif // CC_TEST_FAKE_SURFACE_OBSERVER_H_
OLDNEW
« no previous file with comments | « cc/surfaces/surface_synchronization_unittest.cc ('k') | cc/test/fake_surface_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698