| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 public cc::mojom::DisplayCompositor { | 52 public cc::mojom::DisplayCompositor { |
| 53 public: | 53 public: |
| 54 DisplayCompositor( | 54 DisplayCompositor( |
| 55 scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_service, | 55 scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_service, |
| 56 std::unique_ptr<MusGpuMemoryBufferManager> gpu_memory_buffer_manager, | 56 std::unique_ptr<MusGpuMemoryBufferManager> gpu_memory_buffer_manager, |
| 57 gpu::ImageFactory* image_factory, | 57 gpu::ImageFactory* image_factory, |
| 58 cc::mojom::DisplayCompositorRequest request, | 58 cc::mojom::DisplayCompositorRequest request, |
| 59 cc::mojom::DisplayCompositorClientPtr client); | 59 cc::mojom::DisplayCompositorClientPtr client); |
| 60 ~DisplayCompositor() override; | 60 ~DisplayCompositor() override; |
| 61 | 61 |
| 62 void AddSurfaceReference(const cc::SurfaceReference& ref); |
| 63 void RemoveSurfaceReference(const cc::SurfaceReference& ref); |
| 64 |
| 62 // cc::mojom::DisplayCompositor implementation: | 65 // cc::mojom::DisplayCompositor implementation: |
| 63 void CreateCompositorFrameSink( | 66 void CreateCompositorFrameSink( |
| 64 const cc::FrameSinkId& frame_sink_id, | 67 const cc::FrameSinkId& frame_sink_id, |
| 65 gpu::SurfaceHandle surface_handle, | 68 gpu::SurfaceHandle surface_handle, |
| 66 cc::mojom::MojoCompositorFrameSinkRequest request, | 69 cc::mojom::MojoCompositorFrameSinkRequest request, |
| 67 cc::mojom::MojoCompositorFrameSinkPrivateRequest private_request, | 70 cc::mojom::MojoCompositorFrameSinkPrivateRequest private_request, |
| 68 cc::mojom::MojoCompositorFrameSinkClientPtr client) override; | 71 cc::mojom::MojoCompositorFrameSinkClientPtr client) override; |
| 69 void AddRootSurfaceReference(const cc::SurfaceId& child_id) override; | |
| 70 void AddSurfaceReference(const cc::SurfaceId& parent_id, | |
| 71 const cc::SurfaceId& child_id) override; | |
| 72 void RemoveRootSurfaceReference(const cc::SurfaceId& child_id) override; | |
| 73 void RemoveSurfaceReference(const cc::SurfaceId& parent_id, | |
| 74 const cc::SurfaceId& child_id) override; | |
| 75 | 72 |
| 76 cc::SurfaceManager* manager() { return &manager_; } | 73 cc::SurfaceManager* manager() { return &manager_; } |
| 77 | 74 |
| 78 // We must avoid destroying a GpuCompositorFrameSink until both the display | 75 // We must avoid destroying a GpuCompositorFrameSink until both the display |
| 79 // compositor host and the client drop their connection to avoid getting into | 76 // compositor host and the client drop their connection to avoid getting into |
| 80 // a state where surfaces references are inconsistent. | 77 // a state where surfaces references are inconsistent. |
| 81 void OnCompositorFrameSinkClientConnectionLost( | 78 void OnCompositorFrameSinkClientConnectionLost( |
| 82 const cc::FrameSinkId& frame_sink_id, | 79 const cc::FrameSinkId& frame_sink_id, |
| 83 bool destroy_compositor_frame_sink); | 80 bool destroy_compositor_frame_sink); |
| 84 void OnCompositorFrameSinkPrivateConnectionLost( | 81 void OnCompositorFrameSinkPrivateConnectionLost( |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 temp_references_; | 122 temp_references_; |
| 126 | 123 |
| 127 mojo::Binding<cc::mojom::DisplayCompositor> binding_; | 124 mojo::Binding<cc::mojom::DisplayCompositor> binding_; |
| 128 | 125 |
| 129 DISALLOW_COPY_AND_ASSIGN(DisplayCompositor); | 126 DISALLOW_COPY_AND_ASSIGN(DisplayCompositor); |
| 130 }; | 127 }; |
| 131 | 128 |
| 132 } // namespace ui | 129 } // namespace ui |
| 133 | 130 |
| 134 #endif // SERVICES_UI_SURFACES_DISPLAY_COMPOSITOR_H_ | 131 #endif // SERVICES_UI_SURFACES_DISPLAY_COMPOSITOR_H_ |
| OLD | NEW |