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

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: rebase on master Created 4 years, 5 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/fake_server.cc
diff --git a/ui/ozone/platform/wayland/fake_server.cc b/ui/ozone/platform/wayland/fake_server.cc
index b6280b8028a5e4df5a1a214aa0752ae050a46dad..9a67911a329615b9c298401dccb761c6ec7d0512 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,20 @@ void MockCompositor::AddSurface(std::unique_ptr<MockSurface> surface) {
surfaces_.push_back(std::move(surface));
}
+MockOutput::MockOutput()
+ : Global(&wl_output_interface, nullptr, kOutputVersion) {}
+
+MockOutput::~MockOutput() {}
+
+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 +353,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()))

Powered by Google App Engine
This is Rietveld 408576698