Chromium Code Reviews| 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 <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "cc/ipc/compositor_frame.mojom.h" | 11 #include "cc/ipc/compositor_frame.mojom.h" |
| 12 #include "cc/ipc/display_compositor.mojom.h" | |
| 12 #include "cc/output/context_provider.h" | 13 #include "cc/output/context_provider.h" |
| 13 #include "cc/surfaces/surface_id.h" | 14 #include "cc/surfaces/surface_id.h" |
| 14 #include "mojo/public/cpp/bindings/binding.h" | 15 #include "mojo/public/cpp/bindings/binding.h" |
| 15 #include "services/ui/public/interfaces/window_tree.mojom.h" | 16 #include "services/ui/public/interfaces/window_tree.mojom.h" |
| 16 | 17 |
| 17 namespace ui { | 18 namespace ui { |
| 18 namespace ws { | 19 namespace ws { |
| 19 | 20 |
| 20 class ServerWindow; | 21 class ServerWindow; |
| 21 class ServerWindowCompositorFrameSink; | 22 class ServerWindowCompositorFrameSink; |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 45 ~ServerWindowCompositorFrameSinkManager(); | 46 ~ServerWindowCompositorFrameSinkManager(); |
| 46 | 47 |
| 47 // Returns true if the CompositorFrameSinks from this manager should be drawn. | 48 // Returns true if the CompositorFrameSinks from this manager should be drawn. |
| 48 bool ShouldDraw(); | 49 bool ShouldDraw(); |
| 49 | 50 |
| 50 // Creates a new CompositorFrameSink of the specified type, replacing the | 51 // Creates a new CompositorFrameSink of the specified type, replacing the |
| 51 // existing one of the specified type. | 52 // existing one of the specified type. |
| 52 void CreateDisplayCompositorFrameSink( | 53 void CreateDisplayCompositorFrameSink( |
| 53 gfx::AcceleratedWidget widget, | 54 gfx::AcceleratedWidget widget, |
| 54 cc::mojom::MojoCompositorFrameSinkRequest request, | 55 cc::mojom::MojoCompositorFrameSinkRequest request, |
| 55 cc::mojom::MojoCompositorFrameSinkClientPtr client); | 56 cc::mojom::MojoCompositorFrameSinkClientPtr client, |
| 57 cc::mojom::DisplayPrivatePtr display_private, | |
|
Fady Samuel
2016/12/16 05:29:39
don't pass this in
Alex Z.
2016/12/16 16:42:00
Done.
| |
| 58 cc::mojom::DisplayPrivateRequest display_request); | |
|
Fady Samuel
2016/12/16 05:29:39
nit: display_private_request
Alex Z.
2016/12/16 16:42:00
Done.
| |
| 56 void CreateOffscreenCompositorFrameSink( | 59 void CreateOffscreenCompositorFrameSink( |
| 57 mojom::CompositorFrameSinkType compositor_frame_sink_type, | 60 mojom::CompositorFrameSinkType compositor_frame_sink_type, |
| 58 cc::mojom::MojoCompositorFrameSinkRequest request, | 61 cc::mojom::MojoCompositorFrameSinkRequest request, |
| 59 cc::mojom::MojoCompositorFrameSinkClientPtr client); | 62 cc::mojom::MojoCompositorFrameSinkClientPtr client); |
| 60 | 63 |
| 61 // Adds the provided |frame_sink_id| to this ServerWindow's associated | 64 // Adds the provided |frame_sink_id| to this ServerWindow's associated |
| 62 // CompositorFrameSink if possible. If this ServerWindow does not have | 65 // CompositorFrameSink if possible. If this ServerWindow does not have |
| 63 // an associated CompositorFrameSink then this method will recursively | 66 // an associated CompositorFrameSink then this method will recursively |
| 64 // walk up the window hierarchy and register itself with the first ancestor | 67 // walk up the window hierarchy and register itself with the first ancestor |
| 65 // that has a CompositorFrameSink of the same type. This method returns | 68 // that has a CompositorFrameSink of the same type. This method returns |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 89 | 92 |
| 90 // Returns true if a CompositorFrameSink of |type| has been set and has | 93 // Returns true if a CompositorFrameSink of |type| has been set and has |
| 91 // received a frame that is greater than the size of the window. | 94 // received a frame that is greater than the size of the window. |
| 92 bool IsCompositorFrameSinkReadyAndNonEmpty( | 95 bool IsCompositorFrameSinkReadyAndNonEmpty( |
| 93 mojom::CompositorFrameSinkType type) const; | 96 mojom::CompositorFrameSinkType type) const; |
| 94 | 97 |
| 95 void CreateCompositorFrameSinkInternal( | 98 void CreateCompositorFrameSinkInternal( |
| 96 mojom::CompositorFrameSinkType compositor_frame_sink_type, | 99 mojom::CompositorFrameSinkType compositor_frame_sink_type, |
| 97 gfx::AcceleratedWidget widget, | 100 gfx::AcceleratedWidget widget, |
| 98 cc::mojom::MojoCompositorFrameSinkRequest request, | 101 cc::mojom::MojoCompositorFrameSinkRequest request, |
| 99 cc::mojom::MojoCompositorFrameSinkClientPtr client); | 102 cc::mojom::MojoCompositorFrameSinkClientPtr client, |
| 103 cc::mojom::DisplayPrivateRequest display_request); | |
|
Fady Samuel
2016/12/16 05:29:39
nit: display_private_request
Alex Z.
2016/12/16 16:42:00
Done.
| |
| 100 | 104 |
| 101 ServerWindow* window_; | 105 ServerWindow* window_; |
| 102 | 106 |
| 103 using TypeToCompositorFrameSinkMap = | 107 using TypeToCompositorFrameSinkMap = |
| 104 std::map<mojom::CompositorFrameSinkType, CompositorFrameSinkData>; | 108 std::map<mojom::CompositorFrameSinkType, CompositorFrameSinkData>; |
| 105 | 109 |
| 106 TypeToCompositorFrameSinkMap type_to_compositor_frame_sink_map_; | 110 TypeToCompositorFrameSinkMap type_to_compositor_frame_sink_map_; |
| 107 | 111 |
| 108 // While true the window is not drawn. This is initially true if the window | 112 // While true the window is not drawn. This is initially true if the window |
| 109 // has the property |kWaitForUnderlay_Property|. This is set to false once | 113 // has the property |kWaitForUnderlay_Property|. This is set to false once |
| 110 // the underlay and default surface have been set *and* their size is at | 114 // the underlay and default surface have been set *and* their size is at |
| 111 // least that of the window. Ideally we would wait for sizes to match, but | 115 // least that of the window. Ideally we would wait for sizes to match, but |
| 112 // the underlay is not necessarily as big as the window. | 116 // the underlay is not necessarily as big as the window. |
| 113 bool waiting_for_initial_frames_; | 117 bool waiting_for_initial_frames_; |
| 118 cc::mojom::DisplayPrivatePtr display_private_; | |
|
Fady Samuel
2016/12/16 05:29:39
Don't store this here. I think FrameGenerator shou
Alex Z.
2016/12/16 16:42:00
Done.
| |
| 114 | 119 |
| 115 DISALLOW_COPY_AND_ASSIGN(ServerWindowCompositorFrameSinkManager); | 120 DISALLOW_COPY_AND_ASSIGN(ServerWindowCompositorFrameSinkManager); |
| 116 }; | 121 }; |
| 117 | 122 |
| 118 } // namespace ws | 123 } // namespace ws |
| 119 } // namespace ui | 124 } // namespace ui |
| 120 | 125 |
| 121 #endif // SERVICES_UI_WS_SERVER_WINDOW_COMPOSITOR_FRAME_SINK_MANAGER_H_ | 126 #endif // SERVICES_UI_WS_SERVER_WINDOW_COMPOSITOR_FRAME_SINK_MANAGER_H_ |
| OLD | NEW |