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

Unified Diff: components/exo/wayland/clients/rects.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/client_base.cc ('k') | components/exo/wayland/server.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/wayland/clients/rects.cc
diff --git a/components/exo/wayland/clients/rects.cc b/components/exo/wayland/clients/rects.cc
index 342d8e661426fb7901a0b8fd489b40f0dd5c3383..09cf5718ce75bbddc916568cf0d6daf10976a59e 100644
--- a/components/exo/wayland/clients/rects.cc
+++ b/components/exo/wayland/clients/rects.cc
@@ -217,11 +217,25 @@ class RectsClient : public ClientBase {
size_t num_benchmark_runs,
base::TimeDelta benchmark_interval,
bool show_fps_counter);
+ static void AddDmaBufFormat(uint32_t format);
private:
+ static std::vector<uint32_t> dmabuf_formats_;
DISALLOW_COPY_AND_ASSIGN(RectsClient);
};
+std::vector<uint32_t> RectsClient::dmabuf_formats_ = std::vector<uint32_t>();
+
+void RectsClient::AddDmaBufFormat(uint32_t format) {
+ dmabuf_formats_.push_back(format);
+}
+
+void LinuxDmaBufFormatReceived(void* data,
+ struct zwp_linux_dmabuf_v1* zwp_linux_dmabuf,
+ uint32_t format) {
+ RectsClient::AddDmaBufFormat(format);
+}
+
int RectsClient::Run(const ClientBase::InitParams& params,
size_t max_frames_pending,
size_t num_rects,
@@ -520,6 +534,7 @@ int main(int argc, char* argv[]) {
return 1;
}
+ params.dmabuf_listener = {exo::wayland::clients::LinuxDmaBufFormatReceived};
exo::wayland::clients::RectsClient client;
return client.Run(params, max_frames_pending, num_rects, num_benchmark_runs,
base::TimeDelta::FromMilliseconds(benchmark_interval_ms),
« no previous file with comments | « components/exo/wayland/clients/client_base.cc ('k') | components/exo/wayland/server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698