Skip to content

Commit

Permalink
Merge pull request #526 from alex-voodoo/ozone-wayland-dev
Browse files Browse the repository at this point in the history
Revert two patches
  • Loading branch information
msisov authored Feb 4, 2019
2 parents 6ac4d77 + 122cd1a commit 3cac10b
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 174 deletions.
1 change: 0 additions & 1 deletion build/install-build-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ dev_list="\
ruby
subversion
uuid-dev
weston
wdiff
x11-utils
xcompmgr
Expand Down
6 changes: 0 additions & 6 deletions testing/xvfb.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,13 @@ def run_executable(cmd, env, stdoutfile=None):
xcompmgr_proc = subprocess.Popen('xcompmgr', stdout=subprocess.PIPE,
stderr=subprocess.STDOUT, env=env)

# Tests may need a Wayland server.
weston_proc = subprocess.Popen(('weston', '--backend=x11-backend.so'),
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT, env=env)

return test_env.run_executable(cmd, env, stdoutfile)
except OSError as e:
print >> sys.stderr, 'Failed to start Xvfb or Openbox: %s' % str(e)
return 1
finally:
kill(openbox_proc)
kill(xcompmgr_proc)
kill(weston_proc)
else:
env['_CHROMIUM_INSIDE_XVFB'] = '1'
if stdoutfile:
Expand Down
26 changes: 4 additions & 22 deletions ui/ozone/platform/wayland/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
visibility = [ "//ui/ozone/*" ]

import("//build/config/linux/pkg_config.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
import("//ui/ozone/platform/wayland/wayland.gni")

pkg_config("wayland-egl") {
Expand Down Expand Up @@ -205,7 +204,6 @@ source_set("test_support") {
"test/test_zwp_text_input_manager.h",
]

defines = [ "WL_HIDE_DEPRECATED" ]
deps = [
"//base:base",
"//skia",
Expand Down Expand Up @@ -258,25 +256,9 @@ source_set("wayland_unittests") {
if (use_xkbcommon) {
deps += [ "//ui/events/keycodes:xkb" ]
}
}

fuzzer_test("wayland_buffer_fuzzer") {
sources = [
"wayland_buffer_fuzzer.cc"
]
deps = [
":wayland",
":test_support",
"//base/test:test_support",
"//build/config/linux/libdrm",
"//testing/gmock",
"//third_party/wayland:wayland_server",
"//third_party/wayland-protocols:linux_dmabuf_protocol",
"//third_party/wayland-protocols:text_input_protocol",
"//third_party/wayland-protocols:xdg_shell_protocol",
"//ui/gfx:test_support",
"//ui/ozone/common/linux:drm",
"//ui/ozone:platform",
]
defines = [ "WL_HIDE_DEPRECATED" ]
if (use_wayland_gbm) {
defines += [ "WAYLAND_GBM" ]
}
}

4 changes: 3 additions & 1 deletion ui/ozone/platform/wayland/test/mock_buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ MockBuffer::MockBuffer(wl_resource* resource, std::vector<base::ScopedFD>&& fds)
: ServerObject(resource), fds_(std::move(fds)) {}

MockBuffer::~MockBuffer() {
for (auto& fd : fds_)
for (auto& fd : fds_) {
LOG(WARNING) << "Will close FD: " << fd.get();
fd.reset();
}
}

} // namespace wl
133 changes: 0 additions & 133 deletions ui/ozone/platform/wayland/wayland_buffer_fuzzer.cc

This file was deleted.

8 changes: 2 additions & 6 deletions ui/ozone/platform/wayland/wayland_buffer_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,15 @@ WaylandBufferManager::WaylandBufferManager(
zwp_linux_dmabuf_v1* zwp_linux_dmabuf,
WaylandConnection* connection)
: zwp_linux_dmabuf_(zwp_linux_dmabuf), connection_(connection) {
DCHECK(zwp_linux_dmabuf_);
DCHECK(connection_);

static const zwp_linux_dmabuf_v1_listener dmabuf_listener = {
&WaylandBufferManager::Format,
&WaylandBufferManager::Modifiers,
&WaylandBufferManager::Format, &WaylandBufferManager::Modifiers,
};
zwp_linux_dmabuf_v1_add_listener(zwp_linux_dmabuf_.get(), &dmabuf_listener,
this);

// A roundtrip after binding guarantees that the client has received all
// supported formats.
wl_display_roundtrip(connection_->display());
wl_display_roundtrip(connection->display());
}

WaylandBufferManager::~WaylandBufferManager() {
Expand Down
7 changes: 2 additions & 5 deletions ui/ozone/platform/wayland/wayland_connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ WaylandConnection::~WaylandConnection() = default;

bool WaylandConnection::Initialize() {
static const wl_registry_listener registry_listener = {
&WaylandConnection::Global,
&WaylandConnection::GlobalRemove,
&WaylandConnection::Global, &WaylandConnection::GlobalRemove,
};

display_.reset(wl_display_connect(nullptr));
Expand Down Expand Up @@ -194,7 +193,6 @@ void WaylandConnection::CreateZwpLinuxDmabuf(
uint32_t planes_count,
uint32_t buffer_id) {
DCHECK(base::MessageLoopCurrentForUI::IsSet());
DCHECK(buffer_manager_);
if (!buffer_manager_->CreateBuffer(std::move(file), width, height, strides,
offsets, format, modifiers, planes_count,
buffer_id)) {
Expand Down Expand Up @@ -366,8 +364,7 @@ void WaylandConnection::Global(void* data,
const char* interface,
uint32_t version) {
static const wl_seat_listener seat_listener = {
&WaylandConnection::Capabilities,
&WaylandConnection::Name,
&WaylandConnection::Capabilities, &WaylandConnection::Name,
};
static const xdg_shell_listener shell_listener = {
&WaylandConnection::Ping,
Expand Down

0 comments on commit 3cac10b

Please sign in to comment.