| 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 SERVICES_UI_WS_SERVER_WINDOW_COMPOSITOR_FRAME_SINK_MANAGER_H_ | 5 #ifndef SERVICES_UI_WS_SERVER_WINDOW_COMPOSITOR_FRAME_SINK_MANAGER_H_ |
| 6 #define SERVICES_UI_WS_SERVER_WINDOW_COMPOSITOR_FRAME_SINK_MANAGER_H_ | 6 #define SERVICES_UI_WS_SERVER_WINDOW_COMPOSITOR_FRAME_SINK_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "cc/ipc/compositor_frame.mojom.h" | 9 #include "cc/ipc/compositor_frame.mojom.h" |
| 10 #include "cc/ipc/display_compositor.mojom.h" | 10 #include "cc/ipc/display_compositor.mojom.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 struct CompositorFrameSinkData { | 23 struct CompositorFrameSinkData { |
| 24 CompositorFrameSinkData(); | 24 CompositorFrameSinkData(); |
| 25 CompositorFrameSinkData(CompositorFrameSinkData&& other); | 25 CompositorFrameSinkData(CompositorFrameSinkData&& other); |
| 26 ~CompositorFrameSinkData(); | 26 ~CompositorFrameSinkData(); |
| 27 | 27 |
| 28 CompositorFrameSinkData& operator=(CompositorFrameSinkData&& other); | 28 CompositorFrameSinkData& operator=(CompositorFrameSinkData&& other); |
| 29 | 29 |
| 30 cc::mojom::MojoCompositorFrameSinkPrivatePtr compositor_frame_sink; | 30 cc::mojom::MojoCompositorFrameSinkPrivatePtr compositor_frame_sink; |
| 31 cc::mojom::MojoCompositorFrameSinkPrivateRequest | 31 cc::mojom::MojoCompositorFrameSinkPrivateRequest |
| 32 pending_compositor_frame_sink_request; | 32 pending_compositor_frame_sink_request; |
| 33 cc::FrameSinkId frame_sink_id; | |
| 34 }; | 33 }; |
| 35 | 34 |
| 36 // ServerWindowCompositorFrameSinkManager tracks the surfaces associated with a | 35 // ServerWindowCompositorFrameSinkManager tracks the surfaces associated with a |
| 37 // ServerWindow. | 36 // ServerWindow. |
| 38 class ServerWindowCompositorFrameSinkManager { | 37 class ServerWindowCompositorFrameSinkManager { |
| 39 public: | 38 public: |
| 40 explicit ServerWindowCompositorFrameSinkManager(ServerWindow* window); | 39 explicit ServerWindowCompositorFrameSinkManager(ServerWindow* window); |
| 41 ~ServerWindowCompositorFrameSinkManager(); | 40 ~ServerWindowCompositorFrameSinkManager(); |
| 42 | 41 |
| 43 // Creates a new CompositorFrameSink of the specified type, replacing the | 42 // Creates a new CompositorFrameSink of the specified type, replacing the |
| 44 // existing one of the specified type. | 43 // existing one of the specified type. |
| 45 void CreateRootCompositorFrameSink( | 44 void CreateRootCompositorFrameSink( |
| 46 gfx::AcceleratedWidget widget, | 45 gfx::AcceleratedWidget widget, |
| 47 cc::mojom::MojoCompositorFrameSinkAssociatedRequest sink_request, | 46 cc::mojom::MojoCompositorFrameSinkAssociatedRequest sink_request, |
| 48 cc::mojom::MojoCompositorFrameSinkClientPtr client, | 47 cc::mojom::MojoCompositorFrameSinkClientPtr client, |
| 49 cc::mojom::DisplayPrivateAssociatedRequest display_request); | 48 cc::mojom::DisplayPrivateAssociatedRequest display_request); |
| 50 | 49 |
| 51 void CreateCompositorFrameSink( | 50 void CreateCompositorFrameSink( |
| 52 cc::mojom::MojoCompositorFrameSinkRequest request, | 51 cc::mojom::MojoCompositorFrameSinkRequest request, |
| 53 cc::mojom::MojoCompositorFrameSinkClientPtr client); | 52 cc::mojom::MojoCompositorFrameSinkClientPtr client); |
| 54 | 53 |
| 55 // Adds the provided |frame_sink_id| to this ServerWindow's associated | |
| 56 // CompositorFrameSink if possible. If this ServerWindow does not have | |
| 57 // an associated CompositorFrameSink then this method will recursively | |
| 58 // walk up the window hierarchy and register itself with the first ancestor | |
| 59 // that has a CompositorFrameSink of the same type. This method returns | |
| 60 // the FrameSinkId that is the first composited ancestor of the ServerWindow | |
| 61 // assocaited with the provided |frame_sink_id|. | |
| 62 void AddChildFrameSinkId(const cc::FrameSinkId& frame_sink_id); | |
| 63 void RemoveChildFrameSinkId(const cc::FrameSinkId& frame_sink_id); | |
| 64 | |
| 65 void OnRootChanged(ServerWindow* old_root, ServerWindow* new_root); | |
| 66 | |
| 67 private: | 54 private: |
| 68 friend class ServerWindowCompositorFrameSinkManagerTestApi; | 55 friend class ServerWindowCompositorFrameSinkManagerTestApi; |
| 69 friend class ServerWindowCompositorFrameSink; | 56 friend class ServerWindowCompositorFrameSink; |
| 70 | 57 |
| 71 ServerWindow* window_; | 58 ServerWindow* window_; |
| 72 | 59 |
| 73 std::unique_ptr<CompositorFrameSinkData> frame_sink_data_; | 60 std::unique_ptr<CompositorFrameSinkData> frame_sink_data_; |
| 74 | 61 |
| 75 DISALLOW_COPY_AND_ASSIGN(ServerWindowCompositorFrameSinkManager); | 62 DISALLOW_COPY_AND_ASSIGN(ServerWindowCompositorFrameSinkManager); |
| 76 }; | 63 }; |
| 77 | 64 |
| 78 } // namespace ws | 65 } // namespace ws |
| 79 } // namespace ui | 66 } // namespace ui |
| 80 | 67 |
| 81 #endif // SERVICES_UI_WS_SERVER_WINDOW_COMPOSITOR_FRAME_SINK_MANAGER_H_ | 68 #endif // SERVICES_UI_WS_SERVER_WINDOW_COMPOSITOR_FRAME_SINK_MANAGER_H_ |
| OLD | NEW |