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

Unified Diff: components/exo/wayland/server.cc

Issue 2804643003: exo: advertise supported formats to linux_dmabuf clients
Patch Set: indent fixup 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 | « components/exo/wayland/clients/rects.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/wayland/server.cc
diff --git a/components/exo/wayland/server.cc b/components/exo/wayland/server.cc
index f746de2bd6156df06406bac62f342c39dfd43d05..9d42f70bce73c96a5bd70a3a3449866921631600 100644
--- a/components/exo/wayland/server.cc
+++ b/components/exo/wayland/server.cc
@@ -83,6 +83,10 @@
#include <drm_fourcc.h>
#include <linux-dmabuf-unstable-v1-server-protocol.h>
#include <wayland-drm-server-protocol.h>
+
+#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
+#include "ui/aura/env.h"
+#include "ui/ozone/platform/drm/common/drm_util.h"
#endif
#if BUILDFLAG(USE_XKBCOMMON)
@@ -762,8 +766,19 @@ void bind_linux_dmabuf(wl_client* client,
wl_resource_set_implementation(resource, &linux_dmabuf_implementation, data,
nullptr);
+#if defined(USE_OZONE)
+ gfx::GpuMemoryBufferAttribVector attrs = aura::Env::GetInstance()
+ ->context_factory()
+ ->GetGpuMemoryBufferManager()
+ ->GetGpuMemoryBufferAttribs();
+
+ for (const auto attrib : attrs)
+ zwp_linux_dmabuf_v1_send_format(
+ resource, ui::GetFourCCFormatFromBufferFormat(attrib.format));
+#else
for (const auto& supported_format : dmabuf_supported_formats)
zwp_linux_dmabuf_v1_send_format(resource, supported_format.dmabuf_format);
+#endif
}
#endif
« no previous file with comments | « components/exo/wayland/clients/rects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698