Commit graph

240 commits

Author SHA1 Message Date
Andrea Canciani
ed803a1935 build: Add 'clean' target to Makefile.win32 build system
The Makefile.win32 in the subdirectories provide a working 'clean'
target (defined in Makefile.win32.common), the central Makefile.win32
'clean' target does not do anything.

Replace the noop 'clean' target with one that cleans all the subdirs.
2012-02-16 23:00:46 +01:00
Andrea Canciani
dfb8b131f5 win32: Fix Makefile.win32 build
The Makefile.win32 build system assumes that the files are in the same
directory level. If this is not the case, the compiler fails when it
tries to write the object files to a non-existing directory.

This can be fixed simply by making sure that the destination directory
always exists.

Fixes:

fatal error C1083: Cannot open compiler generated file:
'release/win32/cairo-win32-debug.obj': No such file or directory
2012-02-15 19:11:39 +01:00
Robert Bragg
571a27b4fc backends: Adds a new Cogl based backend
This adds a new GPU accelerated backend for Cairo based on the Cogl 3D
graphics API.

This backend aims to support Cairo in a way that translates as naturally
as possible to using a GPU, it does not strive to compete with the
anti-aliasing quality of the image backend if it can't be done
efficiently using the GPU - raw performance isn't the only metric of
concern, so is power usage.

As an overview of how the backend works:
- fills are handled by tessellating paths into triangles
- the backend has an extra fill_rectangle drawing operation so we have
  a fast-path for drawing rectangles which are so common.
- strokes are also tessellated into triangles.
- stroke and fill tessellations are cached to avoid the cpu overhead
  of tessellation and cost of upload given that its common for apps to
  re-draw the same path multiple times. The tessellations can survive
  translations and rotations increasing the probability that they can be
  re-used.
- sources and masks are handled using multi-texturing.
- clipping is handled with a scissor and the stencil buffer which
  we're careful to only update when they really change.
- linear gradients are rendered to a 1d texture using a triangle
  strip + interpolating color attributes. All cairo extend modes
  are handled by corresponding texture sampler wrap modes without
  needing programmable fragment processing.
- antialiasing should be handled using Cogl's multisampling API

XXX: This is a work in progress!!
TODO:
- handle at least basic radial gradients (No need to handle full
  pdf semantics, since css, svg and canvas only allow radial gradients
  defined as one circle + a point that must lie within the first
  circle.) - currently we fall back to pixman for radial gradients.
- support glyph rendering with a decent glyph cache design. The
  current plan is a per scaled-font growable cache texture + a
  scratch cache for one-shot/short-lived glyphs.
- decide how to handle npot textures when lacking hardware support.
  Current plan is to add a transparent border to npot textures and use
  CLAMP_TO_EDGE for the default EXTEND_NONE semantics. For anything else
  we can allocate a shadow npot texture and scale the original to fit
  that so we can map extend modes to texture sampler modes.
2011-10-11 09:05:45 +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
6d6bfbd641 Introduce the cairo-missing library
The cairo-missing library provides the functions which are needed in
order to correctly compile cairo (or its utilities) and which were not
found during configuration.

Fixes the build on MacOS X Lion, which failed because of collisons
between the cairo internal getline and strndup and those in libc:

cairo-analyse-trace.c:282: error: static declaration of ‘getline’ follows non-static declaration
/usr/include/stdio.h:449: error: previous declaration of ‘getline’ was here
cairo-analyse-trace.c:307: error: static declaration of ‘strndup’ follows non-static declaration
...
2011-09-02 12:27:13 +02:00
Andrea Canciani
0101a54579 time: Add cairo_time_t type
Add the cairo_time_t type (currently based on cairo_uint64_t) and use
it in cairo-observer and in the perf suite.

Fixes the build on MacOS X (for the src/ subdir) and Win32, whch
failed because they don't provide clock_gettime:

cairo-surface-observer.c:629: error: implicit declaration of function 'clock_gettime'
cairo-surface-observer.c:629: warning: nested extern declaration of 'clock_gettime'
cairo-surface-observer.c:629: error: 'CLOCK_MONOTONIC' undeclared (first use in this function)
...
2011-09-02 12:27:13 +02:00
Chris Wilson
2220693a40 Introduce cairo_mime_surface_t
The mime surface is a user-callback surface designed for interfacing
cairo with an opaque data source. For instance, in a web browser, the
incoming page may be laid out and rendered to a recording surface before
all the image data has finished being downloaded. In this circumstance
we need to pass a place holder to cairo and to supply the image data
later upon demand.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-15 00:16:09 +01:00
Chris Wilson
62e48b01b4 script: enable by default
I'm willing to make this a supported backend as I find it to be an
invaluable debugging tool...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-14 21:01:29 +01:00
Chris Wilson
eee66899cd Introduce cairo_surface_observer_t for performance analysis
Another logging passthrough surface that records the style of operations
performed trying to categorise what is slow/fast/important.

In combination with perf/cairo-analyse-trace it is very useful for
understanding what a trace does. The next steps for this tool would be
to identify the slow operations that the trace does. Baby steps.

This should be generally useful in similar situations outside of perf/
and should be extensible to become an online performance probe.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-14 20:54:53 +01:00
Chris Wilson
6d1c0e6d28 Fix pollution from skia commit
I forgot to proof-read the patch before pushing and forgot I had left in
some damage from trying to get skia to link using libtool.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-13 10:06:08 +01:00
Chris Wilson
1ccd269a3f skia: Update to use cairo_backend_t interface
Still hopelessly broken. Requires compiling cairo to use static linking
and then still requires manual linkage to workaround libtool. Lots of
functionality is still absent - we need to either find analogues to some
Cairo operations or implement fallbacks - but it is sufficient to
investigate how Skia functions in direct comparison with Cairo for
tessellation/rasterisation.

Caveat emptor.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-13 09:58:02 +01:00
Andrea Canciani
d2ea8bd070 build: Respect CFLAGS and LIBS env settings
The build system does not honor the flags set externally and replaces
it with the pthread-only flags when detecting pthread
availability. This breaks the configuration of cairo in some
cross-compilation environments:

conftest.c:1: note: someone does not honour COPTS correctly, passed 0 times

The test for pthread should append the new flags to the old one.
2011-07-29 19:29:53 +02:00
Chris Wilson
507b8abcf6 Excise xcb-drm
The experiment was at best a pyrrhic victory. Whilst it did show that
you could successfully subvert cairo_xcb_surface_t and provide the
rendering locally faster (than the xlib driver at that time), any
performance benefits were lost in the synchronisation overheads and
server-side buffer allocation.

Once cairo-gl is mature, we need to look at how we can overcome these to
improve client-side rendering

In the meantime, cairo-xcb is no longer my playground for
experimentation and is shaping up to become a stable backend...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-14 12:46:26 +01:00
Chris Wilson
5d9da3decf Excise DRM-Xr
I've since incorporated (nearly) all the features from cairo-drm into
xf86-video-intel, making this experiment defunct.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-14 12:35:19 +01:00
Andrea Canciani
190d8d7290 build: Silence autoconf warnings
Autoconf 2.86 reports:

warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
2011-06-20 11:07:33 +02:00
Andrea Canciani
b6d593dc71 build: Clean up environment variables and flags for the win32 build
Avoid ovverriding LINK, as it has a special meaning for the MSVC build
tools.
2011-06-20 10:24:21 +02:00
Andrea Canciani
c7c3475cdb build: Improve generation of cairo-features.h on win32
All of the build depends on cairo-features.h. By having a target to
generate it that can be run from anywhere, it is possible to delegate
the dependency handling to 'make'.
2011-06-20 10:24:21 +02:00
Benjamin Otte
d11b39ea27 build: Use $GREP -e instead of plain grep -e
https://bugs.freedesktop.org/show_bug.cgi?id=37388
2011-05-20 20:59:13 +02:00
Alexandros Frantzis
f84653422a gl: Add GLESv2 backend to build system
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-05-10 08:34:17 +01:00
Behdad Esfahbod
7db5e3fdc8 Don't cache _CAIRO_ENABLE results
Caching is fragile sinle the enable commands cannot have any side-effects
when caching.  And doesn't have significant speedup at this level.  Just
remove it.
2011-03-18 13:13:18 -03:00
Chris Wilson
59fec48cd6 configure: Test for funlockfile
cairo-trace already depended upon HAVE_FUNLOCKFILE for its
thread-safety.

[This is a candidate for 1.10.]

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-03-15 13:22:52 +00:00
Alexandros Frantzis
2a632b1f54 gl: Remove GLEW from the build system and the source tree 2010-12-15 15:32:20 +00:00
Behdad Esfahbod
268cb0a2bb Add note re gtk-doc.make 2010-11-17 13:30:28 -05:00
Andrea Canciani
d51ab09142 configure: Correct reporting of tee backend
Since 9f33f8453b tee is not compiled in
anymore by default. Reporting it as always enabled is misleading.
2010-11-06 15:46:48 +01:00
Adrian Johnson
8f2f5e5ad4 configure.ac.features: s/Meta/Recording/ 2010-11-06 18:44:54 +10:30
Chris Wilson
253374d6ad configure: Remove noisy -Wlogical-op
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-10-29 15:00:03 +01:00
Benjamin Otte
df8f964234 build: Fudge the build system some more so it handles extra libs
Add NONPKGCONFIG_EXTRA_LIBS that are only put into the generated pc file
but not used when linking. This is now used to add -lcairo-gobject to
the cairo-gobject.pc file.
2010-08-10 01:24:30 +02:00
Andrea Canciani
f71a618bd2 Fix configuration if gobject is absent
Autodetect gobject and only use it if present.
Its absence is not to be considered a failure since it's not required.
2010-08-07 21:32:09 +02:00
Benjamin Otte
661f4859cd Add cairo-gobject library
This library is supposed to contain GType declarations for Cairo types.
It is also meant to support gobject-introspection binding creation.
2010-08-07 20:19:27 +02:00
Benjamin Otte
142df6f963 configure: Disable xml backend by default
We don't want to enable it by default when nobody uses it.
2010-07-30 22:27:28 +02:00
Benjamin Otte
9f33f8453b configure: Disable tee backend by default
We don't want to enable it by default when nobody uses it.
2010-07-30 22:27:27 +02:00
M Joonas Pihlaja
53fcfc781e build: Typos in comments.
Fix inline "dnl" strings left over from a string
substitution "--" -> "dnl".
2010-07-21 22:39:40 +03:00
Hib Eris
fd1e731c9d build: Fix pthread detection code when there isn't one.
The code was testing the output variable $use_pthread rather than
the input variable $enable_pthread when checking that pthreads
were actually found when requested.
2010-07-21 22:34:05 +03:00
M Joonas Pihlaja
0152db263b build: Sync up autogenerated win32 build files. 2010-07-12 10:39:18 +03:00
M Joonas Pihlaja
f0466ecf7d build: Fix typo in pthread test program.
Missing a semicolon after pthread_cleanup_push.  Incredibly
only openbsd 4.5 minded.
2010-07-11 21:57:40 +03:00
M Joonas Pihlaja
3f1d7de8e1 build: Fix regression provoked by newer autoconf and dodgy configuring.
We're not supposed to be redefining PACKAGE_VERSION, PACKAGE_...
from the configure generated confdefs.h.  This patch rudely adds
paper over the problem.  The compiler warnings are a problem for
us since our checking of various compiler flags assumes that
no news is good news, and that any warning messages are due
to the flags under test.  The regression appears when using
an autoconf >= 2.64, at least, but not with 2.61.

The same issue appears in the pthread test because our conftest
unconditionally #defines _GNU_SOURCE, but autoconf ends up doing
that in the confdefs.h.
2010-07-11 21:40:26 +03:00
M Joonas Pihlaja
fca8977219 build: Rework pthread detection.
Use two levels of pthread support: a minimal level used to
build cairo itself, and a full level to build threaded apps
which want to use cairo.  The minimal level tries to use
pthread stubs from libc if possible, but falls back to the
full level if that's not possible.  We use CFLAGS=-D_REENTRANT
LIBS=-lpthread to find a real pthread library since that seems
to work on every unix-like test box we can get our hands on.
2010-07-11 21:40:26 +03:00
M Joonas Pihlaja
47c35e5e86 build: Purge CAIRO_CC_TRY_LINK_FLAG.
Use CAIRO_CC_TRY_FLAG instead in the one place where we used
CAIRO_CC_TRY_LINK_FLAG and make the build system one macro
smaller.
2010-07-11 21:40:26 +03:00
M Joonas Pihlaja
d2f5592e0e build: Factor out a more pliable CAIRO_CC_TRY_LINK_WITH_ENV_SILENT.
Introduce a new CAIRO_CC_TRY_LINK_WITH_ENV_SILENT macro for running
generic link tests with arbitrary CFLAGS/LIBS/LDFLAGS and no muttering
of autoconf messages.  Rewrite the previous CAIRO_CC_TRY_FLAG in terms
of it.
2010-07-11 21:40:25 +03:00
Benjamin Otte
59c83117d7 build: Commit new versions of autogenerate Windows build files
The recent commits to the build system changed a bunch of stuff in
there, so update the files.
2010-07-09 18:55:11 +02:00
Benjamin Otte
f7fc8569a7 build: Fix C++ issues with automake
This is an attempt to fix the broken situation we've been in where
automake links libcairo.la with c++ because it might potentially maybe
include C++ files.

Those potential files only exist in Chris' throwaway backends (skia, qt)
and the BeOS backend, so for 99.99% of cases, these backends are not
needed and linking with c++ is overkill. Also, no one wants to have
libcairo.so link to libstdc++.

This patch fixes that in mutliple steps:
1) Add build infrastructure to distinguish between C and C++ backends.
   This is done by allowing to specify backend_sources as well as
   backend_cxx_sources variables in Makefile.sources.
2) Optionally build a libcairo_cxx.la noinst library
   This intermediate library is built for C++ backends only and therefor
   linked using c++. It is then linked into the final libcairo.la. This
   does not require c++, so the linking of libcairo.la is done with cc.

This also works around various weirdnesses that the current build system
exposes, where it assumes cisms when in fact using c++ semantics, like
not detecting c++ properly or:
https://bugzilla.redhat.com/show_bug.cgi?id=606523
2010-07-09 12:38:37 +02:00
Benjamin Otte
df6d49f6ea build: Get rid of $(foo_files) Makefile.am variables
They're unused, and less variables make the build system easier to
understand.
2010-07-09 11:10:20 +02:00
Benjamin Otte
9de25a0297 configure: remove dolt
libtool should be fast by now
2010-07-05 18:38:33 +02:00
Benjamin Otte
68bbb6b4a0 configure: remove shave 2010-07-05 00:35:39 +02:00
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
Chris Wilson
8df4136119 Regenerate default win32 headers. 2010-06-26 09:52:11 +01:00
Zoxc
ca35e09ece gl: Added wgl boilerplate and moved the glx and egl boilerplates into their own files. 2010-06-17 09:21:07 +01:00
Chris Wilson
072a200ec5 build: Add wgl to Makefile.sources and regenerate features. 2010-06-14 16:05:14 +01:00
Zoxc
505a0456d2 gl: Added WGL context and surface. 2010-06-14 12:46:26 +01:00
Benjamin Otte
e3b2212bc5 build: Fix pthread detection
Incorporate the pthread detection code from the autoconf archive. Should
fix build on obscure archs that pretend to be UNIXy - like Mac OS X
Tiger.

http://www.gnu.org/software/autoconf-archive/
http://www.gnu.org/software/autoconf-archive/ax_pthread.html
2010-05-13 15:17:27 +02:00