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

Side by Side Diff: content/common/gpu/client/gpu_memory_buffer_impl_mac.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
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_io_surface.h" 7 #include "content/common/gpu/client/gpu_memory_buffer_impl_io_surface.h"
8 #include "content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.h" 8 #include "content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.h"
9 9
10 namespace content { 10 namespace content {
11 11
12 // static 12 // static
13 void GpuMemoryBufferImpl::Create(const gfx::Size& size, 13 void GpuMemoryBufferImpl::Create(const gfx::Size& size,
14 unsigned internalformat, 14 unsigned internalformat,
15 unsigned usage, 15 unsigned usage,
16 int client_id,
16 const CreationCallback& callback) { 17 const CreationCallback& callback) {
17 if (GpuMemoryBufferImplSharedMemory::IsConfigurationSupported( 18 if (GpuMemoryBufferImplSharedMemory::IsConfigurationSupported(
18 size, internalformat, usage)) { 19 size, internalformat, usage)) {
19 GpuMemoryBufferImplSharedMemory::Create( 20 GpuMemoryBufferImplSharedMemory::Create(
20 size, internalformat, usage, callback); 21 size, internalformat, usage, callback);
21 return; 22 return;
22 } 23 }
23 24
24 callback.Run(scoped_ptr<GpuMemoryBufferImpl>()); 25 callback.Run(scoped_ptr<GpuMemoryBufferImpl>());
25 } 26 }
26 27
27 // static 28 // static
28 void GpuMemoryBufferImpl::AllocateForChildProcess( 29 void GpuMemoryBufferImpl::AllocateForChildProcess(
29 const gfx::Size& size, 30 const gfx::Size& size,
30 unsigned internalformat, 31 unsigned internalformat,
31 unsigned usage, 32 unsigned usage,
32 base::ProcessHandle child_process, 33 base::ProcessHandle child_process,
33 int child_id, 34 int child_client_id,
34 const AllocationCallback& callback) { 35 const AllocationCallback& callback) {
35 if (GpuMemoryBufferImplSharedMemory::IsConfigurationSupported( 36 if (GpuMemoryBufferImplSharedMemory::IsConfigurationSupported(
36 size, internalformat, usage)) { 37 size, internalformat, usage)) {
37 GpuMemoryBufferImplSharedMemory::AllocateSharedMemoryForChildProcess( 38 GpuMemoryBufferImplSharedMemory::AllocateSharedMemoryForChildProcess(
38 size, internalformat, child_process, callback); 39 size, internalformat, child_process, callback);
39 return; 40 return;
40 } 41 }
41 42
42 callback.Run(gfx::GpuMemoryBufferHandle()); 43 callback.Run(gfx::GpuMemoryBufferHandle());
43 } 44 }
(...skipping 26 matching lines...) Expand all
70 return scoped_ptr<GpuMemoryBufferImpl>(); 71 return scoped_ptr<GpuMemoryBufferImpl>();
71 72
72 return buffer.PassAs<GpuMemoryBufferImpl>(); 73 return buffer.PassAs<GpuMemoryBufferImpl>();
73 } 74 }
74 default: 75 default:
75 return scoped_ptr<GpuMemoryBufferImpl>(); 76 return scoped_ptr<GpuMemoryBufferImpl>();
76 } 77 }
77 } 78 }
78 79
79 } // namespace content 80 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/client/gpu_memory_buffer_impl_linux.cc ('k') | content/common/gpu/client/gpu_memory_buffer_impl_ozone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698