Commit graph

2032 commits

Author SHA1 Message Date
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
Adrian Johnson
d0745c08b7 PDF: Fix glyph positioning bug when glyphs are not horizontal
Bug reported in
http://lists.freedesktop.org/archives/cairo/2007-April/010337.html
2007-04-12 06:32:29 +09:30
Carl Worth
e36794ad34 Merge branch 'warn-unused-result' into cairo 2007-04-11 13:15:57 -07:00
Chris Wilson
bec097b5e2 Propagate region errors from pixman_color_rects().
Region operations within pixman_color_rects can fail, so cleanup and
propagate.
2007-04-11 13:04:53 -07:00
Chris Wilson
e1abc3c26d Provide a private entry point for cairo_scaled_font_status().
Add slim_hidden* markup for cairo_scaled_font_status() as we now use
it internally.
2007-04-11 13:02:23 -07:00
Carl Worth
5661de9e1c SVG: Add missing error checking for calls to _cairo_output_stream_destroy 2007-04-11 02:08:36 -07:00
Carl Worth
8d5aa0fb8d SVG: Add missing error checks and propagation
The function calls that get the new treatment here are:

	_cairo_meta_surface_replay
	_cairo_surface_show_page
	_cairo_array_append

all within _cairo_svg_surface_emit_meta_surface
2007-04-11 02:03:10 -07:00
Carl Worth
9c810625e7 PDF: Added error checking and propagation for _cairo_array_append 2007-04-11 01:55:59 -07:00
Carl Worth
5ae82deb69 PS: Add missing check for return value of _cairo_meta_surface_replay
Here we have to change the return type of a couple of functions in
order to propagate the error condition.
2007-04-11 01:47:21 -07:00
Carl Worth
8c31cca2af PS: Add missing checks for return value of _cairo_pattern_get_extents
Propagation is extremely straightforward in this case.
2007-04-11 01:42:02 -07:00
Carl Worth
01ac5f1aea Assert that cairo_matrix_invert succeeds rather than ignoring tis return value
This assertion is safe as an internal consistency check thanks to
the recent checks added to cairo_pattern_set_matrix.
2007-04-11 01:35:11 -07:00
Carl Worth
a6186604f7 cairo_pattern_set_matrix: Validate that matrix is invertible
If not, set an error in the pattern.
2007-04-11 01:21:10 -07:00
Carl Worth
8e72852f0b _cairo_gstate_ensure_scaled_font: Add missing propagation for error hiding inside the scaled_font 2007-04-11 01:21:09 -07:00
Carl Worth
2f1221e0f2 _cairo_gstate_ensure_scaled_font: Prefer to treat a pointer as a pointer, not a Boolean value 2007-04-11 01:21:09 -07:00
Carl Worth
dca69f73e3 Check (and assert) return values of cairo_matrix_invert
Now that we have matrix validation at the time of _cairo_scaled_font_init
we know that it is safe to invert this matrix.
2007-04-11 01:21:09 -07:00
Carl Worth
4ce2b62bce _cairo_scaled_font_init: Detect an invalid matrix and return an error.
Also fix all callers to notice and propagate the error, (though
some paths will still lose the CAIRO_STATUS_INVALID_MATRIX value
due to a return value of NULL at one point).
2007-04-11 01:18:08 -07:00
Carl Worth
fd8c1e4dc8 Fix cairo_scaled_font_create to return a nil scaled font, not NULL 2007-04-10 23:06:57 -07:00
Carl Worth
0f0ed88ee2 paginated: Add missing error check for _cairo_surface_show_page
Fixing this uncovered a leak of a CAIRO_INT_STATUS_UNSUPPORTED value
up to cairo_show_page, (and similarly to cairo_copy_page). There was
really no good reason for _cairo_surface_show_page and
_cairo_surface_copy_page to be returning cairo_int_status_t. Fix
this by simply handling the UNSUPPORTED return at the surface layer
instead of the gstate layer.
2007-04-10 23:01:55 -07:00
Carl Worth
381f0bcafc paginated: Add missing error check for _cairo_surface_get_extents 2007-04-10 22:59:36 -07:00
Carl Worth
41911002d7 test-meta-surface.c: Fix memory leak on error recovery path. 2007-04-10 16:32:09 -07:00
Carl Worth
d954e4c148 Fix indentation of CLEANUP_IMAGE label. 2007-04-10 16:31:21 -07:00
Carl Worth
c011c37ba0 paginated: Fix missing errors checks for _cairo_meta_surface_replay 2007-04-10 16:30:43 -07:00
Carl Worth
e73a55ad3c cairo-truetype-subset: Fix missing error propagation 2007-04-10 14:26:39 -07:00
Carl Worth
97b8fd8117 cairo-truetype-subset: Check resturn value from _cairo_array_append and propagate 2007-04-10 14:26:31 -07:00
Carl Worth
84639e563d test-meta-surface: Add missing check for error from _cairo_surface_get_extents 2007-04-10 14:11:43 -07:00
Carl Worth
866b2296b4 test-meta-surface: Add missing checks for errors from _cairo_meta_surface_replay 2007-04-10 14:09:56 -07:00
Carl Worth
ec1fc93125 Add missing error check of return value of _cairo_path_fixed_close_path 2007-04-10 13:59:42 -07:00
Carl Worth
3d21037a8f Add assertion check to quiet warn_unused_result warning.
This is a somewhat useful internal consistency check.
2007-04-10 13:57:41 -07:00
Carl Worth
2f46867716 Rename _cairo_pdf_surface_emit_toUnicode_stream to eliminate StudlyCaps
Obviously, the new name is _cairo_pdf_surface_emit_to_unicode_stream which
is consistent with the to_unicode_stream identifiers already existing in
the implementation.
2007-04-10 13:53:58 -07:00
Carl Worth
cc6c115e3c PDF: Check return value of _cairo_output_stream_destroy and propagate 2007-04-10 13:51:46 -07:00