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

Side by Side Diff: content/browser/renderer_host/gpu_message_filter.cc

Issue 1575293002: Allow GPU channels to be created when using SwiftShader (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pass correct GPUInfo Created 4 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 | « content/browser/gpu/gpu_process_host.cc ('k') | content/renderer/render_widget.h » ('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 (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 #if defined(OS_WIN) 5 #if defined(OS_WIN)
6 #include <windows.h> 6 #include <windows.h>
7 #endif 7 #endif
8 8
9 #include "content/browser/renderer_host/gpu_message_filter.h" 9 #include "content/browser/renderer_host/gpu_message_filter.h"
10 10
(...skipping 26 matching lines...) Expand all
37 IPC_MESSAGE_UNHANDLED(handled = false) 37 IPC_MESSAGE_UNHANDLED(handled = false)
38 IPC_END_MESSAGE_MAP() 38 IPC_END_MESSAGE_MAP()
39 return handled; 39 return handled;
40 } 40 }
41 41
42 void GpuMessageFilter::OnEstablishGpuChannel( 42 void GpuMessageFilter::OnEstablishGpuChannel(
43 CauseForGpuLaunch cause_for_gpu_launch, 43 CauseForGpuLaunch cause_for_gpu_launch,
44 IPC::Message* reply_ptr) { 44 IPC::Message* reply_ptr) {
45 DCHECK_CURRENTLY_ON(BrowserThread::IO); 45 DCHECK_CURRENTLY_ON(BrowserThread::IO);
46 scoped_ptr<IPC::Message> reply(reply_ptr); 46 scoped_ptr<IPC::Message> reply(reply_ptr);
47 if (!GpuDataManagerImpl::GetInstance()->CanUseGpuBrowserCompositor()) {
48 reply->set_reply_error();
49 Send(reply.release());
50 return;
51 }
52
53 GpuProcessHost* host = GpuProcessHost::FromID(gpu_process_id_); 47 GpuProcessHost* host = GpuProcessHost::FromID(gpu_process_id_);
54 if (!host) { 48 if (!host) {
55 host = GpuProcessHost::Get(GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, 49 host = GpuProcessHost::Get(GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED,
56 cause_for_gpu_launch); 50 cause_for_gpu_launch);
57 if (!host) { 51 if (!host) {
58 reply->set_reply_error(); 52 reply->set_reply_error();
59 Send(reply.release()); 53 Send(reply.release());
60 return; 54 return;
61 } 55 }
62 56
(...skipping 18 matching lines...) Expand all
81 const IPC::ChannelHandle& channel, 75 const IPC::ChannelHandle& channel,
82 const gpu::GPUInfo& gpu_info) { 76 const gpu::GPUInfo& gpu_info) {
83 DCHECK_CURRENTLY_ON(BrowserThread::IO); 77 DCHECK_CURRENTLY_ON(BrowserThread::IO);
84 78
85 GpuHostMsg_EstablishGpuChannel::WriteReplyParams( 79 GpuHostMsg_EstablishGpuChannel::WriteReplyParams(
86 reply.get(), render_process_id_, channel, gpu_info); 80 reply.get(), render_process_id_, channel, gpu_info);
87 Send(reply.release()); 81 Send(reply.release());
88 } 82 }
89 83
90 } // namespace content 84 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_process_host.cc ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698