| 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 #include "services/ui/surfaces/display_compositor.h" | 5 #include "services/ui/surfaces/display_compositor.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "cc/output/in_process_context_provider.h" | 9 #include "cc/output/in_process_context_provider.h" |
| 10 #include "cc/surfaces/surface.h" | 10 #include "cc/surfaces/surface.h" |
| 11 #include "gpu/command_buffer/client/shared_memory_limits.h" | 11 #include "gpu/command_buffer/client/shared_memory_limits.h" |
| 12 #include "gpu/ipc/gpu_in_process_thread_service.h" | 12 #include "gpu/ipc/gpu_in_process_thread_service.h" |
| 13 #include "mojo/public/cpp/bindings/strong_binding.h" | 13 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 14 #include "services/ui/common/mus_gpu_memory_buffer_manager.h" | 14 #include "services/ui/common/mus_gpu_memory_buffer_manager.h" |
| 15 #include "services/ui/surfaces/gpu_compositor_frame_sink.h" | 15 #include "services/ui/surfaces/gpu_compositor_frame_sink.h" |
| 16 | 16 |
| 17 namespace ui { | 17 namespace ui { |
| 18 | 18 |
| 19 DisplayCompositor::DisplayCompositor( | 19 DisplayCompositor::DisplayCompositor( |
| 20 scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_service, | 20 scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_service, |
| 21 std::unique_ptr<gpu::GpuMemoryBufferManager> gpu_memory_buffer_manager, | 21 std::unique_ptr<gpu::GpuMemoryBufferManager> gpu_memory_buffer_manager, |
| 22 gpu::ImageFactory* image_factory, | 22 gpu::ImageFactory* image_factory, |
| 23 cc::mojom::DisplayCompositorRequest request, | 23 cc::mojom::DisplayCompositorRequest request, |
| 24 cc::mojom::DisplayCompositorClientPtr client) | 24 cc::mojom::DisplayCompositorClientPtr client) |
| 25 : gpu_service_(std::move(gpu_service)), | 25 : manager_(cc::SurfaceManager::LifetimeType::USE_REFERENCES), |
| 26 gpu_service_(std::move(gpu_service)), |
| 26 gpu_memory_buffer_manager_(std::move(gpu_memory_buffer_manager)), | 27 gpu_memory_buffer_manager_(std::move(gpu_memory_buffer_manager)), |
| 27 image_factory_(image_factory), | 28 image_factory_(image_factory), |
| 28 client_(std::move(client)), | 29 client_(std::move(client)), |
| 29 reference_manager_(&manager_), | 30 reference_manager_(&manager_), |
| 30 binding_(this, std::move(request)) { | 31 binding_(this, std::move(request)) { |
| 31 manager_.AddObserver(this); | 32 manager_.AddObserver(this); |
| 32 } | 33 } |
| 33 | 34 |
| 34 void DisplayCompositor::CreateCompositorFrameSink( | 35 void DisplayCompositor::CreateCompositorFrameSink( |
| 35 const cc::FrameSinkId& frame_sink_id, | 36 const cc::FrameSinkId& frame_sink_id, |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 surface_id.local_frame_id()); | 177 surface_id.local_frame_id()); |
| 177 | 178 |
| 178 if (client_) | 179 if (client_) |
| 179 client_->OnSurfaceCreated(surface_id, frame_size, device_scale_factor); | 180 client_->OnSurfaceCreated(surface_id, frame_size, device_scale_factor); |
| 180 } | 181 } |
| 181 | 182 |
| 182 void DisplayCompositor::OnSurfaceDamaged(const cc::SurfaceId& surface_id, | 183 void DisplayCompositor::OnSurfaceDamaged(const cc::SurfaceId& surface_id, |
| 183 bool* changed) {} | 184 bool* changed) {} |
| 184 | 185 |
| 185 } // namespace ui | 186 } // namespace ui |
| OLD | NEW |