Commit graph

176 commits

Author SHA1 Message Date
Chris Wilson
9b42b6156d build: Add -pthread to real_pthread_CFLAGS 2009-11-02 12:50:45 +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
M Joonas Pihlaja
d5609ca04e [build] Check compiler flags using AC_TRY_LINK instead of AC_TRY_COMPILE.
Turns out we were passing suncc warning suppression flags to gcc
by mistake since -e<entry point> is actually a valid option for
gcc.  This caused the -erroff=E_ENUM_TYPE_MISMATCH_ARG and other
-erroff options to be passed to the linker.  In the normal case
of a GNU ld linker this doesn't matter since it ignores bogus
entry points, but the GNU gold linker replaces a bogus entry
point with NULL.  This patch makes the CAIRO_CC_TRY_FLAG()
check stricter by testing that the flag doesn't interfere with
linking executables.
2009-10-15 17:47:33 +03:00
Chris Wilson
dac73d260a [build] Link against pthread-stubs
Avoid pulling in the real pthread library if the application is single
threaded and not using pthreads, by linking against pthread-stubs
instead.
2009-10-15 13:05:47 +01:00
Chris Wilson
ef9286751d [atomic] Fallback to libatomic-ops-dev
Use libatomic-ops-dev in preference to mutex-based atomics, if we do not
have the builtin atomic intrinsics available.
2009-10-15 13:05:46 +01:00
Sebastian Dröge
56c9b2de7a Use __uint128_t and __int128_t if available
GCC uses a peculiar name for a real 128-bit integer on x86-64.

Speedups, xlib on a gm45
========================
poppler        41246.56 -> 35102.82: 1.18x speedup
swfdec-youtube 12623.01 -> 11936.79: 1.06x speedup

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-09-15 18:19:08 +01:00
Chris Wilson
9c2790ccc4 [build] Add a default message for when GLEW isn't built
And it appears I touched the build system again and autoregenerated the
feature headers.
2009-09-14 10:10:45 +01:00
Chris Wilson
6d4f3c40ef Add a private copy of GLEW
This appears to be the simplest mechanism to build libglew at the moment -
should a system copy be unavailable.  Fortunately libglew is now distributed
under a permissive licence.

If you want to pass 'make -C src check' you have to use the system copy,
or spend quite a bit of time cairo-fying libglew.
2009-09-14 09:26:02 +01:00
M Joonas Pihlaja
71c3b2888c [win32] Sync Makefile.win32.features.
Ooops.. wasn't sure if I should commit this or not.
2009-09-13 20:33:42 +03:00
Chris Wilson
6cb3ff9c19 [configure] --enable-symbol-lookup
There you go Joonas, I don't always ignore your suggestions! This is
simple patch to allow the user to disable symbol loops in case the
auto-detection fails on some obscure (perhaps OpenBSD) platform. Or in
case the user really wants to trim a few bytes from a library only used
during tracing!
2009-09-13 10:52:14 +01: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
310cebf194 [configure] Add option to disable trace.
Some environments may be broken beyond our capabilities to detect, or
maybe the user is just insane and doesn't want to build my nice shiny
cairo-trace. Whatever, give them the option to choose:

  $ ./configure --disable-trace
2009-09-05 15:21:50 +01:00
M Joonas Pihlaja
f5df38ca5e [build] Fix typos in prototype warnings.
The -Wstrict-prototypes and -Wmissing-prototypes warnings
weren't actually in use due to typos.
2009-09-02 06:40:35 +03:00
M Joonas Pihlaja
c086b40a93 [build] Hush the Solaris compiler about enum abuse.
Sun Studio 12 doesn't like it when we mix our
enum values and types.  We do that a lot on purpose
so the warnings from compiles were very verbose.
2009-09-02 06:38:15 +03:00
M Joonas Pihlaja
f081a5ff55 [build] Refine the -Wno-attribute test to check our use cases.
We don't actually check that -Wno-attribute does what
we think it does.  On clang it doesn't since it happily
seems to recognize but ignore the attribute.

This patch factors out a silent version of CAIRO_CC_TRY_FLAG
which accepts an optional program argument and actually tests
that the compiler doesn't produce any warning messages.  It
is then used to check that -Wno-attribute doesn't complain
when the __warn_unused_result__ attribute is applied to
void functions or variables.
2009-09-02 06:35:14 +03:00
M Joonas Pihlaja
b509b548b1 [trace] Check for __builtin_return_address explicitly.
Some other compilers such as clang and icc support the
__builtin_return_address() intrinsic as well, so we don't
need to check for __GNUC__ >= 3 only.
2009-09-02 04:50:21 +01:00
M Joonas Pihlaja
b5cf24a4fb [build] Remove duplicate invocation of AC_CHECK_HEADERS.
The fenv.h stuff was checked twice.
2009-08-31 16:06:31 +03:00
Vladimir Vukicevic
d7faec024a Add skia backend
Originally written by Vladimir Vukicevic to investigate using Skia for
Mozilla, it provides a nice integration with a rather interesting code
base. By hooking Skia underneath Cairo it allows us to directly compare
code paths... which is interesting.

[updated by Chris Wilson]
2009-08-29 17:07:35 +01:00
Chris Wilson
f99e184144 [build] Remove -Wcast-align
Use -Wcast-align simply generates too much noise due to false-positive
reports when casting pixels to uint32_t.
2009-08-29 17:07:35 +01:00
Chris Wilson
425b0e35e2 Add xml surface
A very simple surface that produces a hierarchical DAG in a simple XML
format. It is intended to be used whilst debugging, for example with the
automatic regression finding tools of cairo-sphinx, and with test suites
that just want to verify that their code made a particular Cairo call.
2009-08-29 17:07:34 +01:00
Chris Wilson
658cdc7c9a Introduce cairo_tee_surface_t
Add a new surface type that multiplies it input onto several output
surfaces. The only limitation is that it requires a master surface that is
used whenever we need to query surface options, such as font options and
extents.
2009-08-29 08:08:39 +01:00
Chris Wilson
eba6b5126a [build] Add options for warning about bad casts
-Wbad-function-cast in particular. Triggers quite a few warnings where we
have explicitly cast to an integer.
2009-08-29 08:08:38 +01:00
Behdad Esfahbod
90536ef2dd [build] Remove bogus warning that we require at least one native font backend
That limitation was lifted long ago after twin face was introduced.
2009-08-25 00:28:08 -04:00
Behdad Esfahbod
20e227fc39 [build] Fix typo 2009-08-24 23:57:21 -04:00
Chris Wilson
920f59a755 [build] Configure switch to disable atomics
Workaround for my arm toolchain which succeeds in linking the configure
program, only to complain when linking a program (such as cairo-perf)
against libcairo.so. Annoying.
2009-08-06 10:16:33 +01:00
Chris Wilson
51bd27afa1 [boilerplate/test] Convert make-*-constructors to shell
Remove the intermediate C program that was a nuisance whilst
cross-compiling and replace it with a simple shell script that is just a
combination of cat + sed.
2009-08-06 10:11:32 +01:00
Chris Wilson
c3f2db4f73 [drm] Add an accelerated image surface.
Use the DRM interface to h/w accelerate composition on image surfaces.
The purpose of the backend is simply to explore what such a hardware
interface might look like and what benefits we might expect.  The
use case that might justify writing such custom backends are embedded
devices running a drm compositor like wayland - which would, for example,
allow one to write applications that seamlessly integrated accelerated,
dynamic, high quality 2D graphics using Cairo with advanced interaction
(e.g. smooth animations in the UI) driven by a clutter framework...

In this first step we introduce the fundamental wrapping of GEM for intel
and radeon chipsets, and, for comparison, gallium. No acceleration, all
we do is use buffer objects (that is use the kernel memory manager) to
allocate images and simply use the fallback mechanism. This provides a
suitable base to start writing chip specific drivers.
2009-07-23 16:18:42 +01:00
Chris Wilson
1ae5942a3a Merge commit 'anholt/gl'
Conflicts:
	boilerplate/Makefile.sources
	boilerplate/cairo-boilerplate.c
	build/configure.ac.features
	src/cairo.h
	util/cairo-script/Makefile.am
2009-07-21 22:28:44 +01:00
Chris Wilson
2dd97ae59c [perf] Include trace comparison in html output 2009-07-20 22:20:01 +01:00
Chris Wilson
ebac096648 [build] And export CC_FOR_BUILD so that we can actually use it! 2009-07-20 19:54:40 +01:00
Chris Wilson
ed7853d499 [build] Use ${CC} as the default value for CC_FOR_BUILD 2009-07-20 19:38:34 +01:00
Chris Wilson
52fa8760ae Add OpenVG backend.
Based on the work by Øyvind Kolås and Pierre Tardy -- many thanks to
Pierre for pushing this backend for inclusion as well as testing and
reviewing my initial patch. And many more thanks to pippin for writing the
backend in the first place!

Hacked and chopped by myself into a suitable basis for a backend. Quite a
few issues remain open, but would seem to be ready for testing on suitable
hardware.
2009-07-17 11:50:02 +01:00
Chris Wilson
6003ab77e1 Export meta-surface
The meta-surface is a vital tool to record a trace of drawing commands
in-memory. As such it is used throughout cairo.

The value of such a surface is immediately obvious and should be
applicable for many applications. The first such case is by
cairo-test-trace which wants to record the entire graph of drawing commands
that affect a surface in the event of a failure.
2009-07-03 18:26:50 +01:00
Chris Wilson
758a18b354 [test] Timeout support for tests
Enforce that each test must render within 60 seconds or be considered to
have hit an infinite loop and be reported as a CRASH. The timeout value is
adjustable via CAIRO_TEST_TIMEOUT -- a value of 0 will disable.
2009-06-28 21:10:30 +01:00
Chris Wilson
b82e7740c1 [atomic] Silence compiler warnings by defining an intptr_t
Evaulate the integer sizes during configure to find one of the exact same
size as a void* to use in the conversion of the atomic ptr cmpxchg to an
atomic int cmpxchg.
2009-06-21 22:25:08 +01:00
M Joonas Pihlaja
fd142d0a6e [shave] Robuster usage of the test shell built-in.
Solaris 9 confuses shave, resulting in an empty variable.
This patch papers over the resulting build failure from
the test shell built-in being called with an empty argument
which was unquoted.
2009-06-18 16:14:50 +01:00
M Joonas Pihlaja
742b1ad4b0 [test] Fix checking of the fenv.h include.
This adds a configure check for fenv.h and makes
invalid-matrix.c check for it with HAVE_FENV_H instead
of HAVE_FEDISABLEEXCEPT -- turns out Solaris doesn't
have fedisableexcept(), but it does have feclearexcept().

The same issue appears on OSX and was fixed in
ab86662ab4. This patch
adds some configure magic.
2009-06-18 16:07:56 +01:00
M Joonas Pihlaja
aafff0b952 [boilerplate] Check for connect() in libsocket.
Solaris requires -lsocket to be able to talk to
the any2ppm daemon over unix domain sockets.
2009-06-18 15:48:59 +01:00
M Joonas Pihlaja
cdd27a8d4c [test] Never use gcc __attribute__ magic for constructors.
The configure test for __attribute__((constructor)) succeeds when
compiling with Sun Studio 12 on OpenSolaris but the attribute
is just ignored and has no actual effect.  This causes the test
suite to not run any tests at all.  With this patch we revert to
always using make-cairo-test-constructors.pl.
2009-06-18 15:39:16 +01:00
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
3fe50a77ea [configure] Rephrase warning message for disabling core features.
"strictly recommended" is an odd phrase and though the stern warning is
appropriate as replacing a system library with a more limited version is
likely to cause mayhem, we are but mere servants and should be reserved in
our parlance.
2009-06-15 12:02:25 +01:00
Chris Wilson
c092136fe9 [configure] Check for shm_open()
As needed for cairo-test-trace.
2009-06-13 19:07:37 +01:00
Carl Worth
d008167b9b Makefile: Fix two typos preventing doc-publish from working
It seems that everything up to this point in release-publish
worked fine, so with these fixes, hopefully the next run of
make release-publish will work without any snags.
2009-06-12 12:08:22 -07:00
Chris Wilson
7f114b781f [doc] Workaround read-only tree during make distcheck
This looks to be an ugly necessity to work-around the nasty issue that
we currently gtkdoc expect to be run inside the source tree. I'm sure
Behdad will be able to resolve this much more elegantly than this quick
and fragile attempt.
2009-06-12 11:15:16 +01:00
Carl Worth
19630f4b73 Make the warning about the need to --enable-gtk-doc more explicit.
I must have read it three times and kept thinking, "but I *did*
just install gtk-doc", before I finally understood what it was
trying to tell me.
2009-06-11 14:54:03 -07:00
Chris Wilson
3aaea453b0 [script] Store fonts inside mmaped files.
As an aide to tiny swapless systems write the rarely used bytes that
define type42 fonts into a deleted file and mmap them back into our
address space.
2009-06-11 22:38:09 +01:00
Chris Wilson
4ccfd474a3 [perf] Switch to using clock_gettime()
Try using clock_gettime() for a high resolution stable time source in
preference to the potentially unstable TSC.
2009-06-06 13:37:00 +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
e4efc80b8e [build] Make valgrind support user-configurable
As the number of places where we add valgrind client requests grows, it
becomes imperative that we should be able to disable them with a simple
configure time option.
2009-05-25 22:14:56 +01: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