| 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 |
| 11 // static | 11 // static |
| 12 void GpuMemoryBufferImpl::Create(const gfx::Size& size, | 12 void GpuMemoryBufferImpl::Create(const gfx::Size& size, |
| 13 unsigned internalformat, | 13 unsigned internalformat, |
| 14 unsigned usage, | 14 unsigned usage, |
| 15 int gpu_client_id, |
| 15 const CreationCallback& callback) { | 16 const CreationCallback& callback) { |
| 16 if (GpuMemoryBufferImplSharedMemory::IsConfigurationSupported( | 17 if (GpuMemoryBufferImplSharedMemory::IsConfigurationSupported( |
| 17 size, internalformat, usage)) { | 18 size, internalformat, usage)) { |
| 18 GpuMemoryBufferImplSharedMemory::Create( | 19 GpuMemoryBufferImplSharedMemory::Create( |
| 19 size, internalformat, usage, callback); | 20 size, internalformat, usage, callback); |
| 20 return; | 21 return; |
| 21 } | 22 } |
| 22 | 23 |
| 23 callback.Run(scoped_ptr<GpuMemoryBufferImpl>()); | 24 callback.Run(scoped_ptr<GpuMemoryBufferImpl>()); |
| 24 } | 25 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 return scoped_ptr<GpuMemoryBufferImpl>(); | 62 return scoped_ptr<GpuMemoryBufferImpl>(); |
| 62 | 63 |
| 63 return buffer.PassAs<GpuMemoryBufferImpl>(); | 64 return buffer.PassAs<GpuMemoryBufferImpl>(); |
| 64 } | 65 } |
| 65 default: | 66 default: |
| 66 return scoped_ptr<GpuMemoryBufferImpl>(); | 67 return scoped_ptr<GpuMemoryBufferImpl>(); |
| 67 } | 68 } |
| 68 } | 69 } |
| 69 | 70 |
| 70 } // namespace content | 71 } // namespace content |
| OLD | NEW |