| 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> |
| 11 #include <unordered_map> | 11 #include <unordered_map> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/threading/thread_checker.h" | 15 #include "base/threading/thread_checker.h" |
| 16 #include "cc/ipc/display_compositor.mojom.h" | 16 #include "cc/ipc/display_compositor.mojom.h" |
| 17 #include "cc/surfaces/frame_sink_id.h" | 17 #include "cc/surfaces/frame_sink_id.h" |
| 18 #include "cc/surfaces/framesink_manager.h" |
| 18 #include "cc/surfaces/local_surface_id.h" | 19 #include "cc/surfaces/local_surface_id.h" |
| 19 #include "cc/surfaces/surface_id.h" | 20 #include "cc/surfaces/surface_id.h" |
| 20 #include "cc/surfaces/surface_manager.h" | 21 #include "cc/surfaces/surface_manager.h" |
| 21 #include "cc/surfaces/surface_observer.h" | 22 #include "cc/surfaces/surface_observer.h" |
| 22 #include "components/display_compositor/gpu_compositor_frame_sink_delegate.h" | 23 #include "components/display_compositor/gpu_compositor_frame_sink_delegate.h" |
| 23 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" | 24 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" |
| 24 #include "gpu/ipc/common/surface_handle.h" | 25 #include "gpu/ipc/common/surface_handle.h" |
| 25 #include "gpu/ipc/in_process_command_buffer.h" | 26 #include "gpu/ipc/in_process_command_buffer.h" |
| 26 #include "ipc/ipc_channel_handle.h" | 27 #include "ipc/ipc_channel_handle.h" |
| 27 #include "mojo/public/cpp/bindings/binding.h" | 28 #include "mojo/public/cpp/bindings/binding.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 102 |
| 102 // cc::SurfaceObserver implementation. | 103 // cc::SurfaceObserver implementation. |
| 103 void OnSurfaceCreated(const cc::SurfaceInfo& surface_info) override; | 104 void OnSurfaceCreated(const cc::SurfaceInfo& surface_info) override; |
| 104 void OnSurfaceDamaged(const cc::SurfaceId& surface_id, | 105 void OnSurfaceDamaged(const cc::SurfaceId& surface_id, |
| 105 bool* changed) override; | 106 bool* changed) override; |
| 106 | 107 |
| 107 // SurfaceManager should be the first object constructed and the last object | 108 // SurfaceManager should be the first object constructed and the last object |
| 108 // destroyed in order to ensure that all other objects that depend on it have | 109 // destroyed in order to ensure that all other objects that depend on it have |
| 109 // access to a valid pointer for the entirety of their liftimes. | 110 // access to a valid pointer for the entirety of their liftimes. |
| 110 cc::SurfaceManager manager_; | 111 cc::SurfaceManager manager_; |
| 112 cc::FrameSinkManager framesink_manager_; |
| 111 | 113 |
| 112 scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_service_; | 114 scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_service_; |
| 113 std::unique_ptr<gpu::GpuMemoryBufferManager> gpu_memory_buffer_manager_; | 115 std::unique_ptr<gpu::GpuMemoryBufferManager> gpu_memory_buffer_manager_; |
| 114 gpu::ImageFactory* image_factory_; | 116 gpu::ImageFactory* image_factory_; |
| 115 | 117 |
| 116 std::unordered_map< | 118 std::unordered_map< |
| 117 cc::FrameSinkId, | 119 cc::FrameSinkId, |
| 118 std::unique_ptr<display_compositor::GpuCompositorFrameSink>, | 120 std::unique_ptr<display_compositor::GpuCompositorFrameSink>, |
| 119 cc::FrameSinkIdHash> | 121 cc::FrameSinkIdHash> |
| 120 compositor_frame_sinks_; | 122 compositor_frame_sinks_; |
| 121 | 123 |
| 122 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 124 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 123 | 125 |
| 124 base::ThreadChecker thread_checker_; | 126 base::ThreadChecker thread_checker_; |
| 125 | 127 |
| 126 cc::mojom::DisplayCompositorClientPtr client_; | 128 cc::mojom::DisplayCompositorClientPtr client_; |
| 127 mojo::Binding<cc::mojom::DisplayCompositor> binding_; | 129 mojo::Binding<cc::mojom::DisplayCompositor> binding_; |
| 128 | 130 |
| 129 DISALLOW_COPY_AND_ASSIGN(DisplayCompositor); | 131 DISALLOW_COPY_AND_ASSIGN(DisplayCompositor); |
| 130 }; | 132 }; |
| 131 | 133 |
| 132 } // namespace ui | 134 } // namespace ui |
| 133 | 135 |
| 134 #endif // SERVICES_UI_SURFACES_DISPLAY_COMPOSITOR_H_ | 136 #endif // SERVICES_UI_SURFACES_DISPLAY_COMPOSITOR_H_ |
| OLD | NEW |