Commit graph

25 commits

Author SHA1 Message Date
Andrea Canciani
80c46d400b test: Fix any2ppm on MSVC
C99 initialization is not allowed.

Error macros are used even in the non-daemon version, hence errno.h
should always be included.

Fixes:

any2ppm.c(107) : error C2065: 'EINTR' : undeclared identifier
any2ppm.c(107) : error C2051: case expression not constant
any2ppm.c(108) : error C2065: 'EAGAIN' : undeclared identifier
any2ppm.c(108) : error C2051: case expression not constant
any2ppm.c(271) : error C2059: syntax error : '.'
2012-02-16 23:00:59 +01:00
Benjamin Otte
9dcd29bef4 test: Add missing format to any2ppm to silence gcc 2011-02-18 18:53:45 +01:00
Chris Wilson
f74b11415a test: Use a group to render PDF correctly using poppler.
In order to support blend modes, we need to use a clear background
whilst rendering the PDF, which inspired the use of DEST_OVER to avoid
having to render to an intermediate surface. However, the adjunct of
using subpixel text means that we cannot simply using the alpha channel
as the sole mask and so need to render to an intermediate and paint it
over an opaque background.
2010-06-11 14:12:23 +01:00
Chris Wilson
7f227ec8d3 Revert "test/pdf2png: Don't use DEST_OVER as poppler starts using subpixel text."
This reverts commit 506b2ebe71.

We have conflicting requirements here. In order to support extended
blend modes correctly we need to use DEST_OVER, at the expense of
supporting subpixel text. More thought required.
2010-06-11 12:54:15 +01:00
Chris Wilson
506b2ebe71 test/pdf2png: Don't use DEST_OVER as poppler starts using subpixel text.
Using DEST_OVER in this form to paint the background white fails in the
presence of subpixel geometry (particular text), so remove the hack and
simply paint the background white prior to passing the surface to
poppler. KISS.
2010-06-11 12:07:21 +01:00
Chris Wilson
a7cb314b06 test/any2ppm: Check for errors after executing script. 2010-03-21 20:40:54 +00:00
M Joonas Pihlaja
5b7f4bb241 api: Introduce CAIRO_FORMAT_INVALID formally in the API.
We were exposing the actual value of CAIRO_FORMAT_INVALID
through API functions already, so it makes sense to just
go ahead and put it in the cairo_format_t enum.
2010-03-01 01:21:31 +02:00
Chris Wilson
411c09eed7 perf: Enable a surface cache for perf-trace
Real applications that control their Drawable externally to Cairo are
'disadvantaged' by cairo-perf-trace when it creates a similar surface
for each new instance of the same Drawable. The difficulty in
maintaining one perf surface for every application surface is that the
traces do not track lifetimes for the application surfaces, so we would
just accumulate stale surfaces. The surface cache takes a different
approach and returns the same surface for each active Drawable, and
maintains a hold-over of the MRU 16 surfaces. This achieves 60-80% hit
rate with firefox, which is probably as good as can be expected.
Obviously for double-buffered applications we only every draw to freshly
created surfaces (and Gtk+ bypasses cairo to do the final copy -- the
ideal application would just use a push-group for double buffering, in
which case we would capture and replay the entire expose event).

To enable use of the surface cache whilst replaying use -c:

  ./cairo-perf-trace -c firefox-talos-gfx
2010-01-22 23:01:46 +00: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
2395bba1e6 [any2ppm] Choose a more appropriate format for the replay content
Actually select a format that matches the request content when replaying
the script to an image.
2009-07-04 18:31:49 +01:00
Carlos Garcia Campos
1e1f4fd092 [test] Use poppler_page_render with a transparent surface
Instead of using an opaque surface filled in white, use a transparent
surface and fill it in white by using CAIRO_OPERATOR_DEST_OVER after
rendering.
2009-07-02 14:50:15 +02:00
M Joonas Pihlaja
d1994d1ac2 [test/any2ppm] Daemonize without BSD's daemon().
Solaris libc doesn't provide daemon() so implement
any2ppm daemon's detaching without it.
2009-06-18 16:07:38 +01:00
Chris Wilson
f178f55e47 [test/any2ppm] Update the cairo-script-interpreter callback.
Reflect the current prototype which now specifies the content to use when
creating the surface.
2009-03-03 10:25:05 +00:00
Chris Wilson
694f2eea9f [test/any2ppm] Add feature checks for daemon()
Add the feature checks for the presence of the daemon() function call.
2009-03-03 10:24:25 +00:00
M Joonas Pihlaja
38ec6e302c [test] Fix any2ppm build when building without the full complement of surfaces.
It was complaining about g_init_type () being used without the proper includes
which would have been pulled in by the svg or poppler includes.
2008-12-23 02:05:32 +02:00
Chris Wilson
3a82f94398 [test] Add util/cairo-script to include path.
any2ppm needs the include path for cairo-script-interpreter so that it can
be built without an existing install.
2008-11-16 18:21:52 +00:00
Chris Wilson
bf309aab60 [configure] Delete CAN_TEST_SCRIPT
A CairoScript interpreter is built under utils and so is always available.
2008-11-16 16:21:37 +00:00
Chris Wilson
cdfffc7420 Add CairoScript interpreter
Add a CairoScript interpreter library and use it to replay the test output
for the CairoScript backend. The library is also used by the currently
standalone Sphinx debugger [git://anongit.freedesktop.org/~ickle/sphinx].
The syntax/operator semantics are not yet finalized, but are expected to
mature before the next stable release.
2008-11-13 11:36:55 +00:00
Chris Wilson
a856371bef Add CairoScript backend.
A new meta-surface backend for serialising drawing operations to a
CairoScript file. The principal use (as currently envisaged) is to provide
a round-trip testing mechanism for CairoScript - i.e. we can generate
script files for every test in the suite and check that we can replay them
with perfect fidelity. (Obviously this does not provide complete coverage
of CairoScript's syntax, but should give reasonable coverage over the
operators.)
2008-11-13 11:36:54 +00:00
Chris Wilson
cd2e18ddc6 [test] Fix-up rgb byte packing
Another embarrassing, but thankfully, trivial bug.
2008-11-07 19:35:26 +00:00
Chris Wilson
6736faba3e [test/any2ppm] Do not attempt to compile PS without spectre
Since CAN_TEST_PS_SURFACE does not currently require spectre, we were
attempting to compile in spectre support for any2ppm even on systems
without libspectre installed. Fix that by adding a separate flag for
CAIRO_HAS_SPECTRE.
2008-10-11 19:01:43 +01:00
Carlos Garcia Campos
3e6afb353d [test/any2ppm] Enable PS conversion using libspectre.
Complete the vector trilogy using libspectre to provide a similar
interface (to poppler and librsvg) around GhostScript.
2008-10-09 12:25:08 +01:00
Chris Wilson
f2c484d73c [test/any2ppm] Handle short reads/writes.
No excuse other than simple laziness - it manifested itself with random
"error whilst reading" failures.
2008-09-26 13:42:28 +01:00
Chris Wilson
49b9a21e0b [test/any2ppm] Handle filenames with multiple-dots.
Use strrchr() to find the extension, as strchr() is fooled too easily.

As spotted by Carlos Garcia Campos.
2008-09-24 02:03:10 +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