Commit graph

35 commits

Author SHA1 Message Date
Chris Wilson
3d499ea901 xlib: Replace obsolete disable-xrender with shiny new device debug interface
As prototyped with xcb.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-22 10:41:37 +00:00
Chris Wilson
b2132eed79 boilerplate/xlib: The xlib-fallback should be visually identical to image 2012-02-22 10:18:56 +00:00
Andrea Canciani
549b1f8d4b boilerplate: Remove unused thread id parameter
The thread id is not used anymore (it is always == 0), so it can be
removed.
2011-11-12 20:49:08 +01:00
Uli Schlachter
5f3fd8c09c xlib: Fix compilation with --disable-xlib-xrender
The boilerplate code tries to set PolyModePrecise on the xlib device. However,
because xrender is disabled, cairo-xlib-xrender.h wasn't included and didn't
include the needed xrender headers for this define.

This define is copied from cairo-xlib-xrender-private.h

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-10-08 10:48:26 +02:00
Chris Wilson
fcea0f8e08 test: Use the test-traps as the reference images for xlib/xcb
The test-traps provides a reference implementation of the
traps-compositor as used by xlib, so we can use it to generate the
reference images as well. (Of course checking that test-traps is itself
correct and only differs in the renderer! ;-)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-16 11:09:22 +01:00
Chris Wilson
af9fbd176b Introduce a new compositor architecture
Having spent the last dev cycle looking at how we could specialize the
compositors for various backends, we once again look for the
commonalities in order to reduce the duplication. In part this is
motivated by the idea that spans is a good interface for both the
existent GL backend and pixman, and so they deserve a dedicated
compositor. xcb/xlib target an identical rendering system and so they
should be using the same compositor, and it should be possible to run
that same compositor locally against pixman to generate reference tests.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

P.S. This brings massive upheaval (read breakage) I've tried delaying in
order to fix as many things as possible but now this one patch does far,
far, far too much. Apologies in advance for breaking your favourite
backend, but trust me in that the end result will be much better. :)
2011-09-12 08:29:48 +01:00
Uli Schlachter
b6c972897b Xlib: Fix boilerplate to work with xlib-xcb
Xlib boilerplate includes cairo-xlib-surface-private.h, so that it can cast the
xlib cairo_surface_t to cairo_xlib_surface_t and then mess with some internals
of that struct.

However, xlib-xcb doesn't use that struct and thus this results in random memory
corruption. "Luckily", all the fields that this messes with don't corrupt any
fields in cairo_xlib_xcb_surface_t, but instead this writes past the end of the
buffer that was returned from malloc.

This commit just adds an #if to disable this code section since I have no idea
what a proper fix would be. This means that the xlib-fallback backend doesn't
actually test any fallbacks with xlib-xcb, however it never did so anyway.

If you have any idea how to fix xlib-fallback with xlib-xcb, please speak up.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-03 15:16:23 +02:00
Chris Wilson
bf1b08d066 perf 2011-06-02 08:57:13 +01:00
Chris Wilson
63bdae27a8 xlib,xcb: Force strict adherence to the Render specification when testing
Introduce cairo_xlib_device_debug_set_precision() to override the
automatic selection of rendering precision and force the Xorg/DDX to
strictly adhere to the precise rendering mode of the Render
specification. This allows us to test drivers without worrying, too
much, about minor discrepancies in antialiasing.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-01 16:50:25 +01:00
Chris Wilson
bac5c28a18 boilerplate: Offset the xlib window
An idea courtesy of Benjamin Otte is to stress the drivers a bit more by
not rendering to 0,0. Under various circumstances rendering to a Window
is mapped onto the Screen root Window with a collection of offsets and
clips by X. It is easy for the driver to make a mistake and misrender...
2010-07-17 10:09:14 +01:00
Benjamin Otte
a1c4b001a5 boilerplate: Add a describe vfunc
This function is supposed to describe the backend in use. The describe
function is optional - and therefore initialized as NULL everywhere.
Note:
It is well known that the xlib backend uses X. What is not known is what
version the server supports or what graphics card it is running on. That
is the information the describe vfunc is supposed to provide.
2010-07-03 02:55:52 +02:00
M Joonas Pihlaja
b036a09972 whitespace: Fixup formal arguments and tabs in boilerplate/ and perf/.
Ran a script to align the formal parameters of functions and
collapse spaces to tabs in code.
2010-06-24 15:02:53 +03:00
M Joonas Pihlaja
616e35d1fa boilerplate: Remove the xlib-window target from Renderless builds.
I don't know why _cairo_boilerplate_xlib_window_create_surface()
is in the Render-only section of the code, but since it is, this
patch makes the boilerplate at least compile if we don't have
Render support built in.
2010-06-24 15:02:53 +03:00
Chris Wilson
dd0866cdc8 boilerplate: Exercise RENDER capable windows.
Ensure that the drivers actually work when rendering to a normal window.
2010-05-27 17:53:30 +01:00
Andrea Canciani
e425c44e9c boilerplate: Compile xlib without xrender
cairo_boilerplate_xlib_surface_disable_render() is not defined when
compiling without XRender, but it was used nonetheless. Replace it
with an empty stub when XRender is not available.
2010-04-10 18:28:42 +02:00
Chris Wilson
8f7078eba7 boilerplate: Allox xlib-fallback to build without RENDER
This surface doesn't use RENDER and should produce the same results
when cairo-xlib is compiled without any support for RENDER.
2010-04-01 20:42:44 +01:00
Chris Wilson
97f8c20727 boilerplate: Create an image16 target
In order to exercise the newly restored r5g6g5 support, we need to
create an appropriate surface and feed it through the test and
performance suites.
2010-03-27 21:53:55 +00:00
Chris Wilson
8078cd194e [boilerplate] Runtime library check
For the purposes of benchmarking it is useful to run cairo-perf against a
different library from the one it was compiled against. In order to do so,
we need to check that the runtime library contains the required entry
points for our targets - which we can check by using dlsym.
2009-08-29 17:07:38 +01:00
Chris Wilson
097484da6f [boilerplate] Conditionally tweak the xlib surface
Prior to introduction of the buggy members to the surface, we obviously
cannot set them. However, the boilerplate code is meant to compile against
older revisions of the library so we need to check for the existence prior
to use.
2009-07-31 14:48:32 +01:00
Chris Wilson
397538a251 [boilerplate] Update fallbacks after disabling RENDER
The xlib surface caches flags based on RENDER version, so after disabling
render to force fallbacks, we need to ensure that the flags are reset.
2009-07-31 14:33:11 +01:00
Chris Wilson
88cb69b10c [boilerpate] Move target definition to backends.
By moving the backend target definition out of the massive amlagamated
block in cairo-boilerplate.c and into each of the
cairo-boilerplate-backend.c, we make it much easier to add new targets as
the information need only be entered in a single file and not scattered
across three. However, updating the target interface means trawling across
all the files -- except given that I found it difficult maintaining the
single massive array I do not see this as an increase in the maintenance
burden.
2009-07-04 21:43:27 +01:00
Chris Wilson
86624627e4 [test] Add group-unaligned
Test case for:
   Bug 22441 -- Unexpected shift with push_group and pop_group
   https://bugs.freedesktop.org/show_bug.cgi?id=22441

This is a test that demonstrates the error in the pdf backend when using
groups on surfaces with non-integer sizes. In order to create such a
surface, we need to update the boilerplate to use doubles instead of
integers when specifying the surface size.
2009-06-27 17:53:18 +01:00
Chris Wilson
d0c1c92821 [boilerplate] Implement a reference xlib surface
Create an xlib target that uses a separate display, specified by
CAIRO_REFERENCE_DISPLAY, that can be used as a reference implementation
for the normal display. So this can be used by cairo-trace-test to create
a reference surface that mimics exactly the true surface, but if it
targets an Xvfb display will be entirely rendered in software. If
CAIRO_REFERENCE_DISPLAY is not set, the reference surface degrades into an
xlib-fallback surface which is a close approximation (but still has
behavioural differences).
2009-06-21 10:13:31 +01:00
Chris Wilson
5f816ccd25 [boilerplate] Redefine DEBUG() for portability concerns
Behdad warned that using an empty variadic macro was non-portable.
2009-01-03 22:54:14 +00:00
Chris Wilson
ff1f5de551 [boilerplate] Suppress xlib warnings on stderr
If we cannot test the xlib backend simply because there is no Display,
just report UNTESTED and do not clutter the output with superfluous
warnings [see the output from the buildbots for an example]. However,
keep the warnings around so that a developer can re-enable them
and so simply move them to a new "lower priority" macro.
2009-01-03 21:53:09 +00:00
Chris Wilson
436c0c8be2 [test] Preparatory work for running under memfault.
In order to run under memfault, the framework is first extended to handle
running concurrent tests - i.e. multi-threading. (Not that this is a
requirement for memfault, instead it shares a common goal of storing
per-test data).  To that end all the global data is moved into a per-test
context and the targets are adjusted to avoid overlap on shared, global
resources (such as output files and frame buffers). In order to preserve
the simplicity of the standard draw routines, the context is not passed
explicitly as a parameter to the routines, but is instead attached to the
cairo_t via the user_data.

For the masochist, to enable the tests to be run across multiple threads
simply set the environment variable CAIRO_TEST_NUM_THREADS to the desired
number.

In the long run, we can hope the need for memfault (runtime testing of
error paths) will be mitigated by static analysis. A promising candidate
for this task would appear to be http://hal.cs.berkeley.edu/cil/.
2008-08-13 21:54:59 +01:00
Chris Wilson
968eaf3c44 [cairo-xlib] Fixup --disable-xlib-xrender
Fixup the headers and boilerplate to compile and run correctly when
configured with --disable-xlib-xrender.
2008-01-15 13:08:53 +00:00
Chris Wilson
31b52779ba [cairo-boilerplate-xlib] Cleanup fallback after creation failure.
Cleanup the local resource if we fail to create the X window and
surface for the xlib fallback test target.
2007-10-05 18:34:32 +01:00
Chris Wilson
8894894d9d [cairo-boilerplate-xlib] Check that the surface will fit in the screen.
Whilst testing the fallback surface, the resultant image was being
clipped to the screen size. Be conservative and refuse to create
windows (for CAIRO_CONTENT_COLOR surfaces) that are larger than the
 screen.
2007-08-24 14:14:10 +01:00
Chris Wilson
a29544a0b6 [cairo-boilerplate-xlib] Clear Render data for the non-Render fallback.
As well as marking the XRender extension unavailable in
_cairo_boiler_player_xlib_disable_render(), we need to clear any
XRender derived information stored during the surface creation.
2007-08-24 12:27:15 +01:00
Carl Worth
d05593a5fb Add a new xlib-fallback target to test xlib using image fallbacks instead of the Render extension 2007-08-21 16:46:40 -07:00
Chris Wilson
7d853bcabc [cairo-boilerplate-xlib] Check for NULL xrender_format before use.
Testing for XRender support (xrender_format != NULL) after
dereferencing said format doesn't work as intended.
2007-08-16 14:56:27 +01:00
Behdad Esfahbod
cd72167ede [xlib] Get rid of _cairo_xlib_test_disable_render
in favor of cairo_boilerplate_xlib_surface_disable_render.
2007-04-21 02:08:38 -04:00
Behdad Esfahbod
be0320c4f8 [boilerplate] Properly namespace boilerplate methods
in preparation for ripping them into per-backend files.
2007-04-20 00:52:02 -04:00
Behdad Esfahbod
9b660a3d54 [boilerplate] Strip xlib boilerplate into cairo-boilerplate-xlib* 2007-04-20 00:52:02 -04:00