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

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

Issue 1776453003: Added initial implementation of Vulkan Render Passes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gn_vulkan
Patch Set: Layout transitions done through render passes 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 22 matching lines...) Expand all
33 #include "ipc/ipc_sync_message_filter.h" 33 #include "ipc/ipc_sync_message_filter.h"
34 #include "ui/gl/gl_implementation.h" 34 #include "ui/gl/gl_implementation.h"
35 #include "ui/gl/gl_switches.h" 35 #include "ui/gl/gl_switches.h"
36 #include "ui/gl/gpu_switching_manager.h" 36 #include "ui/gl/gpu_switching_manager.h"
37 37
38 #if defined(USE_OZONE) 38 #if defined(USE_OZONE)
39 #include "ui/ozone/public/gpu_platform_support.h" 39 #include "ui/ozone/public/gpu_platform_support.h"
40 #include "ui/ozone/public/ozone_platform.h" 40 #include "ui/ozone/public/ozone_platform.h"
41 #endif 41 #endif
42 42
43 #if defined(ENABLE_VULKAN)
44 #include "gpu/vulkan/vulkan_surface.h"
45 #endif
46
47 namespace content { 43 namespace content {
48 namespace { 44 namespace {
49 45
50 static base::LazyInstance<scoped_refptr<ThreadSafeSender> > 46 static base::LazyInstance<scoped_refptr<ThreadSafeSender> >
51 g_thread_safe_sender = LAZY_INSTANCE_INITIALIZER; 47 g_thread_safe_sender = LAZY_INSTANCE_INITIALIZER;
52 48
53 bool GetSizeTFromSwitch(const base::CommandLine* command_line, 49 bool GetSizeTFromSwitch(const base::CommandLine* command_line,
54 const base::StringPiece& switch_string, 50 const base::StringPiece& switch_string,
55 size_t* value) { 51 size_t* value) {
56 if (!command_line->HasSwitch(switch_string)) 52 if (!command_line->HasSwitch(switch_string))
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 DCHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( 193 DCHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(
198 switches::kSingleProcess) || 194 switches::kSingleProcess) ||
199 base::CommandLine::ForCurrentProcess()->HasSwitch( 195 base::CommandLine::ForCurrentProcess()->HasSwitch(
200 switches::kInProcessGPU)); 196 switches::kInProcessGPU));
201 197
202 // Populate accelerator capabilities (normally done during GpuMain, which is 198 // Populate accelerator capabilities (normally done during GpuMain, which is
203 // not called for single process or in process gpu). 199 // not called for single process or in process gpu).
204 gpu_info_.video_decode_accelerator_capabilities = 200 gpu_info_.video_decode_accelerator_capabilities =
205 content::GpuVideoDecodeAccelerator::GetCapabilities(); 201 content::GpuVideoDecodeAccelerator::GetCapabilities();
206 202
207 #if defined(ENABLE_VULKAN)
208 // Temporary Vulkan initialization injection.
209 gpu::VulkanSurface::InitializeOneOff();
210 #endif
211
212 if (!gfx::GLSurface::InitializeOneOff()) 203 if (!gfx::GLSurface::InitializeOneOff())
213 VLOG(1) << "gfx::GLSurface::InitializeOneOff failed"; 204 VLOG(1) << "gfx::GLSurface::InitializeOneOff failed";
214 205
215 g_thread_safe_sender.Get() = thread_safe_sender(); 206 g_thread_safe_sender.Get() = thread_safe_sender();
216 } 207 }
217 208
218 GpuChildThread::~GpuChildThread() { 209 GpuChildThread::~GpuChildThread() {
219 while (!deferred_messages_.empty()) { 210 while (!deferred_messages_.empty()) {
220 delete deferred_messages_.front(); 211 delete deferred_messages_.front();
221 deferred_messages_.pop(); 212 deferred_messages_.pop();
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 614
624 void GpuChildThread::BindProcessControlRequest( 615 void GpuChildThread::BindProcessControlRequest(
625 mojo::InterfaceRequest<ProcessControl> request) { 616 mojo::InterfaceRequest<ProcessControl> request) {
626 DVLOG(1) << "GPU: Binding ProcessControl request"; 617 DVLOG(1) << "GPU: Binding ProcessControl request";
627 DCHECK(process_control_); 618 DCHECK(process_control_);
628 process_control_bindings_.AddBinding(process_control_.get(), 619 process_control_bindings_.AddBinding(process_control_.get(),
629 std::move(request)); 620 std::move(request));
630 } 621 }
631 622
632 } // namespace content 623 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698