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

Unified Diff: ui/ozone/platform/wayland/fake_server.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
« no previous file with comments | « ui/ozone/platform/wayland/fake_server.h ('k') | ui/ozone/platform/wayland/wayland_connection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/wayland/fake_server.cc
diff --git a/ui/ozone/platform/wayland/fake_server.cc b/ui/ozone/platform/wayland/fake_server.cc
index baafedc30e32cae8b5c0a3795aa35fcfaaf00a98..52424c96365ad96abe238f5ac099b637028945ff 100644
--- a/ui/ozone/platform/wayland/fake_server.cc
+++ b/ui/ozone/platform/wayland/fake_server.cc
@@ -18,6 +18,7 @@ namespace wl {
namespace {
const uint32_t kCompositorVersion = 4;
+const uint32_t kOutputVersion = 2;
const uint32_t kSeatVersion = 4;
const uint32_t kXdgShellVersion = 1;
@@ -278,6 +279,7 @@ void Global::Bind(wl_client* client,
global->resource_ = resource;
wl_resource_set_implementation(resource, global->implementation_, global,
&Global::OnResourceDestroyed);
+ global->OnBind();
}
// static
@@ -296,6 +298,21 @@ void MockCompositor::AddSurface(std::unique_ptr<MockSurface> surface) {
surfaces_.push_back(std::move(surface));
}
+MockOutput::MockOutput()
+ : Global(&wl_output_interface, nullptr, kOutputVersion) {}
+
+MockOutput::~MockOutput() {}
+
+// Notify clients of the change for output position.
+void MockOutput::OnBind() {
+ const char* kUnknownMake = "unknown";
+ const char* kUnknownModel = "unknown";
+ wl_output_send_geometry(resource(), rect_.x(), rect_.y(), 0, 0, 0,
+ kUnknownMake, kUnknownModel, 0);
+ wl_output_send_mode(resource(), WL_OUTPUT_MODE_CURRENT, rect_.width(),
+ rect_.height(), 0);
+}
+
MockSeat::MockSeat() : Global(&wl_seat_interface, &seat_impl, kSeatVersion) {}
MockSeat::~MockSeat() {}
@@ -337,6 +354,8 @@ bool FakeServer::Start() {
return false;
if (!compositor_.Initialize(display_.get()))
return false;
+ if (!output_.Initialize(display_.get()))
+ return false;
if (!seat_.Initialize(display_.get()))
return false;
if (!xdg_shell_.Initialize(display_.get()))
« no previous file with comments | « ui/ozone/platform/wayland/fake_server.h ('k') | ui/ozone/platform/wayland/wayland_connection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698