Commit graph

179 commits

Author SHA1 Message Date
Bryce Harrington
0f46fc8dc1 configure.ac: Quell warnings about AM_PROG_AR when using automake 1.12
Without this, autogen.sh issues warnings like:

  /usr/share/automake-1.14/am/ltlibrary.am: warning: 'libcairoboilerplate_cxx.la': linking libtool libraries using a non-POSIX
  /usr/share/automake-1.14/am/ltlibrary.am: archiver requires 'AM_PROG_AR' in 'configure.ac'
  boilerplate/Makefile.am:18:   while processing Libtool library 'libcairoboilerplate_cxx.la'

AM_PROG_AR was introduced in automake 1.11.2.  As per the docs for
AM_PROG_AR, it is supposed to be included when the archiver ('ar') is
used, but prior to automake 1.12 the warning was only shown iff
-Wextra-portability was specified.  automake 1.12 introduced a change
that includes -Wextra-portability when -Wall is specified.

For further discussion of the issue, see:

  http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11401
  http://lists.gnu.org/archive/html/automake/2012-05/msg00014.html

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Uli Schlachter <psychon@znc.in>
2014-07-11 18:34:43 -07:00
Behdad Esfahbod
4cb220773d chmod a+x cairo-trace 2014-07-11 11:07:25 -04:00
Ravi Nanjundappa
7bd68b5799 skia: update the source to build with the latest skia
This fixes several build related issues for the skia backend
which is introduced due to skia source up-gradation.

Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2014-07-08 11:09:04 -07:00
Bryce Harrington
1b522f81e2 test: Replace deprecated rsvg_init() in any2ppm test
As of libsvg 2.35 calling g_type_init() is sufficient.

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-31 11:25:32 -08:00
Behdad Esfahbod
040a9f678b Check for XRenderSolidFill() 2013-12-16 19:27:38 -05:00
Uli Schlachter
a8a805b8d9 cairo-gobject: Require at least glib 2.14
cairo-gobject uses g_once_init_enter() and g_once_init_leave(). These functions
were added in glib 2.14 and thus cairo needs at least this version for its
gobject helper functions.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69239
Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-09-16 12:55:01 +02:00
Adrian Johnson
8e1a1ed863 Downscaling requires pixman 0.30 2013-09-06 07:54:28 +09:30
Chris Wilson
054f34111d Provide backwards compatibilty with old pixman
The goal is to allow compilation against older pixman to ease regression
testing.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-23 12:53:27 +01:00
Chris Wilson
b9f0ef4496 perf: Rescale the histogram for the terminal
If running ./cairo-perf-print in a terminal, query the terminal size and
rescale the histogram to use the maximum available space.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-11 11:47:24 +01:00
Chris Wilson
74a19c527c configure: Include X11.h before testing for usability of Xrender.h
On Solaris at least, the Xrender.h header is not standalone and requires
X11/X.h to be included first to define the essential types.

Reported-by: Andreas F. Borchert <bugzilla@andreas-borchert.de>
Bugzilla; https://bugs.freedesktop.org/show_bug.cgi?id=58199
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-29 10:31:05 +00:00
Chris Wilson
45a4b42a36 script: Recompress strings using LZO whilst binding traces
Try using the lighter-weight LZO decompressor in an effort to speed up
replays (at the cost of making the bound traces slightly larger).
Presuming that with the slight increase in file size (from -1% to +10%),
the file data remains in the readahead buffer cache, replays see a
performance improvement of between 5-10%.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-05 21:10:35 +00:00
Behdad Esfahbod
1404ed9692 [ft] Remove ancient check for FT_Bitmap_Size.y_ppem
That member is available in the version of FreeType we require.
2012-12-21 18:47:10 -05:00
Chris Wilson
0e24586978 xlib/shm: Use shmstr.h instead of shmproto.h if available
Before it was known as shmproto.h, the wire protocol definition was to
be found in shmstr.h, so if we don't have the current version of libXext
try to use the older includes.

Reported-by: Sebastian Haas <sehaas@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-28 10:13:04 +00:00
Chris Wilson
f18199fcfb xlib/shm: Check for XShm headers
Not all version of libXext ship the same set of headers, so play safe
and check during configure that we have the headers we depend upon in
the code.

Reported-by: Sebastian Haas <sehaas@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-28 10:13:04 +00:00
Gilles Espinasse
b12a94b983 configure: fix PKG_CHECK_MODULES tests displaying no no
Inside PKG_CHECK_MODULES, AC_MSG_RESULT(no) is already displayed, so the
caller should not use another AC_MSG_RESULT(no).

Add a comment that empty ACTION-IF-NOT-FOUND is not allowed for
PKG_CHECK_MODULES, but a simple : is enough.

This is bugs.freedesktop.org #51628, rediffed after 1.12.4

Signed-off-by: Gilles Espinasse <g.esp@free.fr>
2012-10-21 09:36:28 +01:00
Gilles Espinasse
813143c220 ft: Fix compilation on 1.12 without FT_Get_X11_Font_Format
Signed-off-by: Gilles Espinasse <g.esp@free.fr>
2012-10-21 09:34:08 +01:00
Chris Wilson
5041b462d0 xlib/shm: Sync the XShmAttach before removing the ShmSegment id
Whilst reading through other users of XShm, it became apparent that
IPC_RMID behaves differently across the platforms. Linux allows
processes to attach to an existing ShmSegment id after a IPC_RMID, but
for others the IPC_RMID takes immediate effect. On those platforms
without a "deferred" IPC_RMID, we then need to perform the XShmAttach
synchronously before perfomring the IPC_RMID.

Reported-by: Thomas Klausner <wiz@NetBSD.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-19 12:04:50 +01:00
Chris Wilson
7266d59ebc configure: Restore previous pixman required version of 0.22.0
With optional compile time support for pixman glyphs, our hard pixman
requirement is then just 0.22.0 for the radial fixes (iirc).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-17 15:31:07 +01:00
Chris Wilson
0bfd2acd35 xlib: Implement SHM fallbacks and fast upload paths
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-17 13:58:09 +01:00
Chris Wilson
95b7f4fe3a image: Temporarily resurrect the old non-pixman glyph compositor
As the easiest approach to making another snapshot that only depends
upon a stable pixman, make the new dependency a compile time option.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-12 19:10:04 +01:00
Søren Sandmann Pedersen
615205cf07 Use the new pixman_glyph_cache_t API that will be in pixman 0.28.0
This new pixman API allows glyphs to be cached and composited in one
go, which reduces overhead compared to individual calls to
pixman_image_composite_region32().

Notes:

- There is an explicit call to _cairo_image_scaled_glyph_fini(). This
  could instead be done with a private, but I chose not to do that
  since we don't need to store any actual data; we only need
  notification when the glyph dies.

- The slowdown in poppler-reseau is real and stable across runs. I'm
  not too concerned about it because this benchmark is only one run
  and so it is dominated by glyph cache setup costs and FreeType
  rasterizing.

Performance results, image backend:

    Speedups
       firefox-talos-gfx  5571.55 -> 4265.57:  1.31x speedup
      gnome-terminal-vim  1875.82 -> 1715.14:  1.09x speedup
               evolution  1128.24 -> 1047.68:  1.08x speedup
       xfce4-terminal-a1  1364.38 -> 1277.48:  1.07x speedup

    Slowdowns
          poppler-reseau   374.42 ->  394.29:  1.05x slowdown

Performance results, image16 backend:

    Speedups
       firefox-talos-gfx  5387.25 -> 4065.39:  1.33x speedup
      gnome-terminal-vim  2116.66 -> 1962.79:  1.08x speedup
               evolution   987.50 ->  924.27:  1.07x speedup
       xfce4-terminal-a1  1856.85 -> 1748.25:  1.06x speedup
                    gvim  1484.07 -> 1398.75:  1.06x speedup

    Slowdowns
          poppler-reseau   371.37 ->  393.99:  1.06x slowdown

Also bump pixman requirement to 0.27.1.
2012-06-09 15:52:59 -04:00
Yuanhan Liu
25317dbd88 configure.ac: remove annoying change of INSTALL file
Every time we run ./autogen.sh, the INSTALL file would be replace by
/usr/share/automake-1.11/INSTALL, which changes the file. This is very
annoying since it messes up the result of 'git diff' and git always
wants to commit it.

Declare it as foreign would fix this annoying issue. Since it's not a
GNU project, it makes sense to do so.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2012-05-30 14:02:21 +01:00
Javier Jardón
40d6c580cd configure.ac: Do not generate template files when building docs
It's not needed as all the api documentation is inline
2012-04-14 15:06:24 +01:00
Javier Jardón
aa90a8f84f configure.ac: generate xz tarballs by default 2012-04-14 15:04:06 +01:00
Javier Jardón
3616a5f992 configure.ac: Update autotools configuration
Do not use autoconf deprecated macros
Use new libtool syntax
honor aclocal flags
2012-04-14 15:02:10 +01:00
Maarten Bosmans
9fcbe25c2d Protect code using dlfcn.h with CAIRO_HAS_DLSYM 2012-04-10 12:07:49 +01:00
Chris Wilson
2587b9dfd3 ft: Export FreeType synthesis options
Currently you can only specify that a cairo_ft_font_face_t should
synthesize a font (to make a bold variant) through an FcPattern. That is
direct consumers of the public cairo-ft API have no control over the
synthesize options.

Rectify this by creating some public API to allow control over the
synthesis flags, and include the ability to construct an oblique as
well an embolden font.

Based on a patch by Deokjin Kim <deokjin81.kim@samsung.com>.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-02-29 12:04:54 +00: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
Uli Schlachter
7ba28ff563 cairo-xcb: Require libxcb 1.6
Since commit 968eb30bba, we use xcb_discard_reply(). This function was
added in libxcb 1.6.

"Fixes": https://bugs.freedesktop.org/show_bug.cgi?id=40925

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-16 17:45:27 +02:00
Adrian Johnson
dc2ed6dca2 Refresh some pdf/ps ref images 2011-09-13 22:29:56 +09:30
Chris Wilson
af9fbd176b Introduce a new compositor architecture
Having spent the last dev cycle looking at how we could specialize the
compositors for various backends, we once again look for the
commonalities in order to reduce the duplication. In part this is
motivated by the idea that spans is a good interface for both the
existent GL backend and pixman, and so they deserve a dedicated
compositor. xcb/xlib target an identical rendering system and so they
should be using the same compositor, and it should be possible to run
that same compositor locally against pixman to generate reference tests.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

P.S. This brings massive upheaval (read breakage) I've tried delaying in
order to fix as many things as possible but now this one patch does far,
far, far too much. Apologies in advance for breaking your favourite
backend, but trust me in that the end result will be much better. :)
2011-09-12 08:29:48 +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
2f020c4ade obsever: include the operation timings
Seeing the relative amounts of time spent in each operation and the
slowest one of each, gives further insight into the peculiarities of a
trace. And hopefully point out areas of improvement.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-18 14:10:20 +01: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
aa646e47f3 Use new pixman formats
b132fae5e8 introduced the usage of two
new pixman formats. This requires pixman 0.22, but makes it possible
to fix some TODO's left behind in gl and vg.
2011-07-21 20:15:50 +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
463a8b67a3 perf: Fix build on win32
The performance tools build system for Win32 hasn't been maintained
for some time.  The makefiles are now structured as in other
directories (Makefile.sources used by both Makefile.am and
Makefile.win32) and some additional code hides os-specific parts.
2011-06-24 14:13:09 +02:00
Andrea Canciani
45665c0d48 Remove if's from Makefile.sources
make on win32 complains that:

make[1]: Entering directory `/home/ranma42/Code/fdo/cairo/src'
../src/Makefile.sources:220: *** missing separator.  Stop.

Makefile.sources should not contain if's, which are aoutomake-only
conditionals.  The correct way to conditionally include files is to
enable/disable them using C preprocessor macros.
2011-06-14 15:25:08 +02:00
Alexandros Frantzis
c2b4bc6dea gl: Fall back to dlsym() if *GetProcAddress() fails
In strictly conforming EGL implementations, eglGetProcAddress() can be used
only to get extension functions, but some of the functions we want belong to
core GL(ES). If the *GetProcAddress function provided by the context fails,
try to get the address of the wanted GL function using standard system
facilities (eg dlsym() in *nix systems).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-05-10 08:36:03 +01: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
Andrea Canciani
d866bb0405 xlib: Fix compilation when gradient functions are not available
It is not correct to rely on the version defined in render.h. The
Xrender.h header is independent and might not define some functions
available in RENDER 0.10.

Their availability must be detected at configure time and the stubs
must be defined only if the functions are not available.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=31906
2011-02-14 11:07:02 +01:00
Uli Schlachter
9e7ce0c352 xcb: Automatically enable the backend if the libs are available
It looks like the cairo-xcb backend is in a good shape and hopefully will be a
supported backend for cairo 1.12.0. Let's see if this causes lots of new bugs to
be uncovered. :-)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-26 17:54:13 +01:00
Pino Toscano
0e199ccc57 LD_PRELOAD is supported on Hurd
LD_PRELOAD is supported on Hurd. Adding Hurd to the list of supported
systems makes cairo-trace available on them as well.

See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=608492
2011-01-25 14:36:01 +01:00
Andrea Canciani
72a9d49a53 Bump pixman requirements to 0.20.2 for radial gradients
Pixman has PDF-like radial gradients since 0.20.0, but the
implementation of the tangent circles case was not correct. This has
been fixed in 0.20.2, along with some invalid operations fixes.
2011-01-19 15:04:49 +01:00