| 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 #ifndef COMPONENTS_MUS_WS_WINDOW_TREE_HOST_IMPL_H_ | 5 #ifndef COMPONENTS_MUS_WS_WINDOW_TREE_HOST_IMPL_H_ |
| 6 #define COMPONENTS_MUS_WS_WINDOW_TREE_HOST_IMPL_H_ | 6 #define COMPONENTS_MUS_WS_WINDOW_TREE_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <queue> | 10 #include <queue> |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 ConnectionManager* connection_manager, | 49 ConnectionManager* connection_manager, |
| 50 mojo::ApplicationImpl* app_impl, | 50 mojo::ApplicationImpl* app_impl, |
| 51 const scoped_refptr<GpuState>& gpu_state, | 51 const scoped_refptr<GpuState>& gpu_state, |
| 52 const scoped_refptr<SurfacesState>& surfaces_state, | 52 const scoped_refptr<SurfacesState>& surfaces_state, |
| 53 mojom::WindowManagerPtr window_manater); | 53 mojom::WindowManagerPtr window_manater); |
| 54 ~WindowTreeHostImpl() override; | 54 ~WindowTreeHostImpl() override; |
| 55 | 55 |
| 56 // Initializes state that depends on the existence of a WindowTreeHostImpl. | 56 // Initializes state that depends on the existence of a WindowTreeHostImpl. |
| 57 void Init(WindowTreeHostDelegate* delegate); | 57 void Init(WindowTreeHostDelegate* delegate); |
| 58 | 58 |
| 59 uint32_t id() const { return id_; } | |
| 60 | |
| 61 const WindowTreeImpl* GetWindowTree() const; | 59 const WindowTreeImpl* GetWindowTree() const; |
| 62 WindowTreeImpl* GetWindowTree(); | 60 WindowTreeImpl* GetWindowTree(); |
| 63 | 61 |
| 64 mojom::WindowTreeHostClient* client() const { return client_.get(); } | 62 mojom::WindowTreeHostClient* client() const { return client_.get(); } |
| 65 | 63 |
| 66 // Returns whether |window| is a descendant of this root but not itself a | 64 // Returns whether |window| is a descendant of this root but not itself a |
| 67 // root window. | 65 // root window. |
| 68 bool IsWindowAttachedToRoot(const ServerWindow* window) const; | 66 bool IsWindowAttachedToRoot(const ServerWindow* window) const; |
| 69 | 67 |
| 70 // Schedules a paint for the specified region in the coordinates of |window| | 68 // Schedules a paint for the specified region in the coordinates of |window| |
| 71 // if | 69 // if |
| 72 // the |window| is in this viewport. Returns whether |window| is in the | 70 // the |window| is in this viewport. Returns whether |window| is in the |
| 73 // viewport. | 71 // viewport. |
| 74 bool SchedulePaintIfInViewport(const ServerWindow* window, | 72 bool SchedulePaintIfInViewport(const ServerWindow* window, |
| 75 const gfx::Rect& bounds); | 73 const gfx::Rect& bounds); |
| 76 | 74 |
| 77 // Schedules destruction of surfaces in |window|. If a frame has been | 75 // Schedules destruction of surfaces in |window|. If a frame has been |
| 78 // scheduled but not drawn surface destruction is delayed until the frame is | 76 // scheduled but not drawn surface destruction is delayed until the frame is |
| 79 // drawn, otherwise destruction is immediate. | 77 // drawn, otherwise destruction is immediate. |
| 80 void ScheduleSurfaceDestruction(ServerWindow* window); | 78 void ScheduleSurfaceDestruction(ServerWindow* window); |
| 81 | 79 |
| 82 // Returns the metrics for this viewport. | 80 // Returns the metrics for this viewport. |
| 83 const mojom::ViewportMetrics& GetViewportMetrics() const; | 81 const mojom::ViewportMetrics& GetViewportMetrics() const; |
| 84 | 82 |
| 85 mojom::Rotation GetRotation() const; | |
| 86 | |
| 87 ConnectionManager* connection_manager() { return connection_manager_; } | 83 ConnectionManager* connection_manager() { return connection_manager_; } |
| 88 | 84 |
| 89 mojom::WindowManager* window_manager() { return window_manager_.get(); } | 85 mojom::WindowManager* window_manager() { return window_manager_.get(); } |
| 90 | 86 |
| 91 // Returns the root ServerWindow of this viewport. | 87 // Returns the root ServerWindow of this viewport. |
| 92 ServerWindow* root_window() { return root_.get(); } | 88 ServerWindow* root_window() { return root_.get(); } |
| 93 const ServerWindow* root_window() const { return root_.get(); } | 89 const ServerWindow* root_window() const { return root_.get(); } |
| 94 | 90 |
| 95 void SetFocusedWindow(ServerWindow* window); | 91 void SetFocusedWindow(ServerWindow* window); |
| 96 ServerWindow* GetFocusedWindow(); | 92 ServerWindow* GetFocusedWindow(); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 | 215 |
| 220 std::set<WindowId> activation_parents_; | 216 std::set<WindowId> activation_parents_; |
| 221 | 217 |
| 222 // Set of windows with surfaces that need to be destroyed once the frame | 218 // Set of windows with surfaces that need to be destroyed once the frame |
| 223 // draws. | 219 // draws. |
| 224 std::set<ServerWindow*> windows_needing_frame_destruction_; | 220 std::set<ServerWindow*> windows_needing_frame_destruction_; |
| 225 | 221 |
| 226 std::queue<scoped_ptr<QueuedEvent>> event_queue_; | 222 std::queue<scoped_ptr<QueuedEvent>> event_queue_; |
| 227 base::OneShotTimer event_ack_timer_; | 223 base::OneShotTimer event_ack_timer_; |
| 228 | 224 |
| 229 const uint32_t id_; | |
| 230 | |
| 231 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostImpl); | 225 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostImpl); |
| 232 }; | 226 }; |
| 233 | 227 |
| 234 } // namespace ws | 228 } // namespace ws |
| 235 } // namespace mus | 229 } // namespace mus |
| 236 | 230 |
| 237 #endif // COMPONENTS_MUS_WS_WINDOW_TREE_HOST_IMPL_H_ | 231 #endif // COMPONENTS_MUS_WS_WINDOW_TREE_HOST_IMPL_H_ |
| OLD | NEW |