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" |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 // ServerWindowCompositorFrameSinkManager tracks the surfaces associated with a | 39 // ServerWindowCompositorFrameSinkManager tracks the surfaces associated with a |
40 // ServerWindow. | 40 // ServerWindow. |
41 // TODO(fsamuel): Delete this once window decorations are managed in the window | 41 // TODO(fsamuel): Delete this once window decorations are managed in the window |
42 // manager. | 42 // manager. |
43 class ServerWindowCompositorFrameSinkManager { | 43 class ServerWindowCompositorFrameSinkManager { |
44 public: | 44 public: |
45 explicit ServerWindowCompositorFrameSinkManager(ServerWindow* window); | 45 explicit ServerWindowCompositorFrameSinkManager(ServerWindow* window); |
46 ~ServerWindowCompositorFrameSinkManager(); | 46 ~ServerWindowCompositorFrameSinkManager(); |
47 | 47 |
48 // Returns true if the CompositorFrameSinks from this manager should be drawn. | |
49 bool ShouldDraw(); | |
50 | |
51 // Creates a new CompositorFrameSink of the specified type, replacing the | 48 // Creates a new CompositorFrameSink of the specified type, replacing the |
52 // existing one of the specified type. | 49 // existing one of the specified type. |
53 void CreateDisplayCompositorFrameSink( | 50 void CreateDisplayCompositorFrameSink( |
54 gfx::AcceleratedWidget widget, | 51 gfx::AcceleratedWidget widget, |
55 cc::mojom::MojoCompositorFrameSinkRequest request, | 52 cc::mojom::MojoCompositorFrameSinkRequest request, |
56 cc::mojom::MojoCompositorFrameSinkClientPtr client, | 53 cc::mojom::MojoCompositorFrameSinkClientPtr client, |
57 cc::mojom::DisplayPrivateRequest display_private_request); | 54 cc::mojom::DisplayPrivateRequest display_private_request); |
58 void CreateOffscreenCompositorFrameSink( | 55 void CreateOffscreenCompositorFrameSink( |
59 mojom::CompositorFrameSinkType compositor_frame_sink_type, | 56 mojom::CompositorFrameSinkType compositor_frame_sink_type, |
60 cc::mojom::MojoCompositorFrameSinkRequest request, | 57 cc::mojom::MojoCompositorFrameSinkRequest request, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 cc::mojom::MojoCompositorFrameSinkClientPtr client, | 99 cc::mojom::MojoCompositorFrameSinkClientPtr client, |
103 cc::mojom::DisplayPrivateRequest display_private_request); | 100 cc::mojom::DisplayPrivateRequest display_private_request); |
104 | 101 |
105 ServerWindow* window_; | 102 ServerWindow* window_; |
106 | 103 |
107 using TypeToCompositorFrameSinkMap = | 104 using TypeToCompositorFrameSinkMap = |
108 std::map<mojom::CompositorFrameSinkType, CompositorFrameSinkData>; | 105 std::map<mojom::CompositorFrameSinkType, CompositorFrameSinkData>; |
109 | 106 |
110 TypeToCompositorFrameSinkMap type_to_compositor_frame_sink_map_; | 107 TypeToCompositorFrameSinkMap type_to_compositor_frame_sink_map_; |
111 | 108 |
112 // TODO(mfomitchev): This is currently always false. Confirm if we still need | |
113 // this. | |
114 // While true the window is not drawn. This is initially true if the window | |
115 // has the property |kWaitForUnderlay_Property|. This is set to false once | |
116 // the underlay and default surface have been set *and* their size is at | |
117 // least that of the window. Ideally we would wait for sizes to match, but | |
118 // the underlay is not necessarily as big as the window. | |
119 bool waiting_for_initial_frames_; | |
120 | |
121 DISALLOW_COPY_AND_ASSIGN(ServerWindowCompositorFrameSinkManager); | 109 DISALLOW_COPY_AND_ASSIGN(ServerWindowCompositorFrameSinkManager); |
122 }; | 110 }; |
123 | 111 |
124 } // namespace ws | 112 } // namespace ws |
125 } // namespace ui | 113 } // namespace ui |
126 | 114 |
127 #endif // SERVICES_UI_WS_SERVER_WINDOW_COMPOSITOR_FRAME_SINK_MANAGER_H_ | 115 #endif // SERVICES_UI_WS_SERVER_WINDOW_COMPOSITOR_FRAME_SINK_MANAGER_H_ |
OLD | NEW |