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 26 matching lines...) Expand all Loading... |
37 size, internalformat, usage)) { | 37 size, internalformat, usage)) { |
38 GpuMemoryBufferImplSharedMemory::AllocateSharedMemoryForChildProcess( | 38 GpuMemoryBufferImplSharedMemory::AllocateSharedMemoryForChildProcess( |
39 size, internalformat, child_process, callback); | 39 size, internalformat, child_process, callback); |
40 return; | 40 return; |
41 } | 41 } |
42 | 42 |
43 callback.Run(gfx::GpuMemoryBufferHandle()); | 43 callback.Run(gfx::GpuMemoryBufferHandle()); |
44 } | 44 } |
45 | 45 |
46 // static | 46 // static |
| 47 void GpuMemoryBufferImpl::DeletedByChildProcess( |
| 48 gfx::GpuMemoryBufferType type, |
| 49 const gfx::GpuMemoryBufferId& id, |
| 50 base::ProcessHandle child_process) { |
| 51 } |
| 52 |
| 53 // static |
47 scoped_ptr<GpuMemoryBufferImpl> GpuMemoryBufferImpl::CreateFromHandle( | 54 scoped_ptr<GpuMemoryBufferImpl> GpuMemoryBufferImpl::CreateFromHandle( |
48 gfx::GpuMemoryBufferHandle handle, | 55 const gfx::GpuMemoryBufferHandle& handle, |
49 const gfx::Size& size, | 56 const gfx::Size& size, |
50 unsigned internalformat) { | 57 unsigned internalformat) { |
51 switch (handle.type) { | 58 switch (handle.type) { |
52 case gfx::SHARED_MEMORY_BUFFER: { | 59 case gfx::SHARED_MEMORY_BUFFER: { |
53 scoped_ptr<GpuMemoryBufferImplSharedMemory> buffer( | 60 scoped_ptr<GpuMemoryBufferImplSharedMemory> buffer( |
54 new GpuMemoryBufferImplSharedMemory(size, internalformat)); | 61 new GpuMemoryBufferImplSharedMemory(size, internalformat)); |
55 if (!buffer->InitializeFromHandle(handle)) | 62 if (!buffer->InitializeFromHandle(handle)) |
56 return scoped_ptr<GpuMemoryBufferImpl>(); | 63 return scoped_ptr<GpuMemoryBufferImpl>(); |
57 | 64 |
58 return buffer.PassAs<GpuMemoryBufferImpl>(); | 65 return buffer.PassAs<GpuMemoryBufferImpl>(); |
59 } | 66 } |
60 default: | 67 default: |
61 return scoped_ptr<GpuMemoryBufferImpl>(); | 68 return scoped_ptr<GpuMemoryBufferImpl>(); |
62 } | 69 } |
63 } | 70 } |
64 | 71 |
65 } // namespace content | 72 } // namespace content |
OLD | NEW |