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..2a1a147dd807297dc2a084d274d0666b791e51e1 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,21 @@ void GpuMemoryBufferImplOzoneNativeBuffer::AllocateOzoneNativeBufferForChildId( |
} |
// static |
+gfx::GpuMemoryBufferHandle |
+GpuMemoryBufferImplOzoneNativeBuffer::AllocateOzoneNativeBufferForBrowser( |
+ const gfx::Size& size, |
+ unsigned internalformat, |
+ unsigned usage) { |
+ gfx::GpuMemoryBufferHandle handle; |
+ // +1 ensures we always get non-zero IDs. |
reveman
2014/09/04 19:43:31
Except when it wraps around. Consider adding a Get
alexst (slow to review)
2014/09/04 21:14:47
This is copy/pasted from just above in this file.
reveman
2014/09/04 22:37:24
There's already an explicit NULL value for GpuMemo
alexst (slow to review)
2014/09/05 02:04:53
Done.
|
+ handle.global_id.primary_id = g_next_buffer_id.GetNext() + 1; |
+ handle.global_id.secondary_id = 0; |
+ handle.type = gfx::OZONE_NATIVE_BUFFER; |
+ return GpuMemoryBufferFactoryHost::GetInstance()->CreateGpuMemoryBufferSync( |
+ handle, size, internalformat, usage); |
+} |
+ |
+// static |
bool GpuMemoryBufferImplOzoneNativeBuffer::IsFormatSupported( |
unsigned internalformat) { |
switch (internalformat) { |