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

Side by Side Diff: content/gpu/gpu_child_thread.cc

Issue 1726303002: Added initial Vulkan build files as well as a basic implementation file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added queue and global accessors Created 4 years, 9 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/gpu/gpu_child_thread.h" 5 #include "content/gpu/gpu_child_thread.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 20 matching lines...) Expand all
31 #include "ipc/ipc_sync_message_filter.h" 31 #include "ipc/ipc_sync_message_filter.h"
32 #include "ui/gl/gl_implementation.h" 32 #include "ui/gl/gl_implementation.h"
33 #include "ui/gl/gl_switches.h" 33 #include "ui/gl/gl_switches.h"
34 #include "ui/gl/gpu_switching_manager.h" 34 #include "ui/gl/gpu_switching_manager.h"
35 35
36 #if defined(USE_OZONE) 36 #if defined(USE_OZONE)
37 #include "ui/ozone/public/gpu_platform_support.h" 37 #include "ui/ozone/public/gpu_platform_support.h"
38 #include "ui/ozone/public/ozone_platform.h" 38 #include "ui/ozone/public/ozone_platform.h"
39 #endif 39 #endif
40 40
41 #if defined(ENABLE_VULKAN)
42 #include "gpu/vulkan/vulkan_surface.h"
43 #endif
44
41 namespace content { 45 namespace content {
42 namespace { 46 namespace {
43 47
44 static base::LazyInstance<scoped_refptr<ThreadSafeSender> > 48 static base::LazyInstance<scoped_refptr<ThreadSafeSender> >
45 g_thread_safe_sender = LAZY_INSTANCE_INITIALIZER; 49 g_thread_safe_sender = LAZY_INSTANCE_INITIALIZER;
46 50
47 bool GetSizeTFromSwitch(const base::CommandLine* command_line, 51 bool GetSizeTFromSwitch(const base::CommandLine* command_line,
48 const base::StringPiece& switch_string, 52 const base::StringPiece& switch_string,
49 size_t* value) { 53 size_t* value) {
50 if (!command_line->HasSwitch(switch_string)) 54 if (!command_line->HasSwitch(switch_string))
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 DCHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( 195 DCHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(
192 switches::kSingleProcess) || 196 switches::kSingleProcess) ||
193 base::CommandLine::ForCurrentProcess()->HasSwitch( 197 base::CommandLine::ForCurrentProcess()->HasSwitch(
194 switches::kInProcessGPU)); 198 switches::kInProcessGPU));
195 199
196 // Populate accelerator capabilities (normally done during GpuMain, which is 200 // Populate accelerator capabilities (normally done during GpuMain, which is
197 // not called for single process or in process gpu). 201 // not called for single process or in process gpu).
198 gpu_info_.video_decode_accelerator_capabilities = 202 gpu_info_.video_decode_accelerator_capabilities =
199 content::GpuVideoDecodeAccelerator::GetCapabilities(); 203 content::GpuVideoDecodeAccelerator::GetCapabilities();
200 204
205 #if defined(ENABLE_VULKAN)
206 // Temporary Vulkan initialization injection.
207 gfx::VulkanSurface::InitializeOneOff();
208 #endif
209
201 if (!gfx::GLSurface::InitializeOneOff()) 210 if (!gfx::GLSurface::InitializeOneOff())
202 VLOG(1) << "gfx::GLSurface::InitializeOneOff failed"; 211 VLOG(1) << "gfx::GLSurface::InitializeOneOff failed";
203 212
204 g_thread_safe_sender.Get() = thread_safe_sender(); 213 g_thread_safe_sender.Get() = thread_safe_sender();
205 } 214 }
206 215
207 GpuChildThread::~GpuChildThread() { 216 GpuChildThread::~GpuChildThread() {
208 while (!deferred_messages_.empty()) { 217 while (!deferred_messages_.empty()) {
209 delete deferred_messages_.front(); 218 delete deferred_messages_.front();
210 deferred_messages_.pop(); 219 deferred_messages_.pop();
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 616
608 void GpuChildThread::BindProcessControlRequest( 617 void GpuChildThread::BindProcessControlRequest(
609 mojo::InterfaceRequest<ProcessControl> request) { 618 mojo::InterfaceRequest<ProcessControl> request) {
610 DVLOG(1) << "GPU: Binding ProcessControl request"; 619 DVLOG(1) << "GPU: Binding ProcessControl request";
611 DCHECK(process_control_); 620 DCHECK(process_control_);
612 process_control_bindings_.AddBinding(process_control_.get(), 621 process_control_bindings_.AddBinding(process_control_.get(),
613 std::move(request)); 622 std::move(request));
614 } 623 }
615 624
616 } // namespace content 625 } // namespace content
OLDNEW
« no previous file with comments | « content/gpu/BUILD.gn ('k') | content/gpu/gpu_main.cc » ('j') | gpu/vulkan/OWNERS » ('J')

Powered by Google App Engine
This is Rietveld 408576698