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

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

Issue 2801683002: gfx: introduce GpuMemoryBufferAttrib to communicate format modifiers
Patch Set: purge enum BufferFormatModifier and use uint64_t modifiers Created 3 years, 8 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_struct_traits.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/mojo/buffer_types_struct_traits.cc
diff --git a/ui/gfx/mojo/buffer_types_struct_traits.cc b/ui/gfx/mojo/buffer_types_struct_traits.cc
index 52be89b5a1e3b1fb6a4b299b78596e98a502aa32..1e7896fa48662a9801443f61ef5f8f7a54ccb93a 100644
--- a/ui/gfx/mojo/buffer_types_struct_traits.cc
+++ b/ui/gfx/mojo/buffer_types_struct_traits.cc
@@ -60,6 +60,20 @@ bool StructTraits<
#endif
}
+bool StructTraits<gfx::mojom::GpuMemoryBufferAttribDataView,
+ gfx::GpuMemoryBufferAttrib>::
+ Read(gfx::mojom::GpuMemoryBufferAttribDataView attrib,
+ gfx::GpuMemoryBufferAttrib* out) {
+#if defined(OS_LINUX)
+ EnumTraits<gfx::mojom::BufferFormat, gfx::BufferFormat>::FromMojom(
+ attrib.format(), &out->format);
+ out->modifier = attrib.modifier();
+ return true;
+#else
+ return false;
+#endif
+}
+
mojo::ScopedHandle StructTraits<gfx::mojom::GpuMemoryBufferHandleDataView,
gfx::GpuMemoryBufferHandle>::
shared_memory_handle(const gfx::GpuMemoryBufferHandle& handle) {
« no previous file with comments | « ui/gfx/mojo/buffer_types_struct_traits.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698