Commit graph

1862 commits

Author SHA1 Message Date
Gilles Dauphin
d02aa5b23e Don't use unsupported visibily attribute hidden on Solaris
Thanks to Thomas Klausner for passing the report along.
This fixes the following bug report:

	hidden attribute does not work with Solaris ld
	https://bugs.freedesktop.org/show_bug.cgi?id=10227

And as Behdad points out, an even better fix would be to
move checks for supported visibility attribute to configure.
2007-03-16 10:35:23 -07:00
Thomas Klausner
8236282c5d Use "find !" rather than "find -not" for better portability
The man page for GNU find says:
       -not expr
              Same as ! expr, but not POSIX compliant.

And actually, on e.g. NetBSD, "-not" is not supported.

This resolved the following bug:

	https://bugs.freedesktop.org/show_bug.cgi?id=10226
2007-03-16 10:06:51 -07:00
Carl Worth
2242550b48 Make compilation of cairo-deflate-stream.c conditional on compilation of PDF backend.
Otherwise we risk pulling in an otherwise-unneeded dependency on zlib.

This fixes the bug reported here:

	Without PDF surface backend we don't need cairo-deflate-stream
	https://bugs.freedesktop.org/show_bug.cgi?id=10202
2007-03-15 23:17:19 -07:00
Carl Worth
1234064fa4 Allow NULL pointers for functions that accept pointers for multiple return values.
When a single function accepts pointers for multiple return values,
the convention is that it's legal for the user to pass NULL for
those pointers in case the user is only interested in some subset
of the values.

This was already properly implemented for functions such as
cairo_pattern_get_rgba, etc.

Here we fix four functions to follow the same convention:

	cairo_stroke_extents
	cairo_fill_extents
	cairo_clip_extents
	cairo_surface_get_device_offset
2007-03-15 22:38:42 -07:00
Carl Worth
133183d858 Fix cairo_stroke_extents and cairo_in_stroke to not crash with line width of 0.0
This fixes the line-width-zero test case and the bug reported here:

	Crash in cairo_stroke_extents whe line width is 0 and line cap is ROUND
	(_cairo_pen_find_active_cw_vertex_index)
	https://bugs.freedesktop.org/show_bug.cgi?id=10231
2007-03-15 22:09:32 -07:00
Carl Worth
6ff2439b33 Implement _cairo_traps_tessellate_triangle with _cairo_traps_tessellate_convex_quad
The newly rewritten convex_quad code is actually simpler than the
triangle code being replaced here. This also allows us to throw
away the problematic _compute_x function which can't handle
horizontal lines, (divide by zero). So the cairo world becomes a
better place.
2007-03-14 17:20:33 -07:00
Carl Worth
53ae6ea957 Fix _cairo_traps_tessellate_convex_quad to handle a == b
This case was found in an attempt to use the convex_quad function
for tessellating triangles as well. Fortunately the fix is very
easy.
2007-03-14 17:20:27 -07:00
Chris Wilson
96d8f58daf Clear the XRender data on display closure.
Use the new hook functions to register a callback for xlib to clear
the private glyph data when the display is closed. In order to do this
we need to reset the glyph cache inside the generic scaled font as well.
2007-03-14 17:20:13 -07:00
Chris Wilson
52405533b1 Privately export a function to reset the scaled font's glyph caches. 2007-03-14 17:20:05 -07:00
Chris Wilson
ad7698feb5 Introduce hooks for _cairo_xlib_close_display()
This patch adds a simple hook data type for a notifier style callback
and introduces two functions to manipulate a list of callbacks for
cleaning up on display closure.
2007-03-14 17:19:55 -07:00
Carl Worth
75201c12be check-def.sh: Adjust test to exempt _cairo_test_* functions as well as _cairo_*_test_*
This test started failing with the recent renaming of the following
three functions, (before they had no cairo in their names so they
were not getting picked up at all):

_cairo_test_fallback_surface_create
_cairo_test_meta_surface_create
_cairo_test_paginated_surface_create_for_data

With this change, the failure now goes away again.
2007-03-14 15:48:15 -07:00
Carl Worth
5d23d0c90c Remove dead-code remnants of old tessellator 2007-03-14 15:23:01 -07:00
Carl Worth
1f3a5b4e12 Fix bugs in _cairo_traps_tessellate_convex_quad
The previous code was not handling all cases correctly, (yes,
even something as simple as a quadrilateral can exhibit a
remarkably large number of different cases when tessellation
is attempted).

This fix now introduces slope comparison which handles several
cases that were mis-handled with the previous implementation which
only used independent sorting of the X and Y values of the
coordinates.

This fixes the skew-extreme test case and the bug reported here:

	Skew transforms were broken by the cairo update in December
	https://bugzilla.mozilla.org/show_bug.cgi?id=373632
2007-03-14 15:06:36 -07:00
Behdad Esfahbod
e803e2e69b [cairo-pattern] Add a cache of two color stops to cairo_gradient_pattern_t
Most of gradients have only two color stops.  This avoids
calling malloc() for those cases.
2007-03-14 17:24:54 -04:00
Behdad Esfahbod
4514fdca1b [cairo-pattern] Grow color-stops array exponentially 2007-03-14 17:24:54 -04:00
Behdad Esfahbod
a7595c1295 [Makefile.am] Do not distribute cairo-features.h, Ouch!
We were accidentally doing that by not marking it noinst.
Moreover, no need to mark it as BUILD_SOURCES, since it's
created by configure, not make.
2007-03-13 17:21:19 -04:00
Behdad Esfahbod
9267cb0424 [cairo-pattern] Use _cairo_color_double_to_short() to fix color conversion 2007-03-13 16:49:42 -04:00
Behdad Esfahbod
60502ba348 [cairo-color] Add cairo-private _cairo_color_double_to_short() 2007-03-13 16:13:35 -04:00
Behdad Esfahbod
956fdfbb62 [cairo-pattern] Fix color conversion from short to double
We should divide by 65535.0, not 65536.0.
2007-03-13 06:30:11 -04:00
Behdad Esfahbod
2030490862 [cairo-pattern] Add XXX note 2007-03-13 06:20:21 -04:00
Behdad Esfahbod
deed0f4734 [polygon,spline,traps] Avoid free(NULL) 2007-03-13 06:09:09 -04:00
Behdad Esfahbod
b706bd9b38 [cairo-polygon] Add a cache of eight edges to cairo_polygon_t
Many, if not most, of polygons have very few edges.  This avoids
calling malloc() for those cases.
2007-03-13 06:07:03 -04:00
Behdad Esfahbod
d8165d5424 [cairo-spline] Fix typo in comment 2007-03-13 05:59:33 -04:00
Behdad Esfahbod
cca7e3fec3 [cairo_polygon_t] Change has_current_point from int to cairo_bool_t 2007-03-13 05:56:38 -04:00
Behdad Esfahbod
81e15a454b [cairo_polygon_t] Remove unused member 'closed' 2007-03-13 05:55:45 -04:00
Behdad Esfahbod
2bf4ce389d [cairo_polygon_t] Reorder struct members for clarity 2007-03-13 05:53:13 -04:00
Behdad Esfahbod
3ce84390de [cairo-polygon] Clean-up realloc algorithm for clarity 2007-03-13 05:51:39 -04:00
Behdad Esfahbod
6976ab1392 [cairo-slope] Make comparison stable if both vectors are zero 2007-03-13 05:14:20 -04:00
Behdad Esfahbod
9eee167210 [cairo-spline] Add a cache of eight points to cairo_spline_t
Most of the splines need not more than eight points.  This avoids
calling malloc() for those cases, and eight-points take only 64 bytes.
2007-03-13 05:14:20 -04:00
Behdad Esfahbod
1e64ecf075 [cairo-spline] Clean-up realloc algorithm for clarity 2007-03-13 05:14:20 -04:00
Behdad Esfahbod
cee687a33f [cairo_traps_t] Reorder struct members for clarity 2007-03-13 05:14:20 -04:00
Behdad Esfahbod
24aec99ffb [cairo-traps] Add a cache of one trapezoid to cairo_traps_t
Seems like half the time, we just need one trap.  This avoids
calling malloc() for those cases.
2007-03-13 05:14:19 -04:00
Behdad Esfahbod
4737416c6e [cairo-traps] Clean-up realloc algorithm for clarity 2007-03-13 05:14:19 -04:00
Behdad Esfahbod
a9d8cb3e8a [cairo-traps] Use INT32_MIN/MAX instead of INT16_MIN/MAX << 16 2007-03-13 05:14:19 -04:00
Behdad Esfahbod
e765ac745e [skiplist] Prefix symbols with _cairo 2007-03-13 05:14:19 -04:00
Behdad Esfahbod
cd78da36f6 [test-surfaces] Prefix public symbols with _cairo 2007-03-13 05:14:19 -04:00
Behdad Esfahbod
8997b3a023 [skiplist] Move static variable out of function
Part of my secrect plan to make cairo compilable with:

	#define static

Useful for some weird debugging purposes.
2007-03-13 05:14:19 -04:00
Behdad Esfahbod
d40126f5ab [cairo_t] Embed a gstate into cairo_t
So we don't have to malloc the first gstate.
2007-03-13 05:14:19 -04:00
Behdad Esfahbod
01f9ee39fe [cairo-clip] Make _cairo_clip_init tolerate NULL target
(needed for upcoming patches.)
2007-03-13 05:14:19 -04:00
Behdad Esfahbod
bc8987068d [cairo_t] Make path an array of size one
This is more natural since cr->path can be used as if it was a pointer.
This means, for example, if we move on to making it a pointer, most of
the code using it does not need any change.  So we get some level of
encapsulation of implementation details, if you prefer the terminology :).
2007-03-13 05:14:19 -04:00
Behdad Esfahbod
74e6a24e98 [Quartz] Don't include cairo-private.h 2007-03-13 05:14:19 -04:00
Behdad Esfahbod
6bc543a0eb [cairo_t] Move gstate pointer before cairo_path_fixed_t for better cache behavior 2007-03-13 05:14:18 -04:00
Behdad Esfahbod
85aff353ca [cairo-path-fixed] Fine-tune size of buffer
such that cairo_path_fixed_t fits in 512 bytes.
2007-03-13 05:14:18 -04:00
Behdad Esfahbod
1bd073a1a2 [cairo-path-fixed] Merge op and arg bufs
This means, we have to malloc only one buffer, not two.  Worst case
is that one always draws curves, which fills the arg (point) buffer
six times faster than op buffer.  But that's not a big deal since
each op takes 1 byte, while each point takes 8 bytes.  So op space
is cheap to spare, so to speak (about 10% memory waste at worst).
2007-03-13 05:14:18 -04:00
Behdad Esfahbod
5750d669af [cairo-path-fixed] Avoid malloc for small paths
We do this by including an initial op and arg buf in cairo_path_fixed_t,
so for small paths we don't have to alloc those buffers.

The way this is done is a bit unusual.  Specifically, using an array of
length one instead of a normal member:

-    cairo_path_op_buf_t *op_buf_head;
+    cairo_path_op_buf_t  op_buf_head[1];

Has the advantage that read-only use of the buffers does not need any
change as arrays act like pointers syntactically.  All manipulation code
however needs to be updates, which the patch supposed does.  Still, there
seems to be bugs remaining as cairo-perf quits with a Bad X Request error
with this patch.
2007-03-13 05:14:18 -04:00
Behdad Esfahbod
2894ed19a3 [directfb,os2] #error if the backend is not compiled in, like others do 2007-03-13 05:14:18 -04:00
Adrian Johnson
073d06d466 Fix incorrect file permission in previous commit 2007-03-13 18:45:38 +10:30
Adrian Johnson
a944f42b3d Fix buffer overflow warning 2007-03-13 18:35:59 +10:30
Chris Wilson
789aada06b Avoid the struct copy when source and destination are the same.
On some architectures, gcc will emit a memcpy for structure copies which will
produce a valgrind warning when the source and destination pointers are the
same. Workaround this issue by explicitly checking the source and destination
for inequality before doing the structure assignment.
2007-03-12 14:48:05 -07:00
Carl Worth
ef284a2d6b Fix a LOCK vs. UNLOCK typo, (yes, I'm that stupid).
Thanks to M.Drochner@fz-juelich.de for noticing the bug.

This fixes bug #10235:

	locking bug in cairo_ft_scaled_font_unlock_face()
	http://bugs.freedesktop.org/show_bug.cgi?id=10235
2007-03-09 13:36:03 -08:00