| OLD | NEW |
| 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 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 return scoped_ptr<GpuMemoryBufferImpl>(); | 26 return scoped_ptr<GpuMemoryBufferImpl>(); |
| 27 } | 27 } |
| 28 | 28 |
| 29 // static | 29 // static |
| 30 void GpuMemoryBufferImpl::AllocateForChildProcess( | 30 void GpuMemoryBufferImpl::AllocateForChildProcess( |
| 31 const gfx::Size& size, | 31 const gfx::Size& size, |
| 32 unsigned internalformat, | 32 unsigned internalformat, |
| 33 unsigned usage, | 33 unsigned usage, |
| 34 base::ProcessHandle child_process, | 34 base::ProcessHandle child_process, |
| 35 int child_id, |
| 36 GpuMemoryBufferFactoryHost* factory_host, |
| 35 const AllocationCallback& callback) { | 37 const AllocationCallback& callback) { |
| 36 if (GpuMemoryBufferImplSharedMemory::IsConfigurationSupported( | 38 if (GpuMemoryBufferImplSharedMemory::IsConfigurationSupported( |
| 37 size, internalformat, usage)) { | 39 size, internalformat, usage)) { |
| 38 GpuMemoryBufferImplSharedMemory::AllocateSharedMemoryForChildProcess( | 40 GpuMemoryBufferImplSharedMemory::AllocateSharedMemoryForChildProcess( |
| 39 size, internalformat, child_process, callback); | 41 size, internalformat, child_process, callback); |
| 40 return; | 42 return; |
| 41 } | 43 } |
| 42 | 44 |
| 43 callback.Run(gfx::GpuMemoryBufferHandle()); | 45 callback.Run(gfx::GpuMemoryBufferHandle()); |
| 44 } | 46 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 63 return scoped_ptr<GpuMemoryBufferImpl>(); | 65 return scoped_ptr<GpuMemoryBufferImpl>(); |
| 64 | 66 |
| 65 return buffer.PassAs<GpuMemoryBufferImpl>(); | 67 return buffer.PassAs<GpuMemoryBufferImpl>(); |
| 66 } | 68 } |
| 67 default: | 69 default: |
| 68 return scoped_ptr<GpuMemoryBufferImpl>(); | 70 return scoped_ptr<GpuMemoryBufferImpl>(); |
| 69 } | 71 } |
| 70 } | 72 } |
| 71 | 73 |
| 72 } // namespace content | 74 } // namespace content |
| OLD | NEW |