| Index: content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.cc
|
| diff --git a/content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.cc b/content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.cc
|
| index fe2681bf051df7b4e5efe3aef6b7db461204fe2e..f471333b1d041dd9de92e492d07ae3c55b819947 100644
|
| --- a/content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.cc
|
| +++ b/content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.cc
|
| @@ -46,6 +46,31 @@ void GpuMemoryBufferImplOzoneNativeBuffer::AllocateOzoneNativeBufferForChildId(
|
| }
|
|
|
| // static
|
| +scoped_ptr<GpuMemoryBufferImpl>
|
| +GpuMemoryBufferImplOzoneNativeBuffer::AllocateOzoneNativeBufferForBrowser(
|
| + const gfx::Size& size,
|
| + unsigned internalformat,
|
| + unsigned usage) {
|
| + gfx::GpuMemoryBufferHandle handle;
|
| + // +1 ensures we always get non-zero IDs.
|
| + handle.global_id.primary_id = g_next_buffer_id.GetNext() + 1;
|
| + handle.global_id.secondary_id = 0;
|
| + handle.type = gfx::OZONE_NATIVE_BUFFER;
|
| + handle = GpuMemoryBufferFactoryHost::GetInstance()->CreateGpuMemoryBufferSync(
|
| + handle, size, internalformat, usage);
|
| +
|
| + if (handle.type == gfx::EMPTY_BUFFER)
|
| + return scoped_ptr<GpuMemoryBufferImpl>();
|
| +
|
| + scoped_ptr<GpuMemoryBufferImplOzoneNativeBuffer> buffer(
|
| + new GpuMemoryBufferImplOzoneNativeBuffer(size, internalformat));
|
| + if (!buffer->InitializeFromHandle(handle))
|
| + return scoped_ptr<GpuMemoryBufferImpl>();
|
| +
|
| + return buffer.PassAs<GpuMemoryBufferImpl>();
|
| +}
|
| +
|
| +// static
|
| bool GpuMemoryBufferImplOzoneNativeBuffer::IsFormatSupported(
|
| unsigned internalformat) {
|
| switch (internalformat) {
|
|
|