Commit graph

2061 commits

Author SHA1 Message Date
Behdad Esfahbod
8ebb054ff9 [cairo-mutex] Prefer "#if CAIRO_SOMETHING" over "#if defined CAIRO_SOMETHING" 2007-04-19 16:30:21 -04:00
Behdad Esfahbod
97c1974780 [cairo-mutex] Add default implementation for CAIRO_MUTEX_INIT
that uses CAIRO_MUTEX_NIL_INITIALIZER.  This used to be the
implementation for pthread because pthread_mutex_init() is
broken.  See d48bb4fbe8.
2007-04-19 16:26:21 -04:00
Behdad Esfahbod
6d2a2dd6d9 [cairo-mutex] Add default no-op implementation for CAIRO_MUTEX_FINI 2007-04-19 16:24:16 -04:00
Behdad Esfahbod
2067d6fa90 [cairo-mutex] Use CAIRO_MUTEX_NOOP when applicable 2007-04-19 16:23:14 -04:00
Behdad Esfahbod
5dda76c90f [cairo-mutex] Err if at least one of mutex macros are not defined 2007-04-19 16:22:02 -04:00
Behdad Esfahbod
f771b9157c [cairo-mutex] Define and use CAIRO_MUTEX_USE_GENERIC_INITIALIZATION
We use the generic initialization if CAIRO_MUTEX_INITIALIZE is not
defined.
2007-04-19 16:21:13 -04:00
Behdad Esfahbod
4fc52e2d49 [cairo-mutex] Define CAIRO_MUTEX_NOOP 2007-04-19 16:19:48 -04:00
Behdad Esfahbod
f9dd8fd0ef [cairo-mutex] Inlucde cairo-features.h and config.h
Previously we were lucky enough to have them included before us
2007-04-19 16:19:25 -04:00
Behdad Esfahbod
4e754cf3df [cairo-truetype-subset] Shut gcc warning up 2007-04-19 16:07:15 -04:00
Behdad Esfahbod
4141e752e2 [cairo-freelist] Remove redundant struct declarations 2007-04-19 16:07:15 -04:00
Behdad Esfahbod
ea817c560c [cairo-mutex] Remove unneeded #undef CAIRO_MUTEX_EXTERNAL 2007-04-19 16:07:15 -04:00
Behdad Esfahbod
0b281085b5 [cairo-mutex] Err on unintended inclusion of cairo-mutex-list-private.h 2007-04-19 16:07:15 -04:00
Behdad Esfahbod
47be7280bf [cairo-mutex] Remove multiple-inclusion guards from cairo-mutex-list-private.h
This is a list header file.  We should not prevent it from multiple
inclusions.
2007-04-19 16:07:15 -04:00
Chris Wilson
55ea0466e2 Embed simple clip XRectangles in cairo_xlib_surface_t
Toolkits like GTK+ almost always set a simple rectangular clip mask before
any cairo operation, so avoid the allocation for this simple case by
embedding a small number of XRectangles into the surface structure.
2007-04-19 20:37:06 +01:00
Mathias Hasselmann
7906a99340 Define INT32 limits on MSVC as noticed by Hans-Jürgen Schäler 2007-04-19 14:54:30 +02:00
Mathias Hasselmann
cc8841645c Properly use CAIRO_MUTEX_{INIT,FINI} and remove CAIRO_MUTEX_LIST_PRIVATE_H sentinal before explicitly including the mutex list. 2007-04-19 13:47:45 +02:00
Mathias Hasselmann
39a633a8f3 Reintroduce DllMain as deterministic mutex initialization path 2007-04-19 13:38:26 +02:00
Mathias Hasselmann
9b348929b5 Introduce CAIRO_MUTEX_FINALIZE as counter-part for CAIRO_MUTEX_INITIALIZE 2007-04-19 13:38:26 +02:00
Mathias Hasselmann
67767afa09 Update _cairo_mutex_initialized during initialization. 2007-04-19 13:38:25 +02:00
Chris Wilson
41c6eebcd1 Optionally provide a pattern to use for creating a similar solid surface.
_cairo_surface_create_similar_solid() creates a fresh pattern to wrap
color, however sometimes the caller already has that pattern available.
In those circumstances we can pass the pattern as well as the color and
avoid the extra allocation.
2007-04-19 11:56:15 +01:00
Chris Wilson
ef60e7c651 cairo-xlib-surface - track picture properties.
By tracking picture properties we can dramatically reduce the amount of
X11 traffic by avoiding redundant changes.
2007-04-19 10:54:02 +01:00
Chris Wilson
9cf0955633 Create opaque similar solid surfaces when possible.
For opaque surfaces the backends may use simpler code paths - for
example, the xlib backend may be able to use the Core protocol rather
than Render. So we only generate a surface with an alpha component if
the color is not opaque.
2007-04-19 09:30:28 +01:00
Chris Wilson
f7b6fc4746 Define a CAIRO_ALPHA_IS_OPAQUE variant that operates on uint16.
Introducing this variant also fixed a bug in _gradient_is_opaque()
which was using the fractional test on a uint16.
2007-04-19 09:30:15 +01:00
Behdad Esfahbod
beadcdf9bd Rename cairo-font.c to cairo-font-face.c 2007-04-18 18:24:09 -04:00
Behdad Esfahbod
f56582ef06 Put back __inline definition for MSC compilers, in both cairo and pixman
Apparently it's too much to expect people compiling on windows to fill
in sensible values for config.h... /sigh
2007-04-18 17:55:05 -04:00
Behdad Esfahbod
48121e97ac [cairoint.h] Define WARN_UNUSED_RESULT if undefined 2007-04-18 17:06:48 -04:00
Dave Yeo
7131f4e6ae [OS2] Fix #include "cairo-mutex-list-private.h" 2007-04-17 15:30:20 -04:00
Chris Wilson
3a3fb0031d Update .gitignore
Add .*.sw? (vim swapfiles).
Add *~ (backup files).
Add *.gcno and *.gcda (gcov intermediates).
2007-04-16 15:08:54 +01:00
Kouhei Sutou
7ff95c7230 Support MinGW DLL compilation 2007-04-16 02:48:14 -04:00
Behdad Esfahbod
84c10a79ff [cairo-pattern] Slightly hackish fix for bug #10508
The so-attributed-to-X-server bug was that cairo maps the drawing
region to the pattern space, rounds the box, and uploads only that
part of the source surface to the X server.  Well, this only works for
NEAREST filter as any more sophisticated filter needs to sneak a peek
at the neighboring pixels around the edges too.

The right fix involves taking into account the filter used, and the
pattern matrix, but for most cases, a single pixel should be enough.
Not sure about scaling down...

Anyway, this is just a workaround to get 1.4.4 out of the door.  I'll
commit a proper fix soon.
2007-04-13 16:33:33 -04:00
Behdad Esfahbod
4e3be54861 [cairo-pattern] Add a TODO item to code 2007-04-12 21:38:25 -04:00
Behdad Esfahbod
04164c996c [cairo-surface] Make sure cairo_surface_get_font_options() fully initializes
the font_options passed in.
2007-04-12 20:14:23 -04:00
Behdad Esfahbod
7224e1a6e6 [image] Set hint-metrics on in default font options 2007-04-12 18:49:38 -04:00
Behdad Esfahbod
57434e249a [xlib] Turn metrics-hinting on by default 2007-04-12 18:49:38 -04:00
Chris Wilson
8a4c108a4b Add a reference count to cairo_xlib_screen_info_t
Due to the interaction between multiple threads showing glyphs and
asynchronous CloseDisplays, it is possible for a font to maintain a
cairo_xlib_screen_info_t beyond the CloseDisplay. The simple solution
is to add a reference count in order to track the lifetime of the
cairo_xlib_screen_info_t correctly.
2007-04-12 23:31:37 +01:00
Carl Worth
50ef5bcf7b Revert cairo_public_warn addition to cairo.h
This new feature isn't appropriate for a minor cairo release,
(we're between 1.4.2 and 1.4.4 right now), but will make a
lot of sense during 1.5.

The code being reverted here was originally added with the
following commit:

	46eab95698

but this change reverts only the public-facing parts of it.
2007-04-12 13:46:03 -07:00
Chris Wilson
35bb2152c0 Hold the scaled_font->mutex whilst operating on the shared members.
Obey the locking rules whilst resetting the scaled_font after a
CloseDisplay.
2007-04-12 21:44:08 +01:00
Chris Wilson
97d897a747 cairo_xlib_close_display - drop the mutex whilst calling the hooks
In order to avoid recursive dead-locks where whilst one thread holds the
scaled font lock and is waiting on the XLockDisplay() another thread catches
the CloseDisplay and then tries to acquire the scaled font lock, we drop
the list mutex whilst processing the callbacks.
2007-04-12 21:43:47 +01:00
Carl Worth
ae80d375f8 Rename cairo-mutex-list.h to cairo-mutex-list-private.h
Also add it (and cairo-mutex-private.h) to Makefile.am
where they should have been.
2007-04-12 13:22:36 -07:00
Chris Wilson
c5b2f9d5c2 cairo_xlib_screen_info_t - always perform an exact match
This ensures that only one cairo_xlib_screen_info_t holds the
close_display_hooks, an assumption used later.
2007-04-12 12:34:53 -07:00
Chris Wilson
8c9f0f607b cairo-xlib-screen - avoid dereferencing a NULL screen.
Do not initialize font options when setting up the
cairo_xlib_screen_info_t corresponding to the display itself and not
associated with any screen. This avoids a potential NULL dereferences.

(Fixes https://bugs.freedesktop.org/show_bug.cgi?id=10517)
2007-04-12 12:34:53 -07:00
Michael Emmel
e240048a14 Merge branch 'master' of ssh+git://git.cairographics.org/git/cairo 2007-04-11 21:43:15 -07:00
Michael Emmel
29a1fe12cf Fixed compile error from missing directfb.h include 2007-04-11 21:42:57 -07:00
Carl Worth
c8645c85de Merge branch 'master' of git.cairographics.org:/git/cairo into cairo 2007-04-11 16:38:46 -07:00
Chris Wilson
52435e99f3 Move pixman_format_t from heap to stack allocations.
pixman_format_t is a simple structure used in short-term allocations and
suitable for on-stack allocation.

Killing the pixman_format_create()/pixman_format_destroy() pairs avoid
around 6% of the allocations during cairo-perf (e.g. 426,158 allocs out
of a total of 7,063,469).
2007-04-12 00:28:03 +01:00
Carl Worth
be98123b2c Merge cached-scaled-font-in-error into cairo
Conflicts:

	src/cairo-scaled-font.c
2007-04-11 16:02:08 -07:00
Chris Wilson
a6506c67f2 Don't return scaled fonts in the error state from the cache.
It is possible for a scaled_font to be flagged as in error, though only
through a "true error" e.g. a malloc failure. However, when returning a font
from the cache it should not be in error. So if we find a error font in the
cache we remove it and return a new font.
2007-04-11 15:57:03 -07:00
Carl Worth
efedf57f43 cairo-truetype-subset.c: Add missing error checks and propagation
These are all to satisfy new warnings caused by the preceding commit,
(which added cairo_warn to various function tables). While fixing the
propoagation, fix functions to declare a return type of cairo_status_t
instead of int.
2007-04-11 15:25:18 -07:00
Chris Wilson
e6ca34e718 Mark function tables with attribute(warn_unused_result) 2007-04-11 14:44:54 -07:00
Chris Wilson
54134dd901 Only enable warn-unused-result for recent gcc
The attribute was introduced with gcc-3.4, but the ability to suppress
warnings from misapplied attributes (-Wno-attributes) was only introduced
later. Without the supression, gcc will emit tens of warnings for each
compilation completely drowning the real errors that the programmer
must see.
2007-04-11 14:39:50 -07:00