Commit graph

85 commits

Author SHA1 Message Date
Adrian Johnson
30636206b0 pdf,ps: Add native mesh pattern support
PS and PDF have native support for mesh patterns, but they have encode
mesh points and colors in an appropriate binary stream.

cairo_pdf_shading_* functions implement the encoding, which is the
same for PDF and PS.
2011-01-01 13:05:13 +01:00
Andrea Canciani
8df122cb4b Add mesh gradient rasterizer
Add an implementation of a fast and reasonably accurate
non-antialiased mesh gradient rasterizer.
2011-01-01 13:05:12 +01:00
Andrea Canciani
19b840a904 Keep makefiles in alphabetical order
Recording surfaces were at first called meta surfaces. When the name
was changed, makefiles were not updated to keep alphabetical order.
2011-01-01 13:05:12 +01:00
Alexandros Frantzis
2a632b1f54 gl: Remove GLEW from the build system and the source tree 2010-12-15 15:32:20 +00:00
Alexandros Frantzis
ed862d3f7b gl: Add definitions for the core variant names of used GL constants
This allows us to use the core variant of the needed GL constants regardless of the
GL header version that is being used for compilation.
2010-12-15 15:32:20 +00:00
Alexandros Frantzis
357c2f46a7 gl: Add infrastructure for calling GL functions using a dispatch table
Some GL functions can be called using different names depending on the
GL version and available extensions (ARB, EXT). The dispatch table
abstracts these differences and provides a uniform API for dealing with
these functions.
2010-12-15 15:32:20 +00:00
Alexandros Frantzis
cd7c0df2bb gl: Add functions to query GL version and extensions 2010-12-15 15:32:19 +00:00
Adrian Johnson
048a43e5c4 Move glyph names into separate file
The latin subsets feature requires these names. As
cairo-type1-subsets.c depends on FreeType, move these names out to a
separate file to allow compilation without FT.
2010-11-06 22:31:46 +10:30
Chris Wilson
f59771051b drm: Add missing header file for tarball 2010-09-10 13:38:33 +01:00
M Joonas Pihlaja
a9e055ff48 freelist: Separate freelist inlines from the datatype in headers.
The cairo-freelist-private.h header has a number of static inline
functions which call hidden functions in libcairo.  This poses
a problem on Solaris where the native compiler compiles inline
functions whether they are used or not, thereby adding the
link time requirements on hidden functions from whatever code
that includes cairo-freelist-private.h.  Unfortunately the
boilerplate code includes cairo-private headers and indirectly
the freelist header, so linking the boilerplate helper library
fails on Solaris.

This patch separates the structure definitions from the function
prototypes and static inlines in cairo-freelist-private.h by moving
the datatypes to a new cairo-freelist-type-private.h.
2010-09-02 14:51:30 +01:00
M Joonas Pihlaja
f5632d641c build: Remove stray backslash.
A stray backslash bwetween two assignment lines apparently
invokes a GNU make extension for conditional assignments.
This patch fixes the build when using the native Solaris make.
2010-09-02 13:55:55 +03:00
Benjamin Otte
9f4d677e2a tee: Move definitions into separate header 2010-07-30 22:27:08 +02:00
Benjamin Otte
bf117e4ea7 build: fix glew include
Currently wether internal glew is built is dependant on wether the
tarball in use was built with internal glew or not. And that's not how
it should be.
2010-07-09 18:43:38 +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
71d17e4b1f drm: Fix Makefile for drm_xr
Use cairo_drm_xr_sources/headers for the drm_xr stuff. This makes it
work correctly in gtk-doc instead of conditionally adding it to
cairo_drm_sources/headers.
2010-07-08 13:58:52 +02:00
Benjamin Otte
4b3e488ceb skia: Add cairo-skia.h as a public header 2010-07-08 13:58:52 +02:00
Benjamin Otte
c54dff82d3 glew: The headers are private, not public 2010-07-08 13:58:52 +02:00
Chris Wilson
97a88c5adb xlib: Compile without fontconfig
Create a cairo-fontconfig-private.h where we can add the missing defines
in a common location rather than in the body of the code.
2010-06-28 17:11:54 +01:00
Zoxc
42956b4643 build: Added cairo deflate stream as a requirement for the script surface. 2010-06-24 15:28:07 +01:00
Chris Wilson
072a200ec5 build: Add wgl to Makefile.sources and regenerate features. 2010-06-14 16:05:14 +01:00
Chris Wilson
1a544361e8 gstate: Update cached matrix state after device transform changes on the target
Commit 8d67186cb2 caches whether the device
transform is identity on context creation. However, the api is quite lax
and allows the user to modify the device transform *after* he has
started to use the surface in a context, as apparently WebKit does.
Since this is not the only instance where we may need to invalidate
caches if the user modifies state, introduce a simple mechanism for
hooking into notifications of property changes.

Fixes test/clip-device-offset.
2010-06-11 16:08:17 +01:00
Benjamin Otte
35e219d08f gl: Make gradient textures a separate object
This is necessary so we can do proper refcounting and don't delete the
gradient texture prematurely.
2010-06-07 13:37:49 +02:00
Benjamin Otte
7ad8c3b456 gl: Move composite code into own file
This allows designing a cleaner interface for cairo_composite_t as there
will not be static functions that get called outside of the "published"
interfaces.
2010-05-17 01:13:46 +02:00
Chris Wilson
bd672d080c drm: code dump, sorry.
Lots upon lots of tiny fixes mixed in with experimental code. :(
2010-05-12 20:54:49 +01:00
Benjamin Otte
90c64f60d8 gl: Move device-specific code into cairo-gl-device.c 2010-05-05 12:30:01 +02:00
Chris Wilson
b101c7dab8 gl: Add EGL interface
Enable the EGL backend for GL.
2010-03-11 01:49:18 +00:00
Chris Wilson
b7c42b6aaa drm: Add missing private headers
Reported by: Thomas Jones <thomas.jones@utoronto.ca>
2010-02-23 19:27:16 +00:00
Chris Wilson
22b5f78c1c gl: Remove eagle support
Eagle is no more, Kristian has superseded it with true EGL support. He
is so happy...
2010-02-11 10:38:51 +00:00
Benjamin Otte
58980b4ad6 build: Remove glitz surface
glitz is unmaintained and the GL surface is far superior anyway.
2010-01-27 09:56:14 +01:00
Chris Wilson
123bdb086a xcb: Make shm optional
Trying to build xcb on a system without SHM wrapped by xcb. The right
answer would be to build libxcb-shm. The quick answer is to compile out
shm support.
2010-01-25 16:45:03 +00:00
Chris Wilson
1236c41072 xcb: Refresh.
Still an experimental backend, it's now a little too late to stabilise
for 1.10, but this should represent a major step forward in its feature
set and an attempt to catch up with all the bug fixes that have been
performed on xlib. Notably not tested yet (and expected to be broken)
are mixed-endian connections and low bitdepth servers (the dithering
support has not been copied over for instance). However, it seems robust
enough for daily use...

Of particular note in this update is that the xcb surface is now capable
of subverting the xlib surface through the ./configure --enable-xlib-xcb
option. This replaces the xlib surface with a proxy that forwards all
operations to an equivalent xcb surface whilst preserving the cairo-xlib
API that is required for compatibility with the existing applications,
for instance GTK+ and Mozilla. Also you can experiment with enabling a
DRM bypass, though you need to be extremely foolhardy to do so.
2010-01-22 23:01:52 +00:00
Chris Wilson
77afe8491e drm: Add backends for i915 and i965.
As proof-of-principle add the nearly working demonstrations of using DRM
to render directly with the GPU bypassing both RENDER and GL for
performance whilst preserving high quality rendering.

The basis behind developing these chip specific backends is that this is
the idealised interface that we desire for this chips, and so a target
for cairo-gl as we continue to develop both it and our GL stack.

Note that this backends do not yet fully pass the test suite, so only
use if you are brave and willing to help develop them further.
2010-01-22 23:01:52 +00:00
Chris Wilson
b07de014eb spans: Add a rectangular scan converter
This is a highly specialised scan converter for the relatively common
case of where the input geometry is known to be a series of rectangles.
Generally not device aligned (or else we would most likely have chosen
an even higher performance path that does not require a coverage mask),
this optimised converter can simply compute the analytical coverage by
utilising a special case Bentley-Ottmann intersection finder.
2010-01-22 23:01:51 +00:00
Chris Wilson
e49855497e spans: Add a Bentley-Ottmann variant on the Tor scan converter
This variant uses the Bentley-Ottmann algorithm to only maintain the
active edge list upon edge events and so can efficiently skip areas
where no change occurs. This means that it can be much quicker than the
Tor algorithm (which is still used to compute the coverages from the
active edges) for geometries consisting of long straight lines with few
intersections. However due to the computational overhead of the
Bentley-Ottmann event processing, for dense curvy paths, simply updating
the active edge list in sync with computing the coverages is a win. Due
to advantageous adaptive step size, the scan converter can be run at a
much higher subsampling with little extra overhead compared with Tor,
currently it uses a 256x256 subsampling grid to avoid any impedance
mismatch with path precision.

Given the current status of implementations, this scan converter [botor]
is likely to be advantage where detecting large regions of unchanged
span data will result in improved performance, for instance the drm
backends which convert the scan data into rectangles.
2010-01-22 23:01:51 +00:00
Chris Wilson
43beaa5873 boxes: Efficient storage for an array of cairo_box_t.
Currently we use cairo_traps_t to also pass around arrays of boxes. This
is woefully inefficient in terms of storage, but also means that we
repeatedly have to verify that the traps are a set of boxes. By
explicitly passing around a cairo_boxes_t we avoid the semantic loss.

This will be heavily used in pending commits.
2010-01-22 23:01:51 +00:00
Chris Wilson
ae25f1c360 Alter definition of cairo_composite_rectangles_t
This is a more useful definition that is able to individually track the
rectangles that compose the composite operation. This will be used by
the specialist compositors as a means to perform the common extents
determination for an operation.
2010-01-22 23:01:51 +00:00
Chris Wilson
f617d5fc98 Add cairo_device_t
The device is a generic method for accessing the underlying interface
with the native graphics subsystem, typically the X connection or
perhaps the GL context. By exposing a cairo_device_t on a surface and
its various methods we enable finer control over interoperability with
external interactions of the device by applications. The use case in
mind is, for example, a multi-threaded gstreamer which needs to serialise
its own direct access to the device along with Cairo's across many
threads.

Secondly, the cairo_device_t is a unifying API for the mismash of
backend specific methods for controlling creation of surfaces with
explicit devices and a convenient hook for debugging and introspection.

The principal components of the API are the memory management of:

  cairo_device_reference(),
  cairo_device_finish() and
  cairo_device_destroy();

along with a pair of routines for serialising interaction:

  cairo_device_acquire() and
  cairo_device_release()

and a method to flush any outstanding accesses:

  cairo_device_flush().

The device for a particular surface may be retrieved using:

  cairo_surface_get_device().

The device returned is owned by the surface.
2010-01-22 23:01:50 +00:00
Chris Wilson
934d0d0d65 Real zero-copy cow snapshotting
The first iteration of COW snapshotting always made an initial copy when
the snapshot was requested (and reused that copy until the surface was
modified). However, in a few circumstances we can avoid even that copy
so long as the surface is still alive and unmodified between the
snapshotting and its use. In order to do so, we need a new proxy surface
that can automatically perform the copy if the target should disappear
prior to use.
2010-01-22 23:01:50 +00:00
Chris Wilson
dc8290814c Add subsurface.
A subsurface is a region of another surface that may be used either to
restrict the writable area of a context or the readable extents of a
source. Whilst writing, access to the exterior of the subsurface is
prevented via clipping and when used as a source reads from the exterior
of the subsurface are governed via the extend mechanism of the pattern.
2010-01-22 23:01:50 +00:00
Chris Wilson
b8eacbfae1 Add surface-offset internal API.
This is a simplified version of the wrapping surface where the target
surface is just a subsurface onto which we wish to draw the current
operation. In particular this is useful for the subsurface API as well
as fallbacks.
2010-01-22 23:01:50 +00:00
Chris Wilson
f2c32d0183 Unify the two freed object pools
Discard some duplicate code and shared a single freed object pointer
pool between the pattern and clip.
2010-01-22 23:01:50 +00:00
Chris Wilson
c50c8b90c0 Move _cairo_error() to a standalone header
A pending commit will want to include some utility code from cairo and
so we need to extricate the error handling from the PLT symbol hiding.
2010-01-22 22:30:43 +00:00
Eric Anholt
dbf9faf823 [gl] Use GLSL for fill_rectangles when available.
Ultimately, we want all of our paths to use shaders when they are
exposed -- it brings us closer to GL 3.0 compatibility and it should
reduce the work that GL drivers have to do per operation to compute
the required hardware state.
2010-01-14 09:28:58 -08: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
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
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
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
ab035ab2c7 [tessellate] Rectangular special case
Add an even simpler sweep-line tessellator for rectangular trapezoids (as
produced by the rectilinear stoker and box filler).

This is so simple it even outperforms pixman's region validation code for the
purposes of path-to-region conversion.
2009-08-29 08:08:38 +01:00
Chris Wilson
3fcac1ef21 [slope] Inline _cairo_slope_init()
Move the definition to a separate header file and allow callers to inline
the simple function.
2009-08-29 08:08:33 +01:00