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

Side by Side Diff: content/common/gpu/client/gpu_memory_buffer_impl_win.cc

Issue 557353002: Remove the assumption about client_id from gpu memory buffer allocation on the browser side. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/common/gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/common/gpu/client/gpu_memory_buffer_impl.h" 5 #include "content/common/gpu/client/gpu_memory_buffer_impl.h"
6 6
7 #include "content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.h" 7 #include "content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.h"
8 8
9 namespace content { 9 namespace content {
10 10
11 // static 11 // static
12 void GpuMemoryBufferImpl::Create(const gfx::Size& size, 12 void GpuMemoryBufferImpl::Create(const gfx::Size& size,
13 unsigned internalformat, 13 unsigned internalformat,
14 unsigned usage, 14 unsigned usage,
15 int client_id,
15 const CreationCallback& callback) { 16 const CreationCallback& callback) {
16 if (GpuMemoryBufferImplSharedMemory::IsConfigurationSupported( 17 if (GpuMemoryBufferImplSharedMemory::IsConfigurationSupported(
17 size, internalformat, usage)) { 18 size, internalformat, usage)) {
18 GpuMemoryBufferImplSharedMemory::Create( 19 GpuMemoryBufferImplSharedMemory::Create(
19 size, internalformat, usage, callback); 20 size, internalformat, usage, callback);
20 return; 21 return;
21 } 22 }
22 23
23 callback.Run(scoped_ptr<GpuMemoryBufferImpl>()); 24 callback.Run(scoped_ptr<GpuMemoryBufferImpl>());
24 } 25 }
25 26
26 // static 27 // static
27 void GpuMemoryBufferImpl::AllocateForChildProcess( 28 void GpuMemoryBufferImpl::AllocateForChildProcess(
28 const gfx::Size& size, 29 const gfx::Size& size,
29 unsigned internalformat, 30 unsigned internalformat,
30 unsigned usage, 31 unsigned usage,
31 base::ProcessHandle child_process, 32 base::ProcessHandle child_process,
32 int child_id, 33 int child_client_id,
33 const AllocationCallback& callback) { 34 const AllocationCallback& callback) {
34 if (GpuMemoryBufferImplSharedMemory::IsConfigurationSupported( 35 if (GpuMemoryBufferImplSharedMemory::IsConfigurationSupported(
35 size, internalformat, usage)) { 36 size, internalformat, usage)) {
36 GpuMemoryBufferImplSharedMemory::AllocateSharedMemoryForChildProcess( 37 GpuMemoryBufferImplSharedMemory::AllocateSharedMemoryForChildProcess(
37 size, internalformat, child_process, callback); 38 size, internalformat, child_process, callback);
38 return; 39 return;
39 } 40 }
40 41
41 callback.Run(gfx::GpuMemoryBufferHandle()); 42 callback.Run(gfx::GpuMemoryBufferHandle());
42 } 43 }
(...skipping 18 matching lines...) Expand all
61 return scoped_ptr<GpuMemoryBufferImpl>(); 62 return scoped_ptr<GpuMemoryBufferImpl>();
62 63
63 return buffer.PassAs<GpuMemoryBufferImpl>(); 64 return buffer.PassAs<GpuMemoryBufferImpl>();
64 } 65 }
65 default: 66 default:
66 return scoped_ptr<GpuMemoryBufferImpl>(); 67 return scoped_ptr<GpuMemoryBufferImpl>();
67 } 68 }
68 } 69 }
69 70
70 } // namespace content 71 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698