| 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_SURFACES_DISPLAY_COMPOSITOR_H_ | 5 #ifndef SERVICES_UI_SURFACES_DISPLAY_COMPOSITOR_H_ |
| 6 #define SERVICES_UI_SURFACES_DISPLAY_COMPOSITOR_H_ | 6 #define SERVICES_UI_SURFACES_DISPLAY_COMPOSITOR_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 62 |
| 63 cc::SurfaceManager* manager() { return &manager_; } | 63 cc::SurfaceManager* manager() { return &manager_; } |
| 64 | 64 |
| 65 // display_compositor::GpuCompositorFrameSinkDelegate implementation. | 65 // display_compositor::GpuCompositorFrameSinkDelegate implementation. |
| 66 void OnClientConnectionLost(const cc::FrameSinkId& frame_sink_id, | 66 void OnClientConnectionLost(const cc::FrameSinkId& frame_sink_id, |
| 67 bool destroy_compositor_frame_sink) override; | 67 bool destroy_compositor_frame_sink) override; |
| 68 void OnPrivateConnectionLost(const cc::FrameSinkId& frame_sink_id, | 68 void OnPrivateConnectionLost(const cc::FrameSinkId& frame_sink_id, |
| 69 bool destroy_compositor_frame_sink) override; | 69 bool destroy_compositor_frame_sink) override; |
| 70 | 70 |
| 71 // cc::mojom::DisplayCompositor implementation: | 71 // cc::mojom::DisplayCompositor implementation: |
| 72 void CreateDisplayCompositorFrameSink( | 72 void CreateRootCompositorFrameSink( |
| 73 const cc::FrameSinkId& frame_sink_id, | 73 const cc::FrameSinkId& frame_sink_id, |
| 74 gpu::SurfaceHandle surface_handle, | 74 gpu::SurfaceHandle surface_handle, |
| 75 cc::mojom::MojoCompositorFrameSinkAssociatedRequest request, | 75 cc::mojom::MojoCompositorFrameSinkAssociatedRequest request, |
| 76 cc::mojom::MojoCompositorFrameSinkPrivateRequest private_request, | 76 cc::mojom::MojoCompositorFrameSinkPrivateRequest private_request, |
| 77 cc::mojom::MojoCompositorFrameSinkClientPtr client, | 77 cc::mojom::MojoCompositorFrameSinkClientPtr client, |
| 78 cc::mojom::DisplayPrivateAssociatedRequest display_private_request) | 78 cc::mojom::DisplayPrivateAssociatedRequest display_private_request) |
| 79 override; | 79 override; |
| 80 void CreateOffscreenCompositorFrameSink( | 80 void CreateCompositorFrameSink( |
| 81 const cc::FrameSinkId& frame_sink_id, | 81 const cc::FrameSinkId& frame_sink_id, |
| 82 cc::mojom::MojoCompositorFrameSinkRequest request, | 82 cc::mojom::MojoCompositorFrameSinkRequest request, |
| 83 cc::mojom::MojoCompositorFrameSinkPrivateRequest private_request, | 83 cc::mojom::MojoCompositorFrameSinkPrivateRequest private_request, |
| 84 cc::mojom::MojoCompositorFrameSinkClientPtr client) override; | 84 cc::mojom::MojoCompositorFrameSinkClientPtr client) override; |
| 85 | 85 |
| 86 private: | 86 private: |
| 87 std::unique_ptr<cc::Display> CreateDisplay( | 87 std::unique_ptr<cc::Display> CreateDisplay( |
| 88 const cc::FrameSinkId& frame_sink_id, | 88 const cc::FrameSinkId& frame_sink_id, |
| 89 gpu::SurfaceHandle surface_handle, | 89 gpu::SurfaceHandle surface_handle, |
| 90 cc::SyntheticBeginFrameSource* begin_frame_source); | 90 cc::SyntheticBeginFrameSource* begin_frame_source); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 113 | 113 |
| 114 // SurfaceManager should be the first object constructed and the last object | 114 // SurfaceManager should be the first object constructed and the last object |
| 115 // destroyed in order to ensure that all other objects that depend on it have | 115 // destroyed in order to ensure that all other objects that depend on it have |
| 116 // access to a valid pointer for the entirety of their liftimes. | 116 // access to a valid pointer for the entirety of their liftimes. |
| 117 cc::SurfaceManager manager_; | 117 cc::SurfaceManager manager_; |
| 118 | 118 |
| 119 scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_service_; | 119 scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_service_; |
| 120 std::unique_ptr<gpu::GpuMemoryBufferManager> gpu_memory_buffer_manager_; | 120 std::unique_ptr<gpu::GpuMemoryBufferManager> gpu_memory_buffer_manager_; |
| 121 gpu::ImageFactory* image_factory_; | 121 gpu::ImageFactory* image_factory_; |
| 122 | 122 |
| 123 std::unordered_map< | 123 std::unordered_map<cc::FrameSinkId, |
| 124 cc::FrameSinkId, | 124 std::unique_ptr<cc::mojom::MojoCompositorFrameSink>, |
| 125 std::unique_ptr<display_compositor::GpuCompositorFrameSink>, | 125 cc::FrameSinkIdHash> |
| 126 cc::FrameSinkIdHash> | |
| 127 compositor_frame_sinks_; | 126 compositor_frame_sinks_; |
| 128 | 127 |
| 129 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 128 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 130 | 129 |
| 131 base::ThreadChecker thread_checker_; | 130 base::ThreadChecker thread_checker_; |
| 132 | 131 |
| 133 cc::mojom::DisplayCompositorClientPtr client_; | 132 cc::mojom::DisplayCompositorClientPtr client_; |
| 134 mojo::Binding<cc::mojom::DisplayCompositor> binding_; | 133 mojo::Binding<cc::mojom::DisplayCompositor> binding_; |
| 135 | 134 |
| 136 DISALLOW_COPY_AND_ASSIGN(DisplayCompositor); | 135 DISALLOW_COPY_AND_ASSIGN(DisplayCompositor); |
| 137 }; | 136 }; |
| 138 | 137 |
| 139 } // namespace ui | 138 } // namespace ui |
| 140 | 139 |
| 141 #endif // SERVICES_UI_SURFACES_DISPLAY_COMPOSITOR_H_ | 140 #endif // SERVICES_UI_SURFACES_DISPLAY_COMPOSITOR_H_ |
| OLD | NEW |