Chromium Code Reviews| Index: ui/gfx/mojo/buffer_types_struct_traits.h |
| diff --git a/ui/gfx/mojo/buffer_types_struct_traits.h b/ui/gfx/mojo/buffer_types_struct_traits.h |
| index ad25a17c8ae6ff539d5d58a82815ea1f61c5e1ba..6aecf7539bb5e901264397652515b82f42f0e2a0 100644 |
| --- a/ui/gfx/mojo/buffer_types_struct_traits.h |
| +++ b/ui/gfx/mojo/buffer_types_struct_traits.h |
| @@ -167,6 +167,8 @@ struct EnumTraits<gfx::mojom::GpuMemoryBufferType, gfx::GpuMemoryBufferType> { |
| return gfx::mojom::GpuMemoryBufferType::IO_SURFACE_BUFFER; |
| case gfx::GpuMemoryBufferType::NATIVE_PIXMAP: |
| return gfx::mojom::GpuMemoryBufferType::NATIVE_PIXMAP; |
| + case gfx::GpuMemoryBufferType::DXGI_HANDLE: |
| + return gfx::mojom::GpuMemoryBufferType::DXGI_HANDLE; |
|
dcheng
2017/07/12 08:46:19
Should non-Windows platforms NOTREACHED() this cas
reveman
2017/07/12 15:04:14
Then similar NOTREACHED() for other buffer types t
|
| } |
| NOTREACHED(); |
| return gfx::mojom::GpuMemoryBufferType::LAST; |
| @@ -187,6 +189,9 @@ struct EnumTraits<gfx::mojom::GpuMemoryBufferType, gfx::GpuMemoryBufferType> { |
| case gfx::mojom::GpuMemoryBufferType::NATIVE_PIXMAP: |
| *out = gfx::GpuMemoryBufferType::NATIVE_PIXMAP; |
| return true; |
| + case gfx::mojom::GpuMemoryBufferType::DXGI_HANDLE: |
| + *out = gfx::GpuMemoryBufferType::DXGI_HANDLE; |
|
dcheng
2017/07/12 08:46:19
Though this can't be notreached, since this receiv
|
| + return true; |
| } |
| return false; |
| } |
| @@ -271,6 +276,8 @@ struct StructTraits<gfx::mojom::GpuMemoryBufferHandleDataView, |
| } |
| static mojo::ScopedSharedBufferHandle shared_memory_handle( |
| const gfx::GpuMemoryBufferHandle& handle); |
| + static mojo::ScopedHandle win32_handle( |
| + const gfx::GpuMemoryBufferHandle& handle); |
| static uint32_t offset(const gfx::GpuMemoryBufferHandle& handle) { |
| return handle.offset; |
| } |
| @@ -280,6 +287,13 @@ struct StructTraits<gfx::mojom::GpuMemoryBufferHandleDataView, |
| static const gfx::NativePixmapHandle& native_pixmap_handle( |
| const gfx::GpuMemoryBufferHandle& handle); |
| static mojo::ScopedHandle mach_port(const gfx::GpuMemoryBufferHandle& handle); |
| + static uint32_t array_level(const gfx::GpuMemoryBufferHandle& handle) { |
| +#if defined(OS_WIN) |
| + return handle.array_level; |
| +#else |
| + return 0; |
| +#endif |
| + } |
| static bool Read(gfx::mojom::GpuMemoryBufferHandleDataView data, |
| gfx::GpuMemoryBufferHandle* handle); |
| }; |