Age | Commit message (Collapse) | Author | Files | Lines |
|
Add a gl-window target that supports multisampling. This is useful for
testing the MSAA backend on the default framebuffer.
|
|
The boilerplate code makes sure that our tests didn't cause any X11 errors or
X11 events, because those might confuse API users.
However, when the keyboard layout changes, every connection gets a MappingNotify
event. This means that the test and performance test suites failed when the
keyboard layout was changed while they are running.
Fix this by ignoring MappingNotifies.
Reported by Arthur Huillet on IRC.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
A few test cases purposely create fractional surface sizes which can not
be natively supported by the raster backends such as GL. For these
backends we need to consistent in creating a surface that is large
enough to contain the test, so we need to use ceil() rather than
implicit truncation to integers.
A consequence of the misalignment between the Window size and the
surface size (where one was using ceil and the other not) is that the
first row of the cairo surface would not be visible on the output.
Based on a patch by Chuanbo Wen to fix 5 test cases, such as
group-unaligned.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
This reverts commits
6ad8c96fd81e06cea6ada4a83e7c5614f150f914,
a3f97d1d2e77a0fee4ca03d5dc9968952a440561,
25abe582982caeb07d1e0af4acca53bb110a33bf
I should know better by now than to push without checking for outstanding
changes.
|
|
We need to occasionally force fallbacks whilst testing the PDF
output, so export a debug interface to do so in order to avoid poking
around inside cairo internals.
References: https://bugs.freedesktop.org/show_bug.cgi?id=48577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
We need to occasionally force fallbacks whilst testing the PostScript
output, so export a debug interface to do so in order to avoid poking
around inside cairo internals.
References: https://bugs.freedesktop.org/show_bug.cgi?id=48577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
A PostScript surface embeds a CreationDate comment into its document
description pre-amble. Normally this is set to the time the surface is
written out, except we set this to a constant value in the boilerplate
for the purposes of mimicking a reference file. It may also be useful
for external applications, so make it a public export.
References: https://bugs.freedesktop.org/show_bug.cgi?id=48577
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
This function is not exported in libcairo, so can't be used from the
library.
|
|
|
|
|
|
If the environment variable ANY2PPM is set, use it as the path to the
any2ppm program. Otherwise, default to "./any2ppm" as before.
This makes it possible to set the ANY2PPM variable in the
Makefile.win32 build system, which makes it possible to use the "test"
target on the script backend.
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
As prototyped with xcb.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
|
|
Update to latest surface backend structure, removed obsolete functions
and fixed functions API in order to be compatible with backend definition.
Fixed compilation with Qt5
|
|
The svg backend produces .svg files. Using the appropriate extension
allows the test suite to check the vector output in addition to the
PNG images.
|
|
The thread id is not used anymore (it is always == 0), so it can be
removed.
|
|
cairo_boilerplate_open_any2ppm() returns a FILE* obtined from popen()
or fdopen(). It should hence be closed using pclose() or fclose()
respectively.
Fixes the crash on every script test on MacOS X.
|
|
|
|
This adds a new GPU accelerated backend for Cairo based on the Cogl 3D
graphics API.
This backend aims to support Cairo in a way that translates as naturally
as possible to using a GPU, it does not strive to compete with the
anti-aliasing quality of the image backend if it can't be done
efficiently using the GPU - raw performance isn't the only metric of
concern, so is power usage.
As an overview of how the backend works:
- fills are handled by tessellating paths into triangles
- the backend has an extra fill_rectangle drawing operation so we have
a fast-path for drawing rectangles which are so common.
- strokes are also tessellated into triangles.
- stroke and fill tessellations are cached to avoid the cpu overhead
of tessellation and cost of upload given that its common for apps to
re-draw the same path multiple times. The tessellations can survive
translations and rotations increasing the probability that they can be
re-used.
- sources and masks are handled using multi-texturing.
- clipping is handled with a scissor and the stencil buffer which
we're careful to only update when they really change.
- linear gradients are rendered to a 1d texture using a triangle
strip + interpolating color attributes. All cairo extend modes
are handled by corresponding texture sampler wrap modes without
needing programmable fragment processing.
- antialiasing should be handled using Cogl's multisampling API
XXX: This is a work in progress!!
TODO:
- handle at least basic radial gradients (No need to handle full
pdf semantics, since css, svg and canvas only allow radial gradients
defined as one circle + a point that must lie within the first
circle.) - currently we fall back to pixman for radial gradients.
- support glyph rendering with a decent glyph cache design. The
current plan is a per scaled-font growable cache texture + a
scratch cache for one-shot/short-lived glyphs.
- decide how to handle npot textures when lacking hardware support.
Current plan is to add a transparent border to npot textures and use
CLAMP_TO_EDGE for the default EXTEND_NONE semantics. For anything else
we can allocate a shadow npot texture and scale the original to fit
that so we can map extend modes to texture sampler modes.
|
|
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>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
boilerplate/cairo-boilerplate-pdf.c | 4 ++++
boilerplate/cairo-boilerplate-ps.c | 4 ++++
boilerplate/cairo-boilerplate-svg.c | 4 ++++
build/configure.ac.system | 2 +-
4 files changed, 13 insertions(+), 1 deletions(-)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
The boilerplate code will now also print the low 16 bits of the sequence number
for errors and events. This should make it a lot easier to find errors in e.g.
a long xtrace output.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
Since commit 968eb30bba1dc94, we use xcb_discard_reply(). This function was
added in libxcb 1.6.
"Fixes": https://bugs.freedesktop.org/show_bug.cgi?id=40925
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
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>
|
|
test-base basically implements rendering ala cairo-1.0 and so serves as
a useful baseline for comparing enhancements and to regression test the
core libraries.
|
|
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. :)
|
|
The mime surface is a user-callback surface designed for interfacing
cairo with an opaque data source. For instance, in a web browser, the
incoming page may be laid out and rendered to a recording surface before
all the image data has finished being downloaded. In this circumstance
we need to pass a place holder to cairo and to supply the image data
later upon demand.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
I'm willing to make this a supported backend as I find it to be an
invaluable debugging tool...
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Another logging passthrough surface that records the style of operations
performed trying to categorise what is slow/fast/important.
In combination with perf/cairo-analyse-trace it is very useful for
understanding what a trace does. The next steps for this tool would be
to identify the slow operations that the trace does. Baby steps.
This should be generally useful in similar situations outside of perf/
and should be extensible to become an online performance probe.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Create an image surface of equivalent content to the original.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Every xcb surface had its own copy of the flags from the time that it was
created. This means that, if you want to make use of
cairo_xcb_device_debug_cap_xrender_version() and
cairo_xcb_device_debug_cap_xshm_version(), you first had to create a dummy xcb
surface, use that to get access to the cairo_device_t so that you can use these
functions and only then create your real surface, because the change only
affected new surfaces.
This commit changes everything to use the connection's flag and removes the
per-surface flags. This avoids the dummy surfaces completely.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
A demonstration of step 2, improves performance for selected benchmarks
on selected GPUs by up to 30%.
firefox-fishbowl on snb {i5-2520m): 42s -> 29s.
firefox-talos-gfx on snb: 7.6 -> 5.2s.
firefox-fishbowl on pnv (n450): 380 -> 360s.
Whist this looks like it is getting close to as good as we can achieve,
we are constrained by both our API and Xrender and fishbowl is about 50%
slower than peak performance (on snb).
And it fixes the older performance regression in firefox-planet-gnome.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
The experiment was at best a pyrrhic victory. Whilst it did show that
you could successfully subvert cairo_xcb_surface_t and provide the
rendering locally faster (than the xlib driver at that time), any
performance benefits were lost in the synchronisation overheads and
server-side buffer allocation.
Once cairo-gl is mature, we need to look at how we can overcome these to
improve client-side rendering
In the meantime, cairo-xcb is no longer my playground for
experimentation and is shaping up to become a stable backend...
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
I've since incorporated (nearly) all the features from cairo-drm into
xf86-video-intel, making this experiment defunct.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
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>
|
|
render.h gives us nice descriptive names for the precise/imprecise poly modes.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
The window description flag macros are prefixed with DWDESC_.
The issue was not noticed because DWDESC_CAPS and DSDESC_CAPS have the
same value.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=37049
|
|
Avoid ovverriding LINK, as it has a special meaning for the MSVC build
tools.
|
|
On Win32 INT_MIN/MAX macros are defined in stdint.h, which makes MSVC
complain about the following redefinitions:
...\stdint.h(73) : warning C4005: 'INT16_MIN' : macro redefinition
...\boilerplate\cairo-boilerplate.h(64) : see previous definition of 'INT16_MIN'
...\stdint.h(77) : warning C4005: 'INT16_MAX' : macro redefinition
...\cairo-boilerplate.h(67) : see previous definition of 'INT16_MAX'
...\stdint.h(80) : warning C4005: 'UINT16_MAX' : macro redefinition
...\boilerplate\cairo-boilerplate.h(70) : see previous definition of 'UINT16_MAX'
|
|
The Microsoft C Compiler does not accept empty-initialized arrays:
cairo-boilerplate-win32-printing.c(373) : error C2059: syntax error : '}'
cairo-boilerplate-win32-printing.c(374) : warning C4034: sizeof returns 0
|
|
cairo-boilerplate-constructors.c is one of the sources required to
build the boilerplate.
This file is generated by a script, invoked by the appropriate make
target during the build.
|
|
A deficiency of cairo-perf-trace is that it currently always uses similar
surfaces for new surface which are kindly cleared by Cairo. This does
not accurately reflect the captured trace and introduces large bandwidth
overheads that distort the profiles.
So we introduce a new boilerplate hook so that the targets can create a
surface without incurring additional overheads.
[Fixes the broken partial commit of bf1b08d066e.]
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
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>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
When running cairo-test-suite with "-a", backends are also tested with a
non-zero device offset. However, for "xcb-window&" the boilerplate incorrectly
overwrote the device offset with a zero offset again.
This caused all test results to be offset by 25 pixels which obviously makes all
tests fail.
Just removing the call to cairo_surface_set_device_offset solves the problem.
Signed-off-by: Uli Schlachter <psychon@znc.in>
|