Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(384)

Side by Side Diff: services/ui/gpu/gpu_service.cc

Issue 2627993002: mus-gpu: Include GpuPreferences when requesting for GpuService. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « services/ui/gpu/gpu_service.h ('k') | services/ui/gpu/interfaces/gpu_host.mojom » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « services/ui/gpu/gpu_service.h ('k') | services/ui/gpu/interfaces/gpu_host.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698