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