| 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_SURFACE_MANAGER_H_ | 5 #ifndef SERVICES_UI_WS_SERVER_WINDOW_SURFACE_MANAGER_H_ |
| 6 #define SERVICES_UI_WS_SERVER_WINDOW_SURFACE_MANAGER_H_ | 6 #define SERVICES_UI_WS_SERVER_WINDOW_SURFACE_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/output/context_provider.h" |
| 12 #include "cc/surfaces/surface_factory.h" | 13 #include "cc/surfaces/surface_factory.h" |
| 13 #include "cc/surfaces/surface_id.h" | 14 #include "cc/surfaces/surface_id.h" |
| 14 #include "cc/surfaces/surface_sequence_generator.h" | 15 #include "cc/surfaces/surface_sequence_generator.h" |
| 15 #include "mojo/public/cpp/bindings/binding.h" | 16 #include "mojo/public/cpp/bindings/binding.h" |
| 16 #include "services/ui/public/interfaces/window_tree.mojom.h" | 17 #include "services/ui/public/interfaces/window_tree.mojom.h" |
| 17 | 18 |
| 19 namespace gpu { |
| 20 class GpuMemoryBufferManager; |
| 21 } |
| 22 |
| 18 namespace ui { | 23 namespace ui { |
| 19 namespace ws { | 24 namespace ws { |
| 20 | 25 |
| 21 class ServerWindow; | 26 class ServerWindow; |
| 22 class ServerWindowCompositorFrameSink; | 27 class ServerWindowCompositorFrameSink; |
| 23 class ServerWindowCompositorFrameSinkManagerTestApi; | 28 class ServerWindowCompositorFrameSinkManagerTestApi; |
| 24 | 29 |
| 25 struct CompositorFrameSinkData { | 30 struct CompositorFrameSinkData { |
| 26 CompositorFrameSinkData(); | 31 CompositorFrameSinkData(); |
| 27 CompositorFrameSinkData(CompositorFrameSinkData&& other); | 32 CompositorFrameSinkData(CompositorFrameSinkData&& other); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 43 explicit ServerWindowCompositorFrameSinkManager(ServerWindow* window); | 48 explicit ServerWindowCompositorFrameSinkManager(ServerWindow* window); |
| 44 ~ServerWindowCompositorFrameSinkManager(); | 49 ~ServerWindowCompositorFrameSinkManager(); |
| 45 | 50 |
| 46 // Returns true if the surfaces from this manager should be drawn. | 51 // Returns true if the surfaces from this manager should be drawn. |
| 47 bool ShouldDraw(); | 52 bool ShouldDraw(); |
| 48 | 53 |
| 49 // Creates a new surface of the specified type, replacing the existing one of | 54 // Creates a new surface of the specified type, replacing the existing one of |
| 50 // the specified type. | 55 // the specified type. |
| 51 void CreateCompositorFrameSink( | 56 void CreateCompositorFrameSink( |
| 52 mojom::CompositorFrameSinkType surface_type, | 57 mojom::CompositorFrameSinkType surface_type, |
| 53 mojo::InterfaceRequest<cc::mojom::MojoCompositorFrameSink> request, | 58 gfx::AcceleratedWidget widget, |
| 59 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 60 scoped_refptr<cc::ContextProvider> context_provider, |
| 61 cc::mojom::MojoCompositorFrameSinkRequest request, |
| 54 cc::mojom::MojoCompositorFrameSinkClientPtr client); | 62 cc::mojom::MojoCompositorFrameSinkClientPtr client); |
| 55 | 63 |
| 56 ServerWindow* window() { return window_; } | 64 ServerWindow* window() { return window_; } |
| 57 | 65 |
| 58 ServerWindowCompositorFrameSink* GetDefaultCompositorFrameSink() const; | 66 ServerWindowCompositorFrameSink* GetDefaultCompositorFrameSink() const; |
| 59 ServerWindowCompositorFrameSink* GetUnderlayCompositorFrameSink() const; | 67 ServerWindowCompositorFrameSink* GetUnderlayCompositorFrameSink() const; |
| 60 ServerWindowCompositorFrameSink* GetCompositorFrameSinkByType( | 68 ServerWindowCompositorFrameSink* GetCompositorFrameSinkByType( |
| 61 mojom::CompositorFrameSinkType type) const; | 69 mojom::CompositorFrameSinkType type) const; |
| 62 bool HasCompositorFrameSinkOfType(mojom::CompositorFrameSinkType type) const; | 70 bool HasCompositorFrameSinkOfType(mojom::CompositorFrameSinkType type) const; |
| 63 bool HasAnyCompositorFrameSink() const; | 71 bool HasAnyCompositorFrameSink() const; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 // the underlay is not necessarily as big as the window. | 105 // the underlay is not necessarily as big as the window. |
| 98 bool waiting_for_initial_frames_; | 106 bool waiting_for_initial_frames_; |
| 99 | 107 |
| 100 DISALLOW_COPY_AND_ASSIGN(ServerWindowCompositorFrameSinkManager); | 108 DISALLOW_COPY_AND_ASSIGN(ServerWindowCompositorFrameSinkManager); |
| 101 }; | 109 }; |
| 102 | 110 |
| 103 } // namespace ws | 111 } // namespace ws |
| 104 } // namespace ui | 112 } // namespace ui |
| 105 | 113 |
| 106 #endif // SERVICES_UI_WS_SERVER_WINDOW_SURFACE_MANAGER_H_ | 114 #endif // SERVICES_UI_WS_SERVER_WINDOW_SURFACE_MANAGER_H_ |
| OLD | NEW |