Review cairo-test-trace.c and rewrite parts to ease understanding and fix
various bugs - such as failure to notice the slaves crashing and not
releasing our shared memory after an interrupt.
The basic premise is that we feed the trace to multiple backends in
parallel and compare the output at the end of each context (based on
the premise that contexts demarcate expose events, or their logical
equivalents) with that of the image[1] backend. Each backend is
executed in a separate process, for robustness, with the image data
residing in shared memory and synchronising over a socket.
[1] Should be reference implementation, currently the image backend is
considered to be the reference for all other backends.
Quite an expensive test that converts an image into a distorted array of
glyphs, using a perspective transformation taking the intensity of the
pixel as depth. This generates a pretty picture and many overlapping
glyphs.
Provide a mechanism for backends to attach and remove snapshots. This can
be used by backends to provide a cache for _cairo_surface_clone_similar(),
or by the meta-surfaces to only emit a single pattern for each unique
snapshot.
In order to prevent stale data being returned upon a snapshot operation,
if the surface is modified (via the 5 high level operations, and on
notification of external modification) we break the association with any
current snapshot of the surface and thus preserve the current data for
their use.
Felt like pulling the latest stuff, since I branched back in February.
Conflicts:
build/configure.ac.features
src/cairo.h
util/cairo-script/csi-replay.c
test/invalid-matrix deliberately feeds garbage into the API to test our
error detection. This causes FPE to be raised during the course of the
test - so they are deliberately disable for the duration. However, the
exceptions were not being cleared and so the FPE could be triggered on
the next floating point operation. This was being masked during make check,
by the fact that each test is run in its own forked process and was only
observed when multiple tests were run in foreground mode.
The test suite depends upon many external factors and in order to achieve
a pass, your system must match that upon which the reference images were
generated. Add a note to read test/README in case of failures so that the
casual user is not unduly alarmed by cairo reportedly failing.
Damian Frank noted
[http://lists.cairographics.org/archives/cairo/2009-May/017095.html]
a performance problem with an older XServer with an
unaccelerated composite - similar problems will be seen with non-XRender
servers which will trigger extraneous fallbacks. The problem he found was
that painting an ARGB32 image onto an RGB24 destination window (using
SOURCE) was going via the RENDER protocol and not core. He was able to
demonstrate that this could be worked around by declaring the pixel data as
an RGB24 image. The issue is that the image is uploaded into a temporary
pixmap of matching depth (i.e. 32 bit for ARGB32 and 24 bit for RGB23
data), however the core protocol can only blit between Drawables of
matching depth - so without the work-around the Drawables are mismatched
and we either need to use RENDER or fallback.
This patch adds a content mask to _cairo_surface_clone_similar() to
provide the extra bit of information to the backends for when it is
possible for them to drop channels from the clone. This is used by the
xlib backend to only create a 24 bit source when blitting to a Window.
Add a variation of test-fallback-surface that forces the use of a 16-bit
pixman format code instead of the standard 32-bit types. This creates an
image surface akin to the fallbacks used with low bit-depth xservers.
Do not use the simple malloc() as memfault will inject allocation failures
(unlike xmalloc() for which faults are excluded) - as this is unnecessary
inside the test harness and thus does not exercise any cairo code paths.
Eliminate the need for a runtime test on the sizeof the private structures
by performing the check at compile time. This was provoked by Ginn Chenn
noting that the test was including a private header.
Jeff Muizelaar found a regression in commit 005436 and submitted this
little test to exercise it. The essence of the bug appears to be wrt to
the product of the CTM and device transform matrices.
toy-font-face was checking that cairo_toy_font_face_get_family returned ""
which is CAIRO_FONT_FAMILY_DEFAULT when the freetype font backend is the
default. However, when other font backends are the default the returned family
is different. Therefore, instead of checking for "", we check for the appropriate
string depending on the backend.