Chromium Code Reviews| Index: content/common/gpu/client/gpu_memory_buffer_impl_ozone.cc |
| diff --git a/content/common/gpu/client/gpu_memory_buffer_impl_ozone.cc b/content/common/gpu/client/gpu_memory_buffer_impl_ozone.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ffd4e381c7d9276e27d51e5c9d027ecca96dd33c |
| --- /dev/null |
| +++ b/content/common/gpu/client/gpu_memory_buffer_impl_ozone.cc |
| @@ -0,0 +1,29 @@ |
| +// Copyright 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "content/common/gpu/client/gpu_memory_buffer_impl.h" |
| + |
| +#include "content/common/gpu/client/gpu_memory_buffer_impl_shm.h" |
| + |
| +namespace content { |
| + |
| +scoped_ptr<GpuMemoryBufferImpl> GpuMemoryBufferImpl::Create( |
| + gfx::GpuMemoryBufferHandle handle, |
| + gfx::Size size, |
| + unsigned internalformat) { |
| + switch (handle.type) { |
| + case gfx::SHARED_MEMORY_BUFFER: { |
| + scoped_ptr<GpuMemoryBufferImplShm> buffer( |
| + new GpuMemoryBufferImplShm(size, internalformat)); |
| + if (!buffer->Initialize(handle)) |
| + return scoped_ptr<GpuMemoryBufferImpl>(); |
| + |
| + return buffer.PassAs<GpuMemoryBufferImpl>(); |
| + } |
|
Ken Russell (switch to Gerrit)
2013/12/03 22:36:13
It would be nice to figure out a way to share this
reveman
2013/12/04 02:00:31
An alternative is to add some "if defined(OS_*)" c
|
| + default: |
| + return scoped_ptr<GpuMemoryBufferImpl>(); |
| + } |
| +} |
| + |
| +} // namespace content |