Commit graph

368 commits

Author SHA1 Message Date
Vladimir Vukicevic
22587f57bd Import Qt backend by Mozilla
Written by Vladimir Vukicevic to enable integration with Qt embedded
devices, this backend allows cairo code to target QPainter, and use
it as a source for other cairo backends.

This imports the sources from mozilla-central:
http://mxr.mozilla.org/mozilla-central/find?text=&kind=text&string=cairo-qpainter
renames them from cairo-qpainter to cairo-qt, and integrates the patch
by Oleg Romashin:
https://bugs.freedesktop.org/attachment.cgi?id=18953

And then attempts to restore 'make check' to full functionality.

However:
 - C++ does not play well with the PLT symbol hiding, and leaks into the
   global namespace. 'make check' fails at check-plt.sh

 - Qt embeds a GUI into QApplication which it requires to construct any
   QPainter drawable, i.e. used by the boilerplate to create a cairo-qt
   surface, and this leaks fonts (cairo-ft-fonts no less) causing assertion
   failures that all cairo objects are accounted for upon destruction.

[Updated by Chris Wilson]
Acked-by: Jeff Muizelaar <jeff@infidigm.net>
Acked-by: Carl Worth <cworth@cworth.org>
2009-06-16 11:03:46 +01:00
Chris Wilson
e5727e20f5 Expose _cairo_null_surface_create() via a test surface
Using a null surface is a convenient method to measure the overhead of the
performance testing framework, so export it although as a test-surface so
that it will only be available in development builds and not pollute
distributed libraries.
2009-06-15 12:03:37 +01:00
Chris Wilson
a41e1275d2 [boilerplate] Make array of targets const.
Protect the boilerplate targets from unexpected modifications.
2009-06-12 22:28:38 +01:00
Chris Wilson
6aebde6598 [boilerplate] Export cairo_boilerplate_get_image_target()
A routine to scan the compiled list of targets and return the entry
corresponding to the image backend.
2009-06-12 22:28:38 +01:00
Chris Wilson
844c809698 [boilerplate] Print out known targets on error.
Improve the 'Cannot find target ...' error message for an incorrect
CAIRO_TEST_TARGET by actually listing the targets that have been compiled
into the test suite.
2009-06-09 12:45:53 +01:00
Chris Wilson
7a95b2745a [boilerplate] Minor typo in win32-printing 2009-06-06 21:36:08 +01:00
Chris Wilson
7ed050fd43 [perf] Benchmark traces
Add a variant of cairo-perf that measures the time to replay traces.
2009-06-02 15:13:47 +01:00
Eric Anholt
f59f44c140 Merge commit 'origin/master' into gl
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
2009-06-02 00:56:39 -07:00
Chris Wilson
87b764908a [gl] Add EGL target
Split the GLX context from the GL surface to enable use of an alternative
EGL interface.
2009-05-20 08:13:45 +01:00
Chris Wilson
c488b33644 [test] Create a new fallback surface to exercise 16-bit paths.
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.
2009-05-05 21:17:11 +01:00
Jeff Muizelaar
2d6336624c [test-win32] Fix static linking of the test suite.
Previously, the test suite needed to be dynamically linked to work.
2009-04-01 11:32:58 -04:00
Chris Wilson
b580a4a8d6 [test] Improve fault injection coverage
In order to exercise the meta-surfaces, we need to inject faults into
cairo_surface_finish().
2009-03-31 12:16:01 +01:00
Eric Anholt
809f7dc4c8 [gl] Make sure test visuals for CAIRO_CONTENT_COLOR_ALPHA have alpha bits.
Since we're just making FBOs, the visual chosen probably shouldn't matter,
and it doesn't on Intel.  But it does seem like the right thing to do.
2009-03-28 21:48:42 -07:00
Behdad Esfahbod
3ec94f9b59 Support compiling without fontconfig
Adds a new, fake, fontconfig font backend.  Fontconfig can be disabled
using --disable-fc, in which case the toy text API wont find fonts and
the internal font will always be used.

Also defines the feature macro CAIRO_HAS_FC_FONT.  The two fontconfig-specific
functions in cairo-ft.h depend on that macro now.
2009-03-17 00:58:40 -04:00
M Joonas Pihlaja
e380beae53 [sdl] Remove new backend.
The SDL backend makes invalid assumptions about SDL_Surface locking
semantics and doesn't deal correctly with the unpremultiplied pixel
format supported by SDL.  Removed as per discussion on the mailing list.

http://lists.cairographics.org/archives/cairo/2009-February/016595.html
2009-02-16 14:01:43 +02:00
Eric Anholt
31fb7382d2 [gl] Fix some memory leaks on boilerplate-based runs. 2009-02-12 04:10:52 -08:00
Eric Anholt
235de8d7a4 [gl] Add basics for GL surface backend using test-fallback as base. 2009-02-05 09:38:43 -08:00
Chris Wilson
aaec63d483 [scaled-font] Global glyph cache
Currently glyphs are cached independently in each font i.e. each font
maintains a cache of up to 256 glyphs, and there can be as many scaled fonts
in use as the application needs and references (we maintain a holdover
cache of 512 scaled fonts as well).

Alternatively, as in this patch, we can maintain a global pool of glyphs
split between all open fonts. This allows a heavily used individual font
to cache more glyphs than we could allow if we used per-font glyph caches,
but at the same time maintains fairness across all fonts (by using random
replacement) and provides a cap on the maximum number of global glyphs.

The glyphs are allocated in pages, which are cached in the global pool.
Using pages means we can exploit spatial locality within the font
(nearby indices are typically used in clusters) to reduce frequency of small
allocations and allow the scaled font to reserve a single MRU page of
glyphs. This caching dramatically reduces the cairo overhead during the
cairo-perf benchmarks, and drastically reduces the number of allocations
made by the application (for example browsing multi-lingual site with
firefox).
2009-01-29 10:10:39 +00:00
Behdad Esfahbod
06deaa98b6 [build] Include all generated win32 build files in the repo
So a git clone can be built on win32.  The files only change after adding
new backends.
2009-01-09 15:55:24 -05:00
Chris Wilson
388ae177e4 [boilerplate] Remove CAIRO_BOILERPLATE_LOG()
The variadic macro is only used within boilerplate/ so replace it with a
simple, and portable, call to fprintf.
2009-01-03 22:56:17 +00: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
75538962c8 [boilerplate] Check the return of pclose()
pclose() returns the child exit status, so we can use that to detect
errors in the convertor process.
2009-01-03 21:52:58 +00:00
Chris Wilson
dc33ae2461 [boilerplate] Use pclose() after popen
Joonas pointed out that we should be using pclose() on a stream returned
by popen().
2009-01-02 15:44:52 +00:00
Chris Wilson
43edb4dd7b Fix compilation with gcov
We need to add --coverage to LDFLAGS, so create CAIRO_LDFLAGS and use that
to populate AM_LDFLAGS.
2008-12-14 16:44:03 +00:00
Chris Wilson
903b39c304 [test] Make the xlib-fallback use the image refs.
The xlib-fallback is closer to the image than the xlib backend, so prefer
not to use the xlib.ref.png.
2008-12-12 13:43:36 +00:00
Paolo Bonzini
487c708b3b [boilerplate] fix compilation for glitz-agl
As suggested on the list, this splits the cairo-boilerplate-glitz.c
file in three separate files, one for each backend.  Furthermore,
it fixes a few problems in compilation of the AGL backend test harness.
2008-11-25 20:40:37 +08: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
68309481aa [test] Mark targets with is_meta?
Allow tests to skip targets based on whether they are a meta surface or
not.
2008-11-05 08:36:01 +00: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
Behdad Esfahbod
81c3009c07 [boilerplate/Makefile.win32] Only build source files, not headers 2008-10-31 16:45:58 -04:00
Chris Wilson
e90073f7dd [test] Build test suite into single binary.
Avoid calling libtool to link every single test case, by building just one
binary from all the sources.

This binary is then given the task of choosing tests to run (based on user
selection and individual test requirement), forking each test into its own
process and accumulating the results.
2008-10-31 12:30:11 +00:00
Chris Wilson
f03d3f9f7f [boilerplate] Remove #if VERSION>1.9.0
Remove the obsolete #if statement.
2008-10-30 19:24:29 +00:00
Chris Wilson
cf072c7203 [sdl] Add new backend.
Add a new backend to allow easy interoperability with the Simple
DirectMedia Layer.
2008-10-30 17:04:53 +00:00
Carl Worth
eed6771764 Disable the svg12 target in boilerplate.
This target was added to the boilerplate during 1.8.1. It currently
shows many failures in the test suite. These failures likely fall
into three different classes:

	* Tests needing new svg12-specific reference images

	* Tests exercising bugs in librsvg

	* Tests exercising existing cairo bugs

We haven't gone through the effort to separate these, but even for
the tests that are exercising actual cairo bugs, these are likely
bugs that existed in the cairo 1.8.0 release and not regressions.

Because of that, in this commit I'm conditionally disabling the
testing of the svg12 target. As soon as we increment the cairo
version to 1.9.0 or higher, this target will get re-enabled
automatically and we can begin the work to separate the tests as
described above and also fix the bugs.
2008-10-28 17:12:15 -07:00
Chris Wilson
786bea48df [boilerplate/directfb] Create ARGB surfaces on demand.
Create an RGB or ARGB surface depending upon the content type of the test
target, with the result that the directfb rgb24 target no longer
unconditionally fails.
2008-10-20 23:20:22 +01:00
Chris Wilson
8e0950ced8 [boilerplate/directfb] Gracefully handle failure to create surface.
Simply return NULL indicating failure to create the target surface rather
than aborting the test (allowing other targets to be tested).
2008-10-19 12:32:41 +01:00
Chris Wilson
fc04a1e0db [boilerplate] Fixup compilation for gliitz.
Convert a few old references to cairo_boilerplate_surface_set_user_data.
2008-10-15 12:13:40 +01:00
Behdad Esfahbod
f8018cf193 [boilerplate] Fix "make dist"
The cairo-boilerplate-ps/pdf/svg.h files where removed in commit
9841d9d58e but the Makefile.sources
listing was not updated.
2008-10-06 11:45:08 -04:00
Behdad Esfahbod
e3f9e40df7 Fix residues of the Makefile.*.config Makefile.*.features renaming
They just don't seem to want to die...
2008-09-29 11:49:50 -04:00
Chris Wilson
3ff86a4510 [test] Disable caching of SVG fail/pass surfaces.
As we use cairo to convert SVG files back to an image, that process is
dependent upon changes within our library and so we cannot skip the
conversion if the SVG file happens to match a previous run. Fortunately,
librsvg is quick enough that this is not a major issue.
2008-09-29 09:08:10 +01: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
e0f2147107 [boilerplate] Add a PS 2 target.
Ensure that we can generate PS2 output when required by creating a PS
level 2 target and using GhostScript for conformance testing.
2008-09-26 17:26:25 +01:00
Chris Wilson
0c030d3b76 [boilerplate] Add svg-1.2 target.
SVG 1.2 is sufficiently different from 1.1 that it has separate code
paths within cairo-svg-surface and so justifies its own boilerplate
target.
2008-09-26 17:11:51 +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
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
Behdad Esfahbod
e84ef3c54e [.gitignore] Remove Makefile.*.config
I renamed those generated files to Makefile.*.features but forgot to
update ignore lists.  Carl already added the new ones, but didn't
remove the old ones.
2008-09-24 20:00:30 -04:00
Carl Worth
9335ad313f Ignore generated files.
I know that I didn't create these Makefile.win32.features files,
so I assume that they are the result of Behdad's build magic and
that he just forgot to add them to .gitignore.
2008-09-24 16:20:35 -07:00
Behdad Esfahbod
ebb5eb57b7 Generate build/Makefile.win32.features 2008-09-22 22:24:38 -04:00