cf. the never-ending saga of how we can't neuter the fontconfig leaks,
also pass our CI leak-sanitizer suppression file when running tests
locally. This makes it easier to run with ASan enabled in your local
environment.
Signed-off-by: Daniel Stone <daniels@collabora.com>
We rely on the Xwayland launcher setting $DISPLAY to connect to our own
X server. Make very sure in the tests that we're actually getting that
set properly.
Signed-off-by: Daniel Stone <daniels@collabora.com>
We need this so that Weston can update the "click to activate" serial, so
that we can then use the constraints protocol (see
maybe_enable_pointer_constraint() in libweston/input.c).
Signed-off-by: Sergio Gómez <sergio.g.delreal@gmail.com>
Move vertex clipper back to single-precision floating point
intermediates. Since positions are sent down the graphics hardware as
single-precision values, this prevents useless conversions between
single and double precision values and lets compilers fit twice as
much data into vector registers. It also removes a copy by letting the
clipper store vertices directly into the vertex buffer.
This is mostly reverting the conversion to double-precision that
happened along with the switch to the weston_coord struct for vertex
coordinates (commit 10e70bf23c).
Signed-off-by: Loïc Molinari <loic.molinari@gmail.com>
If the source is not supported, we won't receive the capture
information. So the capture info (size/format) will be zeroed, and we
fail while trying to create a buffer for the screenshot with size/format
zeroed.
With this patch we fail if we don't receive the capture info, what makes
the failure reason more explicit.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This adds three new helpers: one to iterate over all debug scopes
created/added and other two are for simpler getters for the scope name
and the description.
Included with this change is also a simple test to retrieve them.
This is an alternative to using the debug scope list advertised when
using the weston-debug private extension. libweston users can use this
directly to know which scopes they can subscribe to, and there's no need
to have a client implementation for the weston-debug protocol.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
There are some ICC profiles that contain something named VCGT tag. These
are usually power curves (y = x ^ exp) that were loaded in the video
card when the ICC profile was created. So the compositor should mimic
that in order to use the profile.
Weston already has support for that, but our ICC profile tests were
missing this case. This adds such tests.
For testing purposes, we have added tests with different exponents per
color channel.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Without that we may crash when trying to create a PTYPE_CLUT ICC profile
with dimension zeroed. This would be wrong, so with this change we are
basically validating the test case arguments.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
For now we have some tests with the same name. Differentiate them based
on the ICC profile type that they build: CLUT vs matrix shaper.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
The return values for most of the API functions will be removed and replaced by
asserts. So checking return values will no longer work and passing invalid
arguments will trigger asserts. Modify and remove the tests accordingly.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Move our DRM test fixture setup later, where we already have a bunch of
per-backend splits, so we can choose to skip our tests at the right
time.
Doing this allows us to skip DRM tests with no memory leaks.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Now that we have color profile, transformation and optimizer debug
scopes, make use them in this test.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
We don't accumulate log scopes with was previous set internally so
enable the "log" scope (explicitly) for the xwayland-test to see what
Weston prints out.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
We're still timing out with our basic xwayland test in CI, so this
enables the XWM logging scope, and enables some further print debugs we
have available in our helper library, in an attempt to further
investigate and determine why we're still timing out.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This adds a test to ensure that the DRM-backend writeback screenshooter
is working properly.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This patch introduces a small library wrapper around XCB to be used in
Xwayland tests.
It's being designed such that we do not advance without accounting for
all X11 events when changing the window state. It adds a fence that
waits for all events to be processed, and only after all the events have
been accounted for, to proceed further, resuming execution of the
tests.
This works by keeping a tentative_state list for the client and a
window state that gets applied when the event we waited for has been
received.
This is useful in test clients, which could verify at the end after
receiving all events that the correct state has been applied. Acts as a
way to verify that the we never get or have a different state than the
one we expect.
With it, this converts test-xwayland to using libxcb (together with
xcb-cursor-dev) rather than using Xlib, and with it it removes any Xlib
dependency we might have in the tests.
This only adds support for map/unmap/create/destroy/property notify.
A follow-up would be to expand this library to track window movement
and resizing.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
I also snuck in a trivial change to drag_surface_configure at the same
time to avoid yet another micro patch.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Convert the bare x,y coordinates into struct weston_coord and update all
users.
We keep the surface position in wl_fixed_t for now so it still exactly
matches the position most recently sent to clients.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Push weston_coord into the notification functions instead of passing
two doubles.
The touch handlers are passed a pointer to a weston_coord, which is
unusual. This is done so we can pass a NULL pointer instead of a
fabricated invalid coordinate when the touch type is TOUCH_UP.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Wayland protocol can't do this, but the way our test protocol handles
touch through a single event can - ensure that we don't by accident.
This will matter more shortly when we add assert()s to prevent having
coordinates with WL_TOUCH_UP events internally later.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Remove the independent x, y floats from the clipping code and replace them
with struct weston_cord. This includes the polygon8 structure as well.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
We're pushing more and more mutable state into paint nodes, but this state
has a non-zero cost to rebuild every render.
Let's take care to track when we need to rebuild the state.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Update users of the old coordinate space conversion functions that take
x, y pairs to the new weston_coord versions.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
In case we have multiple outputs let's us choose the first output,
rather use the last one, which would happen when multiple are present in
the system.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
In preparation of having multiple outputs available we should be able to
specify by its name. We just use the default one if none was set-up at all.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Now that enum weston_renderer_type is public, there is no need for a
local enum renderer_type in the tests.
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Add an output transform function that doesn't use matrices so we can
test our matrix generation by applying it to vectors and comparing with
the non-matrix variant.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Rather than reinventing --use-pixman and --use-gl throughout each
backend, just have a common --renderer=foo argument which can be used to
explicitly specify the renderer.
The old arguments are still handled for backwards compatibility.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Instead of passing --shell=foo-shell.so, just pass --shell=foo, whilst
accepting the old form for compatibility.
Whilst we're at it, document the --shell argument in the manpage and
README.
Signed-off-by: Daniel Stone <daniels@collabora.com>
These shell utils functions are potentially useful to other shells as
well, so make them widely available.
Renamed all functions to weston_shell_utils namespace.
No functional change, copied ad litteram.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
We were storing the output description into the name field, which was
harmless but did cause a leak.
Signed-off-by: Daniel Stone <daniels@collabora.com>
While the --backend parameter looks like it takes a file name, it really
is selected from a list of supported strings that are then funneled
through a translation to enum weston_compositor_backend [1].
Because all backend parameters are of the form "...-backend.so", and
writing "--backend=...-backend.so" is boring, allow the --backend option
to match the backend name without "-backend.so" suffix instead.
For example, this allows to use "--backend=headless" instead of
"--backend=headless-backend.so".
Update help text and documentation. Keep the old way working for
backwards compatibility.
[1] 50dbf38514 ("libweston: use enum to choose the backend")
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Here are more tests for output decorations drawing, this time through
the color-lcms plugin. This is the only practical way to exercise the
input-to-output category of color transformations.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This adds a new test checking that output decorations (used in the
wayland-backend, here tested with headless-backend) are drawn correctly.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Only the 'image' field of struct buffer is ever used here, so just
pass pixman_image_t instead of struct buffer.
This allows a future test to mangle a screenshot (e.g. convert pixel
format) before feeding it in.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Migrate the tst suite to using the new screenshooting protocol. This
ensures the new protocol and implementation work, and removes a user of
the old protocol so that the old protocol can be removed in the future.
Now that the compositor chooses the pixel format,
capture_screenshot_of_output() needs to convert to the expected format
in the tests when necessary.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Instead of starting yet another hand-crafted pixel format mapping table,
use the one we have.
Following patches want to be able to create XRGB8888 buffers, and later
even other formats.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Add tests to validate that weston_matrix_to_transform() works properly
on the matrices generated by weston_surface_build_buffer_matrix() and
weston_output_update_matrix()
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>