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

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

Issue 2970353002: Add GpuMemoryBuffer support for DXGI handles.
Patch Set: update build config Created 3 years, 4 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
« no previous file with comments | « ui/gfx/mojo/buffer_types.mojom ('k') | ui/gfx/mojo/buffer_types_struct_traits.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0fdf909f5fc37c3fc071bb1f81779a79d3de37ed..f76e9849409fa1d930a8004a7c353087212f911c 100644
--- a/ui/gfx/mojo/buffer_types_struct_traits.h
+++ b/ui/gfx/mojo/buffer_types_struct_traits.h
@@ -5,6 +5,7 @@
#ifndef UI_GFX_MOJO_BUFFER_TYPES_STRUCT_TRAITS_H_
#define UI_GFX_MOJO_BUFFER_TYPES_STRUCT_TRAITS_H_
+#include "build/build_config.h"
#include "ui/gfx/buffer_types.h"
#include "ui/gfx/mojo/buffer_types.mojom.h"
@@ -173,6 +174,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;
}
NOTREACHED();
return gfx::mojom::GpuMemoryBufferType::LAST;
@@ -193,6 +196,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;
+ return true;
}
return false;
}
@@ -276,6 +282,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;
}
@@ -285,6 +293,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);
};
« no previous file with comments | « ui/gfx/mojo/buffer_types.mojom ('k') | ui/gfx/mojo/buffer_types_struct_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698