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

Unified Diff: ui/ozone/platform/wayland/wayland_connection.cc

Issue 2042503002: ozone/platform/wayland: Add support for wl_output_interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: [For landding] update comments Created 4 years, 3 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/ozone/platform/wayland/wayland_connection.cc
diff --git a/ui/ozone/platform/wayland/wayland_connection.cc b/ui/ozone/platform/wayland/wayland_connection.cc
index 2e445d9f2560114fcc20043ced6dd1cb904b5fb2..b2fb1084f94ac6a7e27b5d4275e834108323d563 100644
--- a/ui/ozone/platform/wayland/wayland_connection.cc
+++ b/ui/ozone/platform/wayland/wayland_connection.cc
@@ -10,6 +10,8 @@
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
+#include "base/strings/string_util.h"
+#include "ui/ozone/platform/wayland/wayland_object.h"
#include "ui/ozone/platform/wayland/wayland_window.h"
static_assert(XDG_SHELL_VERSION_CURRENT == 5, "Unsupported xdg-shell version");
@@ -105,6 +107,12 @@ void WaylandConnection::RemoveWindow(gfx::AcceleratedWidget widget) {
window_map_.erase(widget);
}
+WaylandOutput* WaylandConnection::PrimaryOutput() const {
+ if (!output_list_.size())
+ return nullptr;
+ return output_list_.front().get();
+}
+
void WaylandConnection::OnDispatcherListChanged() {
StartProcessingEvents();
}
@@ -126,6 +134,11 @@ void WaylandConnection::OnFileCanReadWithoutBlocking(int fd) {
void WaylandConnection::OnFileCanWriteWithoutBlocking(int fd) {}
+const std::vector<std::unique_ptr<WaylandOutput>>&
+WaylandConnection::GetOutputList() const {
+ return output_list_;
+}
+
// static
void WaylandConnection::Global(void* data,
wl_registry* registry,
@@ -169,6 +182,18 @@ void WaylandConnection::Global(void* data,
connection);
xdg_shell_use_unstable_version(connection->shell_.get(),
XDG_SHELL_VERSION_CURRENT);
+ } else if (base::EqualsCaseInsensitiveASCII(interface, "wl_output")) {
+ wl::Object<wl_output> output = wl::Bind<wl_output>(registry, name, 1);
+ if (!output) {
+ LOG(ERROR) << "Failed to bind to wl_output global";
+ return;
+ }
+
+ if (!connection->output_list_.empty())
+ NOTIMPLEMENTED() << "Multiple screens support is not implemented";
+
+ connection->output_list_.push_back(
+ base::WrapUnique(new WaylandOutput(output.release())));
}
connection->ScheduleFlush();
« no previous file with comments | « ui/ozone/platform/wayland/wayland_connection.h ('k') | ui/ozone/platform/wayland/wayland_connection_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698