Commit graph

37 commits

Author SHA1 Message Date
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
Dave Yeo
a7b2c28adf On OS/2, WIFSIGNALED and WTERMSIG are prototyped in sys/wait.h
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>
2011-09-18 08:50:26 +01:00
Andrea Canciani
5cb18fcec7 test: Fix compilation on win32
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
2011-06-14 16:46:32 +02:00
Chris Wilson
d673b9547f boilerplate: Introduce create_similar hook
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>
2011-06-02 09:11:32 +01:00
Adrian Johnson
126108a6ac Boilerplate: Set fallback resolution using force_fallbacks function
cairo_set_fallback_resolution() does not work when testing rgb24 surfaces
2010-11-28 03:38:42 +10:30
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
Benjamin Otte
9df81fe4d3 boilerplate: don't compile pdf test code when pdf is not tested
Avoids gcc warnings when libpoppler version isn't good enough.
2010-05-02 20:00:08 +02:00
Chris Wilson
3ae5723464 boilerplate: Ensure that the recording surfaces are finished.
Be paranoid and explicitly call finish to cleanup self-referential leaks
when using paginated/recording surfaces.
2010-04-30 10:16:23 +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
d2f251f84b configure: Globally define AC_GNU_SOURCE
We were using _GNU_SOURCE throughout the codebase, so simply define it
once during configure. This is the easiest method to enable recursive
mutexes using pthreads, as required in a pending patch.
2010-01-22 23:01:50 +00:00
M Joonas Pihlaja
43a775f60d [meta] Rename cairo_meta_surface_t to cairo_recording_surface_t.
The new name is more descriptive than the rather opaque meta surface.
Discussed with vigour on the mailing list and #cairo:

http://lists.cairographics.org/archives/cairo/2009-July/017571.html
2009-10-22 02:29:47 +03:00
Chris Wilson
9389cb78a8 [build] Improve handling of missing test apparatus
Improve detection, reporting and disabling of test backends when we lack
the required libraries and utilities.
2009-09-08 17:51:33 +01: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
e577096dff [boilerplate] Fix compilation against old revisions (as old as 1.9.2!) 2009-07-24 10:57:26 +01:00
Chris Wilson
bed2701e1c Remove clip handling from generic surface layer.
Handling clip as part of the surface state, as opposed to being part of
the operation state, is cumbersome and a hindrance to providing true proxy
surface support. For example, the clip must be copied from the surface
onto the fallback image, but this was forgotten causing undue hassle in
each backend. Another example is the contortion the meta surface
endures to ensure the clip is correctly recorded. By contrast passing the
clip along with the operation is quite simple and enables us to write
generic handlers for providing surface wrappers. (And in the future, we
should be able to write more esoteric wrappers, e.g. automatic 2x FSAA,
trivially.)

In brief, instead of the surface automatically applying the clip before
calling the backend, the backend can call into a generic helper to apply
clipping. For raster surfaces, clip regions are handled automatically as
part of the composite interface. For vector surfaces, a clip helper is
introduced to replay and callback into an intersect_clip_path() function
as necessary.

Whilst this is not primarily a performance related change (the change
should just move the computation of the clip from the moment it is applied
by the user to the moment it is required by the backend), it is important
to track any potential regression:

ppc:
Speedups
========
image-rgba         evolution-20090607-0    1026085.22 0.18% -> 672972.07 0.77%:  1.52x speedup
▌
image-rgba         evolution-20090618-0    680579.98 0.12% -> 573237.66  0.16%:  1.19x speedup
▎
image-rgba      swfdec-fill-rate-4xaa-0    460296.92 0.36% -> 407464.63  0.42%:  1.13x speedup
▏
image-rgba      swfdec-fill-rate-2xaa-0    128431.95 0.47% -> 115051.86  0.42%:  1.12x speedup
▏
Slowdowns
=========
image-rgba     firefox-periodic-table-0    56837.61 0.78% -> 66055.17    3.20%:  1.09x slowdown
▏
2009-07-23 15:32:14 +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
dd842a2bed [boilerplate] Missing static on pdf user data key. 2009-06-19 19:06:17 +01:00
Chris Wilson
b3462c5616 [test] Convert a few residual '-out.*'
Catch a few -out.* hiding in boilerplate.
2008-11-03 14:24:39 +00:00
Chris Wilson
9841d9d58e Automate error checking for fallback-resolution.
For this we extend the boilerplate get_image() routines to extract a
single page out of a paginated document and then proceed to manually
check each page of the fallback-resolution test.

(Well that's the theory, in practice SVG doesn't support multiple pages
and so we just generate a new surface for each resolution. But the
infrastructure is in place so that we can automate other tests,
e.g. test/multi-pages.)
2008-09-28 14:57:12 +01:00
Chris Wilson
48099af9fe [boilerplate] Retry conversion in process if first attempt fails.
One possibility for a read failure whilst converting the image is if the
external utility crashed. This information is important for the test suite
as knowing input that causes the converter to crash is just as vital as
identifying a crash within the library.
2008-09-26 13:42:28 +01:00
Chris Wilson
b9287e6669 [test] Cache last output and compare next time.
Compare the current output against a previous run to determine if there
has been any change since last time, and only run through imagediff if
there has been. For the vector surfaces, we can check the vector output
first and potentially skip the rasterisation. On my machine this reduces
the time for a second run from 6 minutes to 2m30s. As most of the time,
most test output will remain unchanged, so this seems to be a big win. On
unix systems, hard linking is used to reduce the amount of storage space
required - others will see about a three-fold increase in the amount of
disk used.  The directory continues to be a stress test for file selectors.

In order to reduce the changes between runs, the current time is no longer
written to the PNG files (justified by that it only exists as a debugging
aid) and the boilerplate tweaks the PS surface so that the creation date
is fixed. To fully realise the benefits here, we need to strip the
creation time from all the reference images...

The biggest problem with using the caches is that different runs of the
test suite can go through different code paths, introducing potential
Heisenbergs. If you suspect that caching is interfering with the test
results, use 'make -C test clean-caches check'.
2008-08-20 23:56:56 +01:00
Chris Wilson
776844eb9e [boilerplate] Daemonic conversion utility.
In order to achieve substantial speed improvements the external conversion
utilities are rewritten as a daemon that communicates with the test suite
over a local socket. This is faster as it avoids the libtool and dynamic
linker overhead for each invocation, the caches persist between tests and
we no longer require a round trip through libpng.

The daemon is started automatically by the test suite and if communication
cannot be established then it falls back to using a pipe to a normal
conversion utility. The daemon will then persist for 60 seconds waiting
for further connections.

Of course any memory leak (stares at poppler) is exacerbated.
2008-08-19 11:15:12 +01:00
Chris Wilson
cdd021b5fb [boilerplate] Check exit code from system for trapped signals.
If the external conversion utility was killed by a signal (e.g. the user
sent SIGINT), raise that signal within our process as well. This means
that a crash inside poppler or rsvg will be flagged as a crash inside the
test suite, and makes interrupting the test suite far more responsive.
2008-08-18 17:56:21 +01:00
Chris Wilson
17fbb652b1 [test] Avoid redundant writes/reads of test surfaces via png.
As Behdad suggested, we can dramatically speed up the test suite by
short-circuiting the write to a png file, only to then immediately read it
back in. So for the raster based surfaces, we avoid the round-trip through
libpng by implementing a new boilerplate method to directly extract the image
buffer from the test result. A secondary speedup is achieved by caching the
most recent reference image.
2008-08-18 16:18:52 +01:00
Chris Wilson
93af67d7fd [test] Pass a 'complete' name to create_surface().
Construct the test name to pass to the boilerplate creation routines such
that it uniquely identifies the test in terms of test, target, content and
pass (similar, offset, thread). This allows the vector targets to create
output different output files for each test, whereas before, later tests
would overwrite existing files making debugging more difficult.
2008-08-13 22:01:51 +01: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
Carl Worth
43302f0408 Re-enable pdf tests with gradients and add poppler-based reference images
This freezes the current (buggy) poppler result in the test suite
so that we will notice any future regressions.
2008-02-20 04:04:04 -08:00
Carl Worth
635fed7767 Re-enable some pdf tests now that poppler has knockout support
We had several pdf tests disabled waiting for this bug fix:

	Poppler does not correctly handle knockout groups
	https://bugs.freedesktop.org/show_bug.cgi?id=12185

That's in place for poppler now, so we're turning the tests
back on. Some of the affected tests now pass perfectly:

	over-above-source
	over-around-source
	over-below-source
	over-between-source

Some just needed new reference images:

	operator-clear
	clip-operator-pdf-argb32

The remaining tests still fail, but none of the failures can
obviously be ascribed to just poppler problems:

	clip-operator-pdf-rgb24
	operator-source
	unbounded-operator

The first two have some serious problems, while in the case
of unbounded-operator the problem is extremely minor (a white
grid appears in the background where the reference image is
all black).
2008-02-20 04:04:04 -08:00
Carl Worth
e7324454a0 Disable radial-gradient and unbounded-operator tests for pdf
These are failing due to (already reported) poppler bugs.

There were also problems with the gradients in the PDF
files previously, but these have recently been fixed.
2007-08-29 15:26:41 -07:00
Carl Worth
1a6b62e599 Disable 7 cairo-pdf tests due to poppler knockout-group bug
The following 7 tests currently fail with poppler due to:

	Poppler does not correctly handle knockout groups
	https://bugs.freedesktop.org/show_bug.cgi?id=12185

and we've verified with acroread that the cairo-pdf output
does render as intended there. The disabled tests are
clip-operator, operator-clear, operator-source, over-above-source,
over-around-source, over-below-source, and over-between-source.
2007-08-27 14:45:51 -07:00
Carl Worth
1e8446609b Add explanation of pdf_ignored_tests with links to upstream poppler bug reports 2007-08-27 14:02:55 -07:00
Carl Worth
2dcfb944b0 Don't test PDF tests known to fail due to poppler limitations
The following four tests are disabled:

	gradient-alpha, linear-gradient, text-pattern, trap-clip

We don't use XFAIL as that would disable all backends, (but
we can still usefully use these tests on backends other than
PDF).
2007-04-27 16:41:17 -07:00
Behdad Esfahbod
20ce190e71 [pdf] Get rid of _cairo_pdf_test_force_fallbacks
in favor of cairo_boilerplate_pdf_surface_force_fallbacks.
2007-04-21 02:50:53 -04:00
Behdad Esfahbod
99737a60cb [boilerplate] Clean up includes and remove unnecessary ones 2007-04-20 00:52:03 -04:00
Behdad Esfahbod
8c9960675b [boilerplate] Strip pdf boilerplate into cairo-boilerplate-pdf* 2007-04-20 00:52:02 -04:00