Commit graph

1795 commits

Author SHA1 Message Date
Behdad Esfahbod
83fcce0e93 [quartz] Make utility functions static 2007-03-05 17:56:57 -05:00
Behdad Esfahbod
d25548d679 In cairo_append_path(), allow excess path_data elements 2007-03-05 17:11:39 -05:00
Behdad Esfahbod
3ab9ca54aa In cairo_text_path(), bail out if zero glyphs 2007-03-05 16:33:46 -05:00
Behdad Esfahbod
4f138e4af5 Uniform object handling in _reference(), _destroy(), and _get_reference_count()
All three now regard NULL and nil inputs the same.  This is new for
_get_reference_count().  It now returns 0 on NULL too, like it does on
nil objects.
2007-03-05 16:28:31 -05:00
Behdad Esfahbod
cc12c5acc4 Make cairo_text_path() set current point correctly
This fixes the bitmap-text test that I just made reveal a bug.
2007-03-05 16:19:28 -05:00
Behdad Esfahbod
a487d09421 Rename all mutex variables to start with an underscore
since they are not static in some of the implementations (win32, ...)
2007-03-05 15:59:43 -05:00
Behdad Esfahbod
c8b84a4735 [beos] Update mutex initializers
This should be the last one.  We are going to move to a central
mutex initialization scheme right after 1.4.0 is out.
2007-03-05 15:46:19 -05:00
Behdad Esfahbod
b8e2888fbe [OS2] Add mutex initializer for cairo_font_face_mutex 2007-03-05 15:45:45 -05:00
Behdad Esfahbod
403b4b7c16 [OS2] Remove unused mutex cairo_toy_font_face_hash_table_mutex 2007-03-05 15:39:09 -05:00
Behdad Esfahbod
6358ec539d [WIN32] Make cairo_ft_unscaled_font_map_mutex initialization conditional of ft 2007-03-05 15:38:52 -05:00
Behdad Esfahbod
972f7d9fc8 [WIN32] Remove unused mutex cairo_toy_font_face_hash_table_mutex 2007-03-05 15:36:51 -05:00
Behdad Esfahbod
0cdb96544e [SVG] Cast -1 values to unsigned to indicate we really did mean to type them 2007-03-05 15:10:35 -05:00
Hans Breuer
325e752390 Fix mutex initialization for win32 (missing cairo_font_face_mutex)
We've currently got a problem where it's easy to add a mutex
for a POSIX system and easy to forget to add its intialization
for other systems. Behdad has cooked up a plan for fixing this
properly:

	http://lists.freedesktop.org/archives/cairo/2007-February/009679.html

In the meantime, we'll just kkeping breaking things, and patches
like this will be needed to fix up our mistakes.

This fix closes the following bug report:

	cairo_font_face_mutex missing from cairo-win32-surface.c
	https://bugs.freedesktop.org/show_bug.cgi?id=10175
2007-03-03 22:50:16 -08:00
Behdad Esfahbod
1082fed692 [doc] Docuemnt all symbols but cairo_filter_t and cairo_operator_t
Lets see if this is enough to push Carl Worth document those two.
2007-03-02 22:42:17 -05:00
Behdad Esfahbod
e37b6ca3e2 Beautify cairo.h 2007-03-02 22:03:27 -05:00
Behdad Esfahbod
9be961eb0c [doc] Some documentation love 2007-03-02 22:01:15 -05:00
Vladimir Vukicevic
ab1887f4b0 [quartz] Bug 3939 - Fix Quartz backend endianness problem
Add kCGBitmapByteOrder32Host to CGImageCreate call in release_dest_image
of Quartz surface.
2007-03-02 13:46:31 -08:00
Carl Worth
cd43c03d16 Fix leak of an output stream in cairo_type1_font_destroy 2007-03-02 12:30:53 -08:00
Carl Worth
6da7f14033 Fix INVALID_RESTORE case to avoid crashes
Previously, an INVALID_RESTORE error would leave cr->gstate as NULL,
(which is generally impossible/invalid). This seems safe enough as
most cairo functions check cr->status first and bail if anything
looks fishy.

However, the many cairo_get functions happily march along in spite
of any current error. We could instrument all of those functions to
check for the error status and return some dummy value in that case.
But it's much easier to get the same basic effect by simply creating
a non-NULL cr->gstate which will hold all those dummy values, and
we can eliminate the crashes without having to touch up every
cairo_get function.

This fixes the bug reported here:

	evolution crash to _cairo_gstate_backend_to_user()
	https://bugs.freedesktop.org/show_bug.cgi?id=9906

It also eliminates the crash that was added to the nil-surface test
with the previous commit.
2007-03-02 03:49:45 -08:00
Carl Worth
712447856d Fix yet another backend (quartz) for the gradient renaming
So it looks like it took us three commits before we finally got
all of the users of inner/outer switched to c1/c2. Hopefully
someday we'll have the compiler passing over all of cairo's
source code even if the backends aren't available to be run
on a particular system.
2007-03-02 03:15:35 -08:00
Carl Worth
4e0f0d9425 Don't crash if backend->create_similar returns a nil surface
This fixes the bug reported here:

	cairo crashes in cairo_create_simular if nil surface returned by other->backend->create_similar
	https://bugs.freedesktop.org/show_bug.cgi?id=9844
2007-03-02 03:12:37 -08:00
Carl Worth
b0c086fce4 Update documentation for cairo_get_scaled_font and cairo_get_font_face
There was some leftover cut-and-paste description of get_font_face
in the documentation for get_scaled_font. That turned out to be a
good thing as it alerted me to the fact that the get_font_face
documentation was stale as well.

Add description of the 'nil' object return values, rather than NULL.
2007-03-02 03:12:37 -08:00
Jinghua Luo
d48f313701 glitz: fix build error.
Rename radial gradient inner/outer to c1/c2.
2007-03-02 18:37:06 +08:00
Carl Worth
c12a4571af Cast -1 values to unsigned to quiet the compiler.
Marking the magic values to indicate we really did mean to type them.
2007-03-02 00:37:21 -08:00
Carl Worth
3685a66b5b Cast away a const to quiet a compiler warning. 2007-03-02 00:22:57 -08:00
Carl Worth
d48bb4fbe8 Implement CAIRO_MUTEX_INIT with memcpy instead of pthread_mutex_init
The trick here is that with the weak symbol support for pthreads,
pthread_mutex_init can be a NOP leaving the mutex uninitialized.
Then, if some pthread-using library is dynamically loaded, the
non-NOP pthread functions get used and we end up trying to lock
an uninitialized mutex.

This should fix the bugs reported here:

	Cairo 1.3.14 deadlocks in cairo_scaled_font_glyph_extents or _cairo_ft_unscaled_font_lock_face
	https://bugs.freedesktop.org/show_bug.cgi?id=10035
2007-03-01 23:42:03 -08:00
Carl Worth
df2d42ac7f Merge branch 'radial-gradient-fixes' into cairo 2007-03-01 17:08:03 -08:00
Behdad Esfahbod
ec11ca33a7 [PS/PDF] Mark CAIRO_EXTEND_PAD for surface patterns as natively supported
since the image surface does not implement that case either, so image
fallbacks have no benefit.
2007-03-01 19:14:40 -05:00
Behdad Esfahbod
dcdcb7ac2a Fix leak in rectilinear stroking code
The code was not cleaning up after itself when rejecting a path as
rectilinear.
2007-03-01 18:36:16 -05:00
Carl Worth
97dbbae621 SVG: Support CAIRO_EXTEND_NONE for radial gradients.
This is as simple as adding transparent color stops on either end.
2007-03-01 15:17:19 -08:00
Behdad Esfahbod
7de96a1faa [xlib] Drop XrmFinalize() stuff. That didn't ever exist in any public X server 2007-03-01 18:00:23 -05:00
Carl Worth
0439f4c4f7 Rename radial gradient inner/outer to c1/c2
The inner/outer names were totally bogus. It is quite
legitimate to have the first circle's radius be larger than
that of the second.
2007-03-01 13:21:54 -08:00
Behdad Esfahbod
c9ddb86e67 [paginated] Also increase page number in copy_page 2007-03-01 13:51:29 -05:00
Adrian Johnson
dc0043383b PDF: Ensure ToUnicode CMap name is unique
and remove an unused printf argument.
2007-03-01 23:39:10 +10:30
Behdad Esfahbod
d0fe666a6a Revert the solid-pattern cache
This reverts the following commits:

	2715f20981
	67e3b3c53b

See this thread for an analysis of the problems it caused:

	http://lists.freedesktop.org/archives/cairo/2007-February/009825.html

In short, a single cache for all backends doesn't work, as one thread
using any backend can cause an unused xlib pattern to be evicted from
the cache, and trigger an xlib call while the display is being used
from another thread.  Xlib is not prepared for this.
2007-02-28 14:58:57 -05:00
Behdad Esfahbod
efe8c82738 [paginated] Also do an automatic show page if nothing ever drawn
That is, we always emit at least one page of output.  Otherwise our
PS/PDF/SVG files would be corrupt, and output with zero pages does
not make much sense.
2007-02-28 14:19:18 -05:00
Behdad Esfahbod
07d61af809 [paginated] Automatically issue a final cairo_show_page()
This means, PS/PDF/SVG do not need the final cairo_show_page() anymore.
If there is any drawing in the page, a cairo_show_page() is done
automatically.
2007-02-28 13:46:27 -05:00
Behdad Esfahbod
ef53465a03 Slim-hidden cairo_scale() 2007-02-27 20:18:16 -05:00
Behdad Esfahbod
ed75e24898 Implement cairo_get_scaled_font() 2007-02-27 20:09:46 -05:00
Behdad Esfahbod
d64b194a45 [quartz] Remove comment syntax that is recognized by gtkdoc from regular comments 2007-02-27 20:03:26 -05:00
Behdad Esfahbod
65ab63cb8d [cairo.c] Reorder some function implementations for clarity 2007-02-27 19:45:10 -05:00
Behdad Esfahbod
ed933a199c [cairo.h] Reorder function prototypes a bit for clarity 2007-02-27 19:43:18 -05:00
Behdad Esfahbod
e2ce27db30 [PS/PDF] Fix xstep/ystep values for CAIRO_EXTEND_NONE
This fixes the fallback-resolution test, as well as the two of
surface-pattern-scale-up and surface-pattern-scale-down.
2007-02-27 18:47:47 -05:00
Behdad Esfahbod
7185c00e15 [PS] Add note about possible need for fix. 2007-02-23 17:26:43 -05:00
Behdad Esfahbod
38b590d8b7 [SVG] Fix warnings 2007-02-23 17:26:43 -05:00
Behdad Esfahbod
69edcd4623 [SVG] Rename a local variable for clarity 2007-02-23 17:26:43 -05:00
Behdad Esfahbod
11b3f43e92 [TODO] Add various TODO items 2007-02-23 17:26:43 -05:00
Behdad Esfahbod
289ac33fa2 [PS] Fix surface patterns with transforms
Previously we were generating an image object with the desired
transform and then a pattern with only a translation.  This means,
the pattern was alwasys axis-aligned.  Obviously this does not
work correctly with repeated rotated patterns.

We now use an identity matrix for the image and put all the
pattern transformation (well, it's inverse) into the pattern.
This fixes the issue nicely.

The surface-pattern test is still failing even with a reference
image, because the gs rendering of the normal case and the
device-offset=25 case are different and both have seams.
2007-02-23 17:26:43 -05:00
Behdad Esfahbod
7c39276366 [PS/PDF] Accept CAIRO_EXTEND_REFLECT surface patterns natively
With the hack in _cairo_pattern_acquire_surface to return a 2x2
surface for reflected patterns, we can now accept REFLECT surface
patterns natively in all backends.  SVG was already doing that.
The PDF case needed some changes to go through
_cairo_pattern_acquire_surface.  A similar change to the recent
change in SVG.
2007-02-23 17:26:42 -05:00
Behdad Esfahbod
63c011bb6b [surface] Copy device_transform_inverse in _cairo_surface_clone_similar 2007-02-23 17:26:42 -05:00