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

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

Issue 2449173003: Mus: Introduce DisplayCompositorClient mojo interface (Closed)
Patch Set: Added more comments Created 4 years, 1 month 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_WINDOW_SERVER_H_ 5 #ifndef SERVICES_UI_WS_WINDOW_SERVER_H_
6 #define SERVICES_UI_WS_WINDOW_SERVER_H_ 6 #define SERVICES_UI_WS_WINDOW_SERVER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
11 #include <memory> 11 #include <memory>
12 #include <string> 12 #include <string>
13 #include <vector> 13 #include <vector>
14 14
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "base/optional.h" 16 #include "base/optional.h"
17 #include "cc/ipc/display_compositor.mojom.h"
17 #include "mojo/public/cpp/bindings/array.h" 18 #include "mojo/public/cpp/bindings/array.h"
18 #include "mojo/public/cpp/bindings/binding.h" 19 #include "mojo/public/cpp/bindings/binding.h"
19 #include "services/ui/public/interfaces/window_manager_window_tree_factory.mojom .h" 20 #include "services/ui/public/interfaces/window_manager_window_tree_factory.mojom .h"
20 #include "services/ui/public/interfaces/window_tree.mojom.h" 21 #include "services/ui/public/interfaces/window_tree.mojom.h"
21 #include "services/ui/surfaces/display_compositor.h" 22 #include "services/ui/surfaces/display_compositor.h"
22 #include "services/ui/surfaces/display_compositor_client.h" 23 #include "services/ui/surfaces/display_compositor_client.h"
23 #include "services/ui/ws/display.h" 24 #include "services/ui/ws/display.h"
24 #include "services/ui/ws/gpu_service_proxy_delegate.h" 25 #include "services/ui/ws/gpu_service_proxy_delegate.h"
25 #include "services/ui/ws/ids.h" 26 #include "services/ui/ws/ids.h"
26 #include "services/ui/ws/operation.h" 27 #include "services/ui/ws/operation.h"
(...skipping 17 matching lines...) Expand all
44 class WindowTree; 45 class WindowTree;
45 class WindowTreeBinding; 46 class WindowTreeBinding;
46 47
47 // WindowServer manages the set of clients of the window server (all the 48 // WindowServer manages the set of clients of the window server (all the
48 // WindowTrees) as well as providing the root of the hierarchy. 49 // WindowTrees) as well as providing the root of the hierarchy.
49 class WindowServer : public ServerWindowDelegate, 50 class WindowServer : public ServerWindowDelegate,
50 public ServerWindowObserver, 51 public ServerWindowObserver,
51 public GpuServiceProxyDelegate, 52 public GpuServiceProxyDelegate,
52 public UserDisplayManagerDelegate, 53 public UserDisplayManagerDelegate,
53 public UserIdTrackerObserver, 54 public UserIdTrackerObserver,
54 public DisplayCompositorClient { 55 public cc::mojom::DisplayCompositorClient {
55 public: 56 public:
56 explicit WindowServer(WindowServerDelegate* delegate); 57 explicit WindowServer(WindowServerDelegate* delegate);
57 ~WindowServer() override; 58 ~WindowServer() override;
58 59
59 WindowServerDelegate* delegate() { return delegate_; } 60 WindowServerDelegate* delegate() { return delegate_; }
60 61
61 UserIdTracker* user_id_tracker() { return &user_id_tracker_; } 62 UserIdTracker* user_id_tracker() { return &user_id_tracker_; }
62 const UserIdTracker* user_id_tracker() const { return &user_id_tracker_; } 63 const UserIdTracker* user_id_tracker() const { return &user_id_tracker_; }
63 64
64 DisplayManager* display_manager() { return display_manager_.get(); } 65 DisplayManager* display_manager() { return display_manager_.get(); }
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 const ui::TextInputState& state) override; 333 const ui::TextInputState& state) override;
333 void OnTransientWindowAdded(ServerWindow* window, 334 void OnTransientWindowAdded(ServerWindow* window,
334 ServerWindow* transient_child) override; 335 ServerWindow* transient_child) override;
335 void OnTransientWindowRemoved(ServerWindow* window, 336 void OnTransientWindowRemoved(ServerWindow* window,
336 ServerWindow* transient_child) override; 337 ServerWindow* transient_child) override;
337 338
338 // GpuServiceProxyDelegate: 339 // GpuServiceProxyDelegate:
339 void OnGpuChannelEstablished( 340 void OnGpuChannelEstablished(
340 scoped_refptr<gpu::GpuChannelHost> gpu_channel) override; 341 scoped_refptr<gpu::GpuChannelHost> gpu_channel) override;
341 342
342 // DisplayCompositorClient: 343 // cc::mojom::DisplayCompositorClient:
343 void OnSurfaceCreated(const cc::SurfaceId& surface_id, 344 void OnSurfaceCreated(const cc::SurfaceId& surface_id,
344 const gfx::Size& frame_size, 345 const gfx::Size& frame_size,
345 float device_scale_factor) override; 346 float device_scale_factor) override;
346 347
347 // UserIdTrackerObserver: 348 // UserIdTrackerObserver:
348 void OnActiveUserIdChanged(const UserId& previously_active_id, 349 void OnActiveUserIdChanged(const UserId& previously_active_id,
349 const UserId& active_id) override; 350 const UserId& active_id) override;
350 void OnUserIdAdded(const UserId& id) override; 351 void OnUserIdAdded(const UserId& id) override;
351 void OnUserIdRemoved(const UserId& id) override; 352 void OnUserIdRemoved(const UserId& id) override;
352 353
353 UserIdTracker user_id_tracker_; 354 UserIdTracker user_id_tracker_;
354 355
355 WindowServerDelegate* delegate_; 356 WindowServerDelegate* delegate_;
356 357
357 // State for rendering into a Surface.
358 scoped_refptr<ui::DisplayCompositor> display_compositor_;
359
360 // ID to use for next WindowTree. 358 // ID to use for next WindowTree.
361 ClientSpecificId next_client_id_; 359 ClientSpecificId next_client_id_;
362 360
363 std::unique_ptr<DisplayManager> display_manager_; 361 std::unique_ptr<DisplayManager> display_manager_;
364 362
365 std::unique_ptr<CurrentDragLoopState> current_drag_loop_; 363 std::unique_ptr<CurrentDragLoopState> current_drag_loop_;
366 std::unique_ptr<CurrentMoveLoopState> current_move_loop_; 364 std::unique_ptr<CurrentMoveLoopState> current_move_loop_;
367 365
368 // Set of WindowTrees. 366 // Set of WindowTrees.
369 WindowTreeMap tree_map_; 367 WindowTreeMap tree_map_;
(...skipping 13 matching lines...) Expand all
383 uint32_t next_wm_change_id_; 381 uint32_t next_wm_change_id_;
384 382
385 std::unique_ptr<GpuServiceProxy> gpu_proxy_; 383 std::unique_ptr<GpuServiceProxy> gpu_proxy_;
386 scoped_refptr<gpu::GpuChannelHost> gpu_channel_; 384 scoped_refptr<gpu::GpuChannelHost> gpu_channel_;
387 base::Callback<void(ServerWindow*)> window_paint_callback_; 385 base::Callback<void(ServerWindow*)> window_paint_callback_;
388 386
389 UserActivityMonitorMap activity_monitor_map_; 387 UserActivityMonitorMap activity_monitor_map_;
390 388
391 WindowManagerWindowTreeFactorySet window_manager_window_tree_factory_set_; 389 WindowManagerWindowTreeFactorySet window_manager_window_tree_factory_set_;
392 390
391 mojo::Binding<cc::mojom::DisplayCompositorClient>
392 display_compositor_client_binding_;
393 // State for rendering into a Surface.
394 scoped_refptr<ui::DisplayCompositor> display_compositor_;
395
393 DISALLOW_COPY_AND_ASSIGN(WindowServer); 396 DISALLOW_COPY_AND_ASSIGN(WindowServer);
394 }; 397 };
395 398
396 } // namespace ws 399 } // namespace ws
397 } // namespace ui 400 } // namespace ui
398 401
399 #endif // SERVICES_UI_WS_WINDOW_SERVER_H_ 402 #endif // SERVICES_UI_WS_WINDOW_SERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698