Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Unified Diff: ui/gfx/mojo/buffer_types_struct_traits.h

Issue 2970353002: Add GpuMemoryBuffer support for DXGI handles.
Patch Set: add image texture target Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
};

Powered by Google App Engine
This is Rietveld 408576698