Commit graph

37 commits

Author SHA1 Message Date
Adrian Johnson
ed24deaa2e mesh: Add mesh pattern type and enum values
Add the mesh pattern type and an error status to be used to report an
incorrect construction of the pattern.

Update the backends to make them ready to handle the new pattern type,
even if it cannot be created yet.
2011-01-01 13:05:12 +01:00
Benjamin Otte
b870cc030d doc: Move tmpl/ docs to inline docs
I did this manually so I could review the docs at the same time.
If anyone finds typos or other mistakes I did, please complain to me (or
better: fix them).
2010-07-08 14:27:16 +02:00
Andrea Canciani
b8a7f8621a Update FSF address
I updated the Free Software Foundation address using the following script.

for i in $(git grep Temple | cut -d: -f1 )
do
  sed -e 's/59 Temple Place[, -]* Suite 330, Boston, MA *02111-1307[, ]* USA/51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA/' -i "$i"
done

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=21356
2010-04-27 11:13:38 +02:00
Chris Wilson
c0008242b0 misc: Only use custom lround() under DISABLE_SOME_FLOATING_POINT
On my Core2, the library version of lround() is faster than our
hand-rolled non-floating point implementation. So only enable our code
if we are trying to minimise the number of floating point operations --
even then, it would worth investigating the library performance first.

[Just a reminder that optimisation choices will change over time as our
hardware and software evolves.]
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
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
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
Benjamin Otte
0fd944d4bf Use new pixman extended blend operators
It also adds extended-blend tests.

Based on a previous patch by Emmanuel Pacaud <emmanuel.pacaud@free.fr>
2009-07-14 16:03:43 +02:00
Chris Wilson
73469e693c [cairo] Tweak error strings.
Rewrite a few error strings so that they more closer match the
documentation. Where they differ, I believe I have chosen the more
informative combination of the two texts.
2009-06-03 09:51:52 +01:00
Behdad Esfahbod
428fb58a4c [user-font] Add CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED
This is useful for language bindings to signal that a method is not
implemented.
2009-05-06 20:31:04 -04:00
Chris Wilson
1ae2ddc1dd [memfault] Manually inject faults when using stack allocations
Ensure that no assumptions are made that a small allocation will succeed
by manually injecting faults when we may be simply allocating from an
embedded memory pool.

The main advantage in manual fault injection is improved code coverage -
from within the test suite most allocations are handled by the embedded
memory pools.
2009-04-23 09:22:51 +01:00
Chris Wilson
f31c6548f8 Silence compiler warnings for CAIRO_STATUS_LAST_STATUS
Add ASSERT_NOT_REACHED (or similar) cases to the error handling switches
to silence the compiler.
2009-03-29 08:31:15 +01:00
Stefan Klug
895fce1632 [wince] Use the official _WIN32_WCE define instead of WINCE 2009-03-20 17:20:22 -04:00
Jeff Muizelaar
b43e7aee98 [wince] We don't need cairo_win32_tmpfile on Windows CE
_cairo_win32_tmpfile() uses _open_osfhandle() which is not available
on Windows CE. However, Windows CE doesn't have the permisions problems
that necessitated _cairo_win32_tmpfile() in the first place so we can just
use tmpfile() on Windows CE.
2009-02-13 12:15:23 -05:00
Chris Wilson
d295942b9d Inline _cairo_restrict_value()
This is one instance where the function call overhead dominated the
function call in both time and size.
2009-02-13 13:26:52 +00:00
Jeff Muizelaar
83ec4b16b7 Elaborate the meaning of arithmetic rounding as done by _cairo_lround() 2009-02-04 14:04:05 -05:00
Paolo Bonzini
6394ec3048 [surface] add CAIRO_STATUS_INVALID_SIZE
Adds an error code replacing CAIRO_STATUS_NO_MEMORY in one case where it
is not really appropriate.  CAIRO_STATUS_INVALID_SIZE is used by several
backends that do not support image sizes beyond 2^15 pixels on each side.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-01-29 10:10:40 +00:00
Jeff Muizelaar
1d72e53c3e Add a missing _cairo_error() to a bunch of status returns. 2008-12-17 17:42:18 -05:00
Chris Wilson
e6963a5bfe Mark allocation failures as unlikely.
Use the gcc likelihood annotation to indicate that allocation failures are
extremely unlikely.
2008-11-29 11:20:34 +00:00
Chris Wilson
d1801c23fa Mark if(status) as being unlikely.
The error paths should be hit very rarely during normal operation, so mark
them as being unlikely so gcc may emit better code.
2008-11-29 11:20:33 +00:00
Adrian Johnson
721cad9b24 Fix typo 2008-11-24 22:41:03 +10:30
Chris Wilson
2b32c8b9e5 [hash] Return lookup entry.
Use the return value to return the result from _cairo_hash_table_lookup()
(as opposed to filling an output parameter on the stack) as this (a)
results in cleaner code (no strict-alias breaking pointer casts), (b)
produces a smaller binary and (c) is measurably faster.
2008-11-07 20:50:34 +00:00
Chris Wilson
8fc3d0ffeb [mime-data] Allow embedding of arbitrary mime-types.
Use the surface user-data array allow to store an arbitrary set of
alternate image representations keyed by an interned string (which
ensures that it has a unique key in the user-visible namespace).

Update the API to mirror that of cairo_surface_set_user_data() [i.e.
return a status indicator] and switch internal users of the mime-data to
the public functions.
2008-11-03 11:24:12 +00:00
Behdad Esfahbod
1fe7088a11 [show_text_glyphs] Replace the bool backward with cairo_text_cluster_flags
Chris rightfully complained that having a boolean function argument is
new in cairo_show_text_glyphs, and indeed avoiding them has been one
of the API design criteria for cairo.  Trying to come up with alternatives,
Owen suggested using a flag type which nicely solves the problem AND
future-proofs such a complex API.

Please welcome _flags_t APIs to cairo.h
2008-09-18 00:26:07 -04:00
Behdad Esfahbod
5926257770 Revamp the build system.
Quick summary of changes:

  - Move list of cairo source files out of src/Makefile.am and into
    src/Sources.mk,

  - Generate files src/Config.mk and src/Config.mk.win32 that choose
    the right set of source files and headers based on configured
    backends and features.  This drastically simplifies building
    using other build systems.  The src/Makefile.win32 file needs
    to be updated to reflect these changes.

  - Add README files to various directories,

  - Add toplevel HACKING file.
2008-09-02 20:24:08 -04:00
Behdad Esfahbod
894940b81f Some nasty tracks to make changing version number not cause a total rebuild
Quite slick!  This comes handy when git-bisect'ing.  The canonical version
number is in toplevel cairo-version.h now.
2008-08-28 18:18:23 -04:00
Behdad Esfahbod
47b3c9aa3f Move version functions to cairo-misc.c 2008-08-28 17:29:32 -04:00
Behdad Esfahbod
eabe572981 Document all new API
Also validate clusters generated by font backends.
2008-08-08 03:04:38 -04:00
Behdad Esfahbod
8c514a40b8 Add cairo_glyph/text_cluster_allocate/free
These are needed by the upcoming cairo_scaled_font_text_to_glyphs()
2008-08-08 03:01:16 -04:00
Behdad Esfahbod
7e57892983 Add toy font constructor and getters
New public API:

	cairo_toy_font_face_create()
	cairo_toy_font_face_get_family()
	cairo_toy_font_face_get_slant()
	cairo_toy_font_face_get_weight()
2008-08-08 03:01:14 -04:00
Behdad Esfahbod
047566fd52 Add cairo_show_text_glyphs API
New public API:

	cairo_text_cluster_t
	cairo_has_show_text_glyphs()
	cairo_show_text_glyphs()

Add accompanying gstate and surface functions, and surface backend methods.
No backends implement them just yet.
2008-06-26 16:20:59 -04:00
Behdad Esfahbod
ace3a98a53 Make sure cairo_int_status_t values fit in int8_t
It was reported by Liu Yubao that cairo_status_t may be chosen to be
an int8_t by the compiler, in that case cairo_int_status_t values
assigned to cairo_status_t would overflow.  Fix this by allocating
the values in int8_t range, and add compile-time sanity checks.
2008-06-24 15:02:14 -04:00
Behdad Esfahbod
498f3ddf2e Add status CAIRO_STATUS_NEGATIVE_COUNT
To be used for things like passing a negative number of glyphs
to cairo_show_glyphs().
2008-06-23 17:53:25 -04:00
Behdad Esfahbod
17f21ea307 [cairo-user-font] Implement user fonts 2008-05-10 01:21:45 +02:00
Behdad Esfahbod
2a9bb6f78c Add CAIRO_STATUS_FONT_TYPE_MISMATCH 2008-05-09 15:54:12 +02:00
Behdad Esfahbod
c7204adcf3 [cairo-misc.c] Add misc functions to this file
Anything functions that doesn't group with other functions enough to
justify its own file should go here now.
2008-02-17 02:32:24 -05:00