Commit graph

3360 commits

Author SHA1 Message Date
Chris Wilson
256f3e09a8 Destroy the current pattern before replacing with cairo_set_source().
Frequently cairo_set_source_rgb[a]() is used to replace the current
solid-pattern source with a new one of a different colour. The current
pattern is very likely to be unshared and unmodified and so it is likely
just to be immediately freed [or rather simply moved to recently freed
cache]. However as the last active pattern it is likely to cache-warm and
suitable to satisfy the forthcoming allocation. So by setting the current
pattern to 'none' we can move the pattern to the freed list before we
create the new pattern and hopefully immediately reuse it.
2007-03-26 20:58:14 +01:00
Chris Wilson
38442d4948 Back out the solid-pattern-cache from 9b53bc7c65.
Unfortunately one cannot cache live patterns and return a fresh reference
instead of creating new ones as patterns can be modified by the user and
so cannot be transparently shared between different users. However,
solid colour allocation is still a frequent operation, so we maintain a
small cache of recently freed patterns to reduce the malloc pressure.
2007-03-26 20:57:53 +01:00
Brian Ewins
c8e37af4b0 [quartz] fix order of fields in matrix conversion
There was a typo flipping the xy and yx fields when a 
cairo matrix was converted to a quartz matrix.
2007-03-25 23:31:40 +01:00
Brian Ewins
d2cdd5eba8 [atsui] fix scaling of glyph surfaces (#9568)
Atsui glyph surface were clipped incorrectly when the text is scaled,
visible in the text-pattern test.
2007-03-24 13:25:03 +00:00
Adrian Johnson
25ddc08004 PS: Remove unused variable 2007-03-23 23:19:30 +10:30
Adrian Johnson
e9a2696648 PDF: Use the TJ operator to show glyphs 2007-03-23 23:08:46 +10:30
Behdad Esfahbod
820341b4c5 [test/nil-surface] Test that cairo_get_target() returns non-NULL 2007-03-21 15:44:18 -04:00
Behdad Esfahbod
ef8515b4a6 cairo_push/pop_group(), bail out if cairo_t is in error status
Fixes the new test added to test/nil-surface to not crash
2007-03-21 15:29:18 -04:00
Behdad Esfahbod
52341f7e85 [test/nil-surface] Test cairo_create(NULL). Crashing in cairo_push_group! 2007-03-21 15:21:05 -04:00
Behdad Esfahbod
9cea8a4bb2 [cairo.c] Don't access gstate members directly 2007-03-21 15:12:58 -04:00
Behdad Esfahbod
39ae64ff03 [cairo-path] Don't access gstate members directly 2007-03-21 14:56:34 -04:00
Behdad Esfahbod
bd275c1978 [cairo-pattern] Make sure cached solid patterns are not put in error status 2007-03-21 12:34:37 -04:00
Behdad Esfahbod
e76d3cfa4f [cairo-gstate] Make sure gstate->next is initialized 2007-03-21 12:33:31 -04:00
Behdad Esfahbod
1469ea22ba [cairo-gstate] Move save/restore logic into gstate instead of cairo_t
by adding _cairo_gstate_save/restore().  This is in preparation for
adding copy-on-write behavior to gstate.
2007-03-21 11:22:33 -04:00
Jeff Smith
5f83a1b542 [cairo-output-stream] Remove use of strtol 2007-03-21 10:41:03 -04:00
Behdad Esfahbod
bba7169805 Fix file permissions again
Where do these a+x attributes coming from every once in a while?
2007-03-20 22:55:02 -04:00
Behdad Esfahbod
ad51ee5aa0 Define and use ARRAY_LEN 2007-03-20 18:59:19 -04:00
Chris Wilson
1de12714a9 [cairo-surface] Use a stack buffer for small numbers of rectangles 2007-03-20 18:48:15 -04:00
Chris Wilson
9b53bc7c65 Cache solid patterns
We use a small cache of size 16 for patterns created from solid colors,
e.g. cairo_set_source_rgb(). This helps with toolkits that draw many
widgets using the same colour scheme.

The cache uses a static index variable, which itself acts like a cache
of size 1, remembering the most recently used colour. So repeated
lookups for the same colour hit immediately. If that fails, the cache
is searched linearly, and if that fails too, a new pattern is created
and a random member of the cache is evicted.
2007-03-20 18:21:53 -04:00
Behdad Esfahbod
39679b1b21 [cairo-path-fixed] Fix "comparison between signed and unsigned" warnings 2007-03-20 18:01:41 -04:00
Behdad Esfahbod
c939421e16 Oops. Remove cairo-mutex-private.h include from test surfaces
as that file is included from cairoint.h now.
2007-03-20 08:54:01 -04:00
Behdad Esfahbod
0d3e886b18 Include cairo-mutex-private.h in test backends 2007-03-20 08:50:38 -04:00
Behdad Esfahbod
0263f18f84 [configure.in] Define PIXMAN_CFLAGS, to pass -fno-strict-aliasing to pixman 2007-03-20 08:50:38 -04:00
Mathias Hasselmann
94c367f7d7 Merge branch 'master' of git+ssh://hasselmm@git.freedesktop.org/git/cairo 2007-03-20 13:33:50 +01:00
Mathias Hasselmann
c4bd7cf6f8 Move declaration of cairo_mutex_t to cairo-mutex-private.h 2007-03-20 13:32:33 +01:00
Mathias Hasselmann
9c52a9e7d8 Remove _global_image_glyph_cache_mutex which is not used anymore. 2007-03-20 13:05:48 +01:00
Behdad Esfahbod
d3177a6875 [cairo-mutex] Rename _xlib_screen_mutex to _cairo_xlib_screen_mutex 2007-03-20 07:59:47 -04:00
Mathias Hasselmann
be52178443 Initialize mutexes at central location.
All mutex declarations have been moved to cairo-mutex-list.h.
This should avoid breaking of less frequently tested backends,
when mutexes are introduced or when existing mutexes are renamed.

Instead of initializing mutexes on library startup, mutexes are
lazily initialized within the few entry points of now by calling
CAIRO_MUTEX_INITIALIZE(). Currently only the OS/2 backend takes
care about releasing global mutexes. Therefore there is no counter
part of that macro for finalizing all global mutexes yet - but
as cairo-backend-os2.c shows such a function would be quite
easy to implement.
2007-03-20 10:11:14 +01:00
Carl Worth
aba2b299db boilerplate: Add EXTRA_LTLIBRARIES to CLEANFILES to allow make distcleancheck to pass. 2007-03-19 23:50:13 -07:00
Carl Worth
2483542b74 Add skew-extreme-ref.png to the tar file for the release. 2007-03-19 23:37:28 -07:00
Carl Worth
b91ff39214 Increment cairo version to 1.4.2 (and libtool versioning to 13:1:11) 2007-03-19 23:24:26 -07:00
Carl Worth
04b3de48f5 NEWS: Add notes for cairo 1.4.2 2007-03-19 23:22:39 -07:00
Carl Worth
1401f20eb9 Temporarily remove extend-reflect from the list of tests.
This test is known to sometimes cause an X server to enter a near-
infinite loop. That's a reall unkind thing to inflict upon our
users who are being nice enough to test cairo. Let's disable
this test for the 1.4.2 release.
2007-03-19 22:39:40 -07:00
Carl Worth
725a4de42d Propagate a nil surface out of _cairo_surface_create_similar_scratch
We detect an error in the surface before calling into private surface-modifying
functions, (such as _cairo_surface_set_font_options), that don't have the
nil-surface protection of public functions.

This should fix the problem reported (again) in this bug report:

	cairo crashes in cairo_create_simular if nil surface returned by other->backend->create_similar
	https://bugs.freedesktop.org/show_bug.cgi?id=9844

Though I haven't succeeded in replicating the bug yet, (perhaps a system
difference in allowing writes to read-only memory or not, or something
like that).
2007-03-19 16:50:55 -07:00
Carl Worth
eb472a9d9c xlib: Prefer surface->format over surface->visual for identifying masks
The original test for 'if (surface->visual)' dates back to a very old
assumption that if the xlib surface was created with an XRenderFormat
that the surface->visual field would be set to NULL. This assumption
was broken years ago with the following commit:

	0c05b23b31

This fixes the crash reported here:

	BadMatch when running gnome-terminal with the murrine-0.51 gtk engine
	https://bugs.freedesktop.org/show_bug.cgi?id=10250
2007-03-19 15:10:33 -07:00
Behdad Esfahbod
d27c42cc3f [boilerplate] Don't build in make all 2007-03-19 17:42:06 -04:00
Brian Ewins
12feb1f986 [quartz] apply ctm to text (#9568)
Applies the ctm to text output on the quartz surface. This corrects
the text-pattern test, and also corrects the size of text when the
ctm includes a scale.
2007-03-19 18:22:44 +00:00
Brian Ewins
986b0ff838 [atsui] make text_to_glyphs return positions in user units. (#9568)
text_to_glyphs was returning positions in device units; correct this
to use user units.
2007-03-19 18:21:27 +00:00
Brian Ewins
06a4483927 [atsui] store sizes in the atsui font
The ATSUStyle that we store in the font contains references to
the size and font matrix; we need to store them in the font so that
they are not released before the style.
2007-03-18 20:20:11 +00:00
Brian Ewins
240479d10d [atsui] refactor CreateSizedCopyOfStyle
This is just to make it easier to use with passed-in matrices,
which I'll make use of in a subsequent patch.
2007-03-18 20:20:10 +00:00
Brian Ewins
43577e26b4 [atsui] remove the unused old_show_glyphs function.
_cairo_atsui_old_show_glyphs was a relic of the old quartz 
surface and is no longer required.
2007-03-18 20:20:10 +00:00
Carl Worth
5aaf584bf4 XCB: Fix parameter-order confusion with xcb_create_pixmap
This fixes mask-based clipping with the XCB backend, (which also makes
the xcb backend pass all tests that the xlib backend passes).
2007-03-16 17:46:08 -07:00
Behdad Esfahbod
6f96a5dd99 [win32] Really return unhinted font metrics if metrics hinting is off 2007-03-16 18:21:36 -04:00
Behdad Esfahbod
47e71eef5f [win32] Fix font descent computation 2007-03-16 17:56:53 -04:00
Mathias Hasselmann
dd4601b0d0 [cairo-perf] Emit warning, if cairo-perf is not CPU bound
cairo-perf and the X server should be bound to CPUs (either the same
	or separate) on SMP systems. Not doing so causes random results when
	the X server is moved to or from cairo-perf's CPU during the
	benchmarks.
2007-03-16 20:43:29 +01:00
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
332c38b6c3 Avoid pulling in -lz for the ps backend.
Quite some time ago we switched from using deflate-based compression to LZW
for the ps backend, (which allows it to target PostScript Level 2 instead of
PostScript Level 3). Now, we finally drop the fact that the ps backend was
still requiring zlib in order to build.
2007-03-15 23:25:06 -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