| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 // 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 |
| 77 // a state where surfaces references are inconsistent. | 77 // a state where surfaces references are inconsistent. |
| 78 void OnCompositorFrameSinkClientConnectionLost( | 78 void OnCompositorFrameSinkClientConnectionLost( |
| 79 const cc::FrameSinkId& frame_sink_id, | 79 const cc::FrameSinkId& frame_sink_id, |
| 80 bool destroy_compositor_frame_sink); | 80 bool destroy_compositor_frame_sink); |
| 81 void OnCompositorFrameSinkPrivateConnectionLost( | 81 void OnCompositorFrameSinkPrivateConnectionLost( |
| 82 const cc::FrameSinkId& frame_sink_id, | 82 const cc::FrameSinkId& frame_sink_id, |
| 83 bool destroy_compositor_frame_sink); | 83 bool destroy_compositor_frame_sink); |
| 84 | 84 |
| 85 // cc::mojom::DisplayCompositor implementation: | 85 // cc::mojom::DisplayCompositor implementation: |
| 86 void CreateCompositorFrameSink( | 86 void CreateDisplayCompositorFrameSink( |
| 87 const cc::FrameSinkId& frame_sink_id, | 87 const cc::FrameSinkId& frame_sink_id, |
| 88 gpu::SurfaceHandle surface_handle, | 88 gpu::SurfaceHandle surface_handle, |
| 89 cc::mojom::MojoCompositorFrameSinkRequest request, | 89 cc::mojom::MojoCompositorFrameSinkRequest request, |
| 90 cc::mojom::MojoCompositorFrameSinkPrivateRequest private_request, | 90 cc::mojom::MojoCompositorFrameSinkPrivateRequest private_request, |
| 91 cc::mojom::MojoCompositorFrameSinkClientPtr client) override; | 91 cc::mojom::MojoCompositorFrameSinkClientPtr client) override; |
| 92 void CreateOffscreenCompositorFrameSink( |
| 93 const cc::FrameSinkId& frame_sink_id, |
| 94 cc::mojom::MojoCompositorFrameSinkRequest request, |
| 95 cc::mojom::MojoCompositorFrameSinkPrivateRequest private_request, |
| 96 cc::mojom::MojoCompositorFrameSinkClientPtr client) override; |
| 92 | 97 |
| 93 private: | 98 private: |
| 94 friend class test::DisplayCompositorTest; | 99 friend class test::DisplayCompositorTest; |
| 95 | 100 |
| 96 void AddSurfaceReference(const cc::SurfaceReference& ref); | 101 void AddSurfaceReference(const cc::SurfaceReference& ref); |
| 97 void RemoveSurfaceReference(const cc::SurfaceReference& ref); | 102 void RemoveSurfaceReference(const cc::SurfaceReference& ref); |
| 98 | 103 |
| 99 std::unique_ptr<cc::Display> CreateDisplay( | 104 std::unique_ptr<cc::Display> CreateDisplay( |
| 100 const cc::FrameSinkId& frame_sink_id, | 105 const cc::FrameSinkId& frame_sink_id, |
| 101 gpu::SurfaceHandle surface_handle, | 106 gpu::SurfaceHandle surface_handle, |
| 102 cc::SyntheticBeginFrameSource* begin_frame_source); | 107 cc::SyntheticBeginFrameSource* begin_frame_source); |
| 103 | 108 |
| 109 void CreateCompositorFrameSinkInternal( |
| 110 const cc::FrameSinkId& frame_sink_id, |
| 111 gpu::SurfaceHandle surface_handle, |
| 112 std::unique_ptr<cc::Display> display, |
| 113 std::unique_ptr<cc::SyntheticBeginFrameSource> begin_frame_source, |
| 114 cc::mojom::MojoCompositorFrameSinkRequest request, |
| 115 cc::mojom::MojoCompositorFrameSinkPrivateRequest private_request, |
| 116 cc::mojom::MojoCompositorFrameSinkClientPtr client); |
| 117 |
| 104 const cc::SurfaceId& GetRootSurfaceId() const; | 118 const cc::SurfaceId& GetRootSurfaceId() const; |
| 105 | 119 |
| 106 // cc::SurfaceObserver implementation. | 120 // cc::SurfaceObserver implementation. |
| 107 void OnSurfaceCreated(const cc::SurfaceId& surface_id, | 121 void OnSurfaceCreated(const cc::SurfaceId& surface_id, |
| 108 const gfx::Size& frame_size, | 122 const gfx::Size& frame_size, |
| 109 float device_scale_factor) override; | 123 float device_scale_factor) override; |
| 110 void OnSurfaceDamaged(const cc::SurfaceId& surface_id, | 124 void OnSurfaceDamaged(const cc::SurfaceId& surface_id, |
| 111 bool* changed) override; | 125 bool* changed) override; |
| 112 | 126 |
| 113 // SurfaceManager should be the first object constructed and the last object | 127 // SurfaceManager should be the first object constructed and the last object |
| (...skipping 30 matching lines...) Expand all Loading... |
| 144 | 158 |
| 145 cc::mojom::DisplayCompositorClientPtr client_; | 159 cc::mojom::DisplayCompositorClientPtr client_; |
| 146 mojo::Binding<cc::mojom::DisplayCompositor> binding_; | 160 mojo::Binding<cc::mojom::DisplayCompositor> binding_; |
| 147 | 161 |
| 148 DISALLOW_COPY_AND_ASSIGN(DisplayCompositor); | 162 DISALLOW_COPY_AND_ASSIGN(DisplayCompositor); |
| 149 }; | 163 }; |
| 150 | 164 |
| 151 } // namespace ui | 165 } // namespace ui |
| 152 | 166 |
| 153 #endif // SERVICES_UI_SURFACES_DISPLAY_COMPOSITOR_H_ | 167 #endif // SERVICES_UI_SURFACES_DISPLAY_COMPOSITOR_H_ |
| OLD | NEW |