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

Side by Side Diff: content/common/gpu/client/gpu_memory_buffer_impl_ozone.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_ozone_native_buffer.h " 7 #include "content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.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 (GpuMemoryBufferImplOzoneNativeBuffer::IsConfigurationSupported( 18 if (GpuMemoryBufferImplOzoneNativeBuffer::IsConfigurationSupported(
18 internalformat, usage)) { 19 internalformat, usage)) {
19 GpuMemoryBufferImplOzoneNativeBuffer::Create( 20 GpuMemoryBufferImplOzoneNativeBuffer::Create(
20 size, internalformat, usage, callback); 21 size, internalformat, usage, client_id, callback);
21 return; 22 return;
22 } 23 }
23 24
24 if (GpuMemoryBufferImplSharedMemory::IsConfigurationSupported( 25 if (GpuMemoryBufferImplSharedMemory::IsConfigurationSupported(
25 size, internalformat, usage)) { 26 size, internalformat, usage)) {
26 GpuMemoryBufferImplSharedMemory::Create( 27 GpuMemoryBufferImplSharedMemory::Create(
27 size, internalformat, usage, callback); 28 size, internalformat, usage, callback);
28 return; 29 return;
29 } 30 }
30 31
31 callback.Run(scoped_ptr<GpuMemoryBufferImpl>()); 32 callback.Run(scoped_ptr<GpuMemoryBufferImpl>());
32 } 33 }
33 34
34 // static 35 // static
35 void GpuMemoryBufferImpl::AllocateForChildProcess( 36 void GpuMemoryBufferImpl::AllocateForChildProcess(
36 const gfx::Size& size, 37 const gfx::Size& size,
37 unsigned internalformat, 38 unsigned internalformat,
38 unsigned usage, 39 unsigned usage,
39 base::ProcessHandle child_process, 40 base::ProcessHandle child_process,
40 int child_id, 41 int child_client_id,
41 const AllocationCallback& callback) { 42 const AllocationCallback& callback) {
42 if (GpuMemoryBufferImplOzoneNativeBuffer::IsConfigurationSupported( 43 if (GpuMemoryBufferImplOzoneNativeBuffer::IsConfigurationSupported(
43 internalformat, usage)) { 44 internalformat, usage)) {
44 GpuMemoryBufferImplOzoneNativeBuffer::AllocateOzoneNativeBufferForChildId( 45 GpuMemoryBufferImplOzoneNativeBuffer::AllocateOzoneNativeBufferForChildId(
45 size, internalformat, usage, child_id, callback); 46 size, internalformat, usage, child_client_id, callback);
46 return; 47 return;
47 } 48 }
48 if (GpuMemoryBufferImplSharedMemory::IsConfigurationSupported( 49 if (GpuMemoryBufferImplSharedMemory::IsConfigurationSupported(
49 size, internalformat, usage)) { 50 size, internalformat, usage)) {
50 GpuMemoryBufferImplSharedMemory::AllocateSharedMemoryForChildProcess( 51 GpuMemoryBufferImplSharedMemory::AllocateSharedMemoryForChildProcess(
51 size, internalformat, child_process, callback); 52 size, internalformat, child_process, callback);
52 return; 53 return;
53 } 54 }
54 55
55 callback.Run(gfx::GpuMemoryBufferHandle()); 56 callback.Run(gfx::GpuMemoryBufferHandle());
(...skipping 27 matching lines...) Expand all
83 return scoped_ptr<GpuMemoryBufferImpl>(); 84 return scoped_ptr<GpuMemoryBufferImpl>();
84 85
85 return buffer.PassAs<GpuMemoryBufferImpl>(); 86 return buffer.PassAs<GpuMemoryBufferImpl>();
86 } 87 }
87 default: 88 default:
88 return scoped_ptr<GpuMemoryBufferImpl>(); 89 return scoped_ptr<GpuMemoryBufferImpl>();
89 } 90 }
90 } 91 }
91 92
92 } // namespace content 93 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698