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/debug/crash_logging.h" | 8 #include "base/debug/crash_logging.h" |
9 #include "base/memory/shared_memory.h" | 9 #include "base/memory/shared_memory.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 media::GpuVideoDecodeAccelerator::GetCapabilities(gpu_preferences_); | 76 media::GpuVideoDecodeAccelerator::GetCapabilities(gpu_preferences_); |
77 gpu_info_.video_encode_accelerator_supported_profiles = | 77 gpu_info_.video_encode_accelerator_supported_profiles = |
78 media::GpuVideoEncodeAccelerator::GetSupportedProfiles(gpu_preferences_); | 78 media::GpuVideoEncodeAccelerator::GetSupportedProfiles(gpu_preferences_); |
79 gpu_info_.jpeg_decode_accelerator_supported = | 79 gpu_info_.jpeg_decode_accelerator_supported = |
80 media::GpuJpegDecodeAcceleratorFactoryProvider:: | 80 media::GpuJpegDecodeAcceleratorFactoryProvider:: |
81 IsAcceleratedJpegDecodeSupported(); | 81 IsAcceleratedJpegDecodeSupported(); |
82 gpu_host_->DidInitialize(gpu_info_); | 82 gpu_host_->DidInitialize(gpu_info_); |
83 | 83 |
84 sync_point_manager_ = sync_point_manager; | 84 sync_point_manager_ = sync_point_manager; |
85 if (!sync_point_manager_) { | 85 if (!sync_point_manager_) { |
86 const bool allow_threaded_wait = false; | 86 owned_sync_point_manager_ = base::MakeUnique<gpu::SyncPointManager>(); |
87 owned_sync_point_manager_ = | |
88 base::MakeUnique<gpu::SyncPointManager>(allow_threaded_wait); | |
89 sync_point_manager_ = owned_sync_point_manager_.get(); | 87 sync_point_manager_ = owned_sync_point_manager_.get(); |
90 } | 88 } |
91 | 89 |
92 // Defer creation of the render thread. This is to prevent it from handling | 90 // Defer creation of the render thread. This is to prevent it from handling |
93 // IPC messages before the sandbox has been enabled and all other necessary | 91 // IPC messages before the sandbox has been enabled and all other necessary |
94 // initialization has succeeded. | 92 // initialization has succeeded. |
95 gpu_channel_manager_.reset(new gpu::GpuChannelManager( | 93 gpu_channel_manager_.reset(new gpu::GpuChannelManager( |
96 gpu_preferences_, this, watchdog_thread_.get(), | 94 gpu_preferences_, this, watchdog_thread_.get(), |
97 base::ThreadTaskRunnerHandle::Get().get(), io_runner_.get(), | 95 base::ThreadTaskRunnerHandle::Get().get(), io_runner_.get(), |
98 shutdown_event ? shutdown_event : &shutdown_event_, sync_point_manager_, | 96 shutdown_event ? shutdown_event : &shutdown_event_, sync_point_manager_, |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 mojo::ScopedMessagePipeHandle channel_handle; | 181 mojo::ScopedMessagePipeHandle channel_handle; |
184 IPC::ChannelHandle handle = gpu_channel_manager_->EstablishChannel( | 182 IPC::ChannelHandle handle = gpu_channel_manager_->EstablishChannel( |
185 client_id, client_tracing_id, preempts, allow_view_command_buffers, | 183 client_id, client_tracing_id, preempts, allow_view_command_buffers, |
186 allow_real_time_streams); | 184 allow_real_time_streams); |
187 channel_handle.reset(handle.mojo_handle); | 185 channel_handle.reset(handle.mojo_handle); |
188 media_gpu_channel_manager_->AddChannel(client_id); | 186 media_gpu_channel_manager_->AddChannel(client_id); |
189 callback.Run(std::move(channel_handle)); | 187 callback.Run(std::move(channel_handle)); |
190 } | 188 } |
191 | 189 |
192 } // namespace ui | 190 } // namespace ui |
OLD | NEW |