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

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

Issue 458313002: Browser side OZONE_NATIVE_BUFFER allocation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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_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 #if defined(USE_OZONE)
11 namespace {
12 const int kBrowserClientId = 1;
13 } // namespace
14 #endif // defined(USE_OZONE)
reveman 2014/08/12 20:19:11 remove all this
achaulk 2014/08/12 21:38:01 Done.
10 15
11 // static 16 // static
12 scoped_ptr<GpuMemoryBufferImpl> GpuMemoryBufferImpl::Create( 17 scoped_ptr<GpuMemoryBufferImpl> GpuMemoryBufferImpl::Create(
13 const gfx::Size& size, 18 const gfx::Size& size,
14 unsigned internalformat, 19 unsigned internalformat,
15 unsigned usage) { 20 unsigned usage) {
16 if (GpuMemoryBufferImplSharedMemory::IsConfigurationSupported( 21 if (GpuMemoryBufferImplSharedMemory::IsConfigurationSupported(
17 size, internalformat, usage)) { 22 size, internalformat, usage)) {
18 scoped_ptr<GpuMemoryBufferImplSharedMemory> buffer( 23 scoped_ptr<GpuMemoryBufferImplSharedMemory> buffer(
19 new GpuMemoryBufferImplSharedMemory(size, internalformat)); 24 new GpuMemoryBufferImplSharedMemory(size, internalformat));
20 if (!buffer->Initialize()) 25 if (!buffer->Initialize())
21 return scoped_ptr<GpuMemoryBufferImpl>(); 26 return scoped_ptr<GpuMemoryBufferImpl>();
22 27
23 return buffer.PassAs<GpuMemoryBufferImpl>(); 28 return buffer.PassAs<GpuMemoryBufferImpl>();
24 } 29 }
25 30
26 return scoped_ptr<GpuMemoryBufferImpl>(); 31 return scoped_ptr<GpuMemoryBufferImpl>();
27 } 32 }
28 33
29 // static 34 // static
30 void GpuMemoryBufferImpl::AllocateForChildProcess( 35 void GpuMemoryBufferImpl::AllocateForChildProcess(
31 const gfx::Size& size, 36 const gfx::Size& size,
32 unsigned internalformat, 37 unsigned internalformat,
33 unsigned usage, 38 unsigned usage,
34 base::ProcessHandle child_process, 39 base::ProcessHandle child_process,
40 int child_id,
41 GpuMemoryBufferFactoryHost* factory_host,
35 const AllocationCallback& callback) { 42 const AllocationCallback& callback) {
36 if (GpuMemoryBufferImplSharedMemory::IsConfigurationSupported( 43 if (GpuMemoryBufferImplSharedMemory::IsConfigurationSupported(
37 size, internalformat, usage)) { 44 size, internalformat, usage)) {
38 GpuMemoryBufferImplSharedMemory::AllocateSharedMemoryForChildProcess( 45 GpuMemoryBufferImplSharedMemory::AllocateSharedMemoryForChildProcess(
39 size, internalformat, child_process, callback); 46 size, internalformat, child_process, callback);
40 return; 47 return;
41 } 48 }
42 49
43 callback.Run(gfx::GpuMemoryBufferHandle()); 50 callback.Run(gfx::GpuMemoryBufferHandle());
44 } 51 }
(...skipping 18 matching lines...) Expand all
63 return scoped_ptr<GpuMemoryBufferImpl>(); 70 return scoped_ptr<GpuMemoryBufferImpl>();
64 71
65 return buffer.PassAs<GpuMemoryBufferImpl>(); 72 return buffer.PassAs<GpuMemoryBufferImpl>();
66 } 73 }
67 default: 74 default:
68 return scoped_ptr<GpuMemoryBufferImpl>(); 75 return scoped_ptr<GpuMemoryBufferImpl>();
69 } 76 }
70 } 77 }
71 78
72 } // namespace content 79 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698