OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/gpu/gpu_service.h" | 5 #include "services/ui/gpu/gpu_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/shared_memory.h" | 8 #include "base/memory/shared_memory.h" |
9 #include "base/threading/thread_task_runner_handle.h" | 9 #include "base/threading/thread_task_runner_handle.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 gpu_channel_manager_.reset(); | 53 gpu_channel_manager_.reset(); |
54 owned_sync_point_manager_.reset(); | 54 owned_sync_point_manager_.reset(); |
55 | 55 |
56 // Signal this event before destroying the child process. That way all | 56 // Signal this event before destroying the child process. That way all |
57 // background threads can cleanup. | 57 // background threads can cleanup. |
58 // For example, in the renderer the RenderThread instances will be able to | 58 // For example, in the renderer the RenderThread instances will be able to |
59 // notice shutdown before the render process begins waiting for them to exit. | 59 // notice shutdown before the render process begins waiting for them to exit. |
60 shutdown_event_.Signal(); | 60 shutdown_event_.Signal(); |
61 } | 61 } |
62 | 62 |
63 void GpuService::InitializeWithHost(mojom::GpuHostPtr gpu_host) { | 63 void GpuService::InitializeWithHost(mojom::GpuHostPtr gpu_host, |
| 64 const gpu::GpuPreferences& preferences) { |
64 DCHECK(CalledOnValidThread()); | 65 DCHECK(CalledOnValidThread()); |
65 DCHECK(!gpu_host_); | 66 DCHECK(!gpu_host_); |
66 gpu_host_ = std::move(gpu_host); | 67 gpu_host_ = std::move(gpu_host); |
| 68 gpu_preferences_ = preferences; |
67 gpu_info_.video_decode_accelerator_capabilities = | 69 gpu_info_.video_decode_accelerator_capabilities = |
68 media::GpuVideoDecodeAccelerator::GetCapabilities(gpu_preferences_); | 70 media::GpuVideoDecodeAccelerator::GetCapabilities(gpu_preferences_); |
69 gpu_info_.video_encode_accelerator_supported_profiles = | 71 gpu_info_.video_encode_accelerator_supported_profiles = |
70 media::GpuVideoEncodeAccelerator::GetSupportedProfiles(gpu_preferences_); | 72 media::GpuVideoEncodeAccelerator::GetSupportedProfiles(gpu_preferences_); |
71 gpu_info_.jpeg_decode_accelerator_supported = | 73 gpu_info_.jpeg_decode_accelerator_supported = |
72 media::GpuJpegDecodeAccelerator::IsSupported(); | 74 media::GpuJpegDecodeAccelerator::IsSupported(); |
73 gpu_host_->DidInitialize(gpu_info_); | 75 gpu_host_->DidInitialize(gpu_info_); |
74 | 76 |
75 DCHECK(!owned_sync_point_manager_); | 77 DCHECK(!owned_sync_point_manager_); |
76 const bool allow_threaded_wait = false; | 78 const bool allow_threaded_wait = false; |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 mojo::ScopedMessagePipeHandle channel_handle; | 172 mojo::ScopedMessagePipeHandle channel_handle; |
171 IPC::ChannelHandle handle = gpu_channel_manager_->EstablishChannel( | 173 IPC::ChannelHandle handle = gpu_channel_manager_->EstablishChannel( |
172 client_id, client_tracing_id, preempts, allow_view_command_buffers, | 174 client_id, client_tracing_id, preempts, allow_view_command_buffers, |
173 allow_real_time_streams); | 175 allow_real_time_streams); |
174 channel_handle.reset(handle.mojo_handle); | 176 channel_handle.reset(handle.mojo_handle); |
175 media_gpu_channel_manager_->AddChannel(client_id); | 177 media_gpu_channel_manager_->AddChannel(client_id); |
176 callback.Run(std::move(channel_handle)); | 178 callback.Run(std::move(channel_handle)); |
177 } | 179 } |
178 | 180 |
179 } // namespace ui | 181 } // namespace ui |
OLD | NEW |