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

Side by Side Diff: services/ui/ws/display.h

Issue 2189893004: Unify display ids between Display and PlatformDisplay. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move id into PlatformDisplay and fix tests. Created 4 years, 4 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 | « no previous file | services/ui/ws/display.cc » ('j') | services/ui/ws/display.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef SERVICES_UI_WS_DISPLAY_H_ 5 #ifndef SERVICES_UI_WS_DISPLAY_H_
6 #define SERVICES_UI_WS_DISPLAY_H_ 6 #define SERVICES_UI_WS_DISPLAY_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 public UserIdTrackerObserver, 59 public UserIdTrackerObserver,
60 public WindowManagerWindowTreeFactorySetObserver { 60 public WindowManagerWindowTreeFactorySetObserver {
61 public: 61 public:
62 Display(WindowServer* window_server, 62 Display(WindowServer* window_server,
63 const PlatformDisplayInitParams& platform_display_init_params); 63 const PlatformDisplayInitParams& platform_display_init_params);
64 ~Display() override; 64 ~Display() override;
65 65
66 // Initializes state that depends on the existence of a Display. 66 // Initializes state that depends on the existence of a Display.
67 void Init(std::unique_ptr<DisplayBinding> binding); 67 void Init(std::unique_ptr<DisplayBinding> binding);
68 68
69 uint32_t id() const { return id_; } 69 int64_t GetId() const;
70 70
71 DisplayManager* display_manager(); 71 DisplayManager* display_manager();
72 const DisplayManager* display_manager() const; 72 const DisplayManager* display_manager() const;
73 73
74 PlatformDisplay* platform_display() { return platform_display_.get(); } 74 PlatformDisplay* platform_display() { return platform_display_.get(); }
75 75
76 // Returns a mojom::WsDisplay for the specified display. WindowManager 76 // Returns a mojom::WsDisplay for the specified display. WindowManager
77 // specific values are not set. 77 // specific values are not set.
78 mojom::WsDisplayPtr ToWsDisplay() const; 78 mojom::WsDisplayPtr ToWsDisplay() const;
79 79
80 // Returns a display::Display for the specficied display. 80 // Returns a display::Display for the specficied display.
81 ::display::Display ToDisplay() const; 81 ::display::Display ToDisplay() const;
82 82
83 // Schedules a paint for the specified region in the coordinates of |window|. 83 // Schedules a paint for the specified region in the coordinates of |window|.
84 void SchedulePaint(const ServerWindow* window, const gfx::Rect& bounds); 84 void SchedulePaint(const ServerWindow* window, const gfx::Rect& bounds);
85 85
86 // Schedules destruction of surfaces in |window|. If a frame has been 86 // Schedules destruction of surfaces in |window|. If a frame has been
87 // scheduled but not drawn surface destruction is delayed until the frame is 87 // scheduled but not drawn surface destruction is delayed until the frame is
88 // drawn, otherwise destruction is immediate. 88 // drawn, otherwise destruction is immediate.
89 void ScheduleSurfaceDestruction(ServerWindow* window); 89 void ScheduleSurfaceDestruction(ServerWindow* window);
90 90
91 ::display::Display::Rotation GetRotation() const; 91 ::display::Display::Rotation GetRotation() const;
92 gfx::Size GetSize() const; 92 gfx::Size GetSize() const;
93 93
94 // Returns the id for the corresponding id.
95 int64_t GetPlatformDisplayId() const;
96
97 WindowServer* window_server() { return window_server_; } 94 WindowServer* window_server() { return window_server_; }
98 95
99 // Returns the root of the Display. The root's children are the roots 96 // Returns the root of the Display. The root's children are the roots
100 // of the corresponding WindowManagers. 97 // of the corresponding WindowManagers.
101 ServerWindow* root_window() { return root_.get(); } 98 ServerWindow* root_window() { return root_.get(); }
102 const ServerWindow* root_window() const { return root_.get(); } 99 const ServerWindow* root_window() const { return root_.get(); }
103 100
104 // Returns the ServerWindow whose id is |id|. This does not do a search over 101 // Returns the ServerWindow whose id is |id|. This does not do a search over
105 // all windows, rather just the display and window manager root windows. 102 // all windows, rather just the display and window manager root windows.
106 // 103 //
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 // ServerWindowObserver: 190 // ServerWindowObserver:
194 void OnWindowDestroyed(ServerWindow* window) override; 191 void OnWindowDestroyed(ServerWindow* window) override;
195 192
196 // UserIdTrackerObserver: 193 // UserIdTrackerObserver:
197 void OnUserIdRemoved(const UserId& id) override; 194 void OnUserIdRemoved(const UserId& id) override;
198 195
199 // WindowManagerWindowTreeFactorySetObserver: 196 // WindowManagerWindowTreeFactorySetObserver:
200 void OnWindowManagerWindowTreeFactoryReady( 197 void OnWindowManagerWindowTreeFactoryReady(
201 WindowManagerWindowTreeFactory* factory) override; 198 WindowManagerWindowTreeFactory* factory) override;
202 199
203 const uint32_t id_;
204 std::unique_ptr<DisplayBinding> binding_; 200 std::unique_ptr<DisplayBinding> binding_;
205 // Set once Init() has been called. 201 // Set once Init() has been called.
206 bool init_called_ = false; 202 bool init_called_ = false;
207 WindowServer* const window_server_; 203 WindowServer* const window_server_;
208 std::unique_ptr<ServerWindow> root_; 204 std::unique_ptr<ServerWindow> root_;
209 std::unique_ptr<PlatformDisplay> platform_display_; 205 std::unique_ptr<PlatformDisplay> platform_display_;
210 std::unique_ptr<FocusController> focus_controller_; 206 std::unique_ptr<FocusController> focus_controller_;
211 207
212 // The last cursor set. Used to track whether we need to change the cursor. 208 // The last cursor set. Used to track whether we need to change the cursor.
213 int32_t last_cursor_; 209 int32_t last_cursor_;
214 210
215 ServerWindowTracker activation_parents_; 211 ServerWindowTracker activation_parents_;
216 212
217 // Set of windows with surfaces that need to be destroyed once the frame 213 // Set of windows with surfaces that need to be destroyed once the frame
218 // draws. 214 // draws.
219 std::set<ServerWindow*> windows_needing_frame_destruction_; 215 std::set<ServerWindow*> windows_needing_frame_destruction_;
220 216
221 WindowManagerDisplayRootMap window_manager_display_root_map_; 217 WindowManagerDisplayRootMap window_manager_display_root_map_;
222 218
223 DISALLOW_COPY_AND_ASSIGN(Display); 219 DISALLOW_COPY_AND_ASSIGN(Display);
224 }; 220 };
225 221
226 } // namespace ws 222 } // namespace ws
227 } // namespace ui 223 } // namespace ui
228 224
229 #endif // SERVICES_UI_WS_DISPLAY_H_ 225 #endif // SERVICES_UI_WS_DISPLAY_H_
OLDNEW
« no previous file with comments | « no previous file | services/ui/ws/display.cc » ('j') | services/ui/ws/display.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698