Commit graph

3833 commits

Author SHA1 Message Date
Chris Wilson
c175cf7b83 [cairo-ft-font] Remove erroneous cached font faces.
Only return a font face from the cache if it is not in an error condition.
Otherwise unlink the bad font face from the cache and construct a new one.
2007-05-25 12:25:31 +01:00
Chris Wilson
f382c3e110 [cairo-pattern] Fully initialise the error pattern.
_cairo_pattern_fini depends on the pattern being correctly initialised,
for example when calling _cairo_user_data_array_fini(), so we need to
initialize the whole pattern and not just set the type to SOLID when
creating a pattern for a surface in error.
2007-05-25 12:15:48 +01:00
Boris Zbarsky
fcdfda8365 [quartz] implementing release_source_image (#11059)
The image surface that _cairo_quartz_surface_acquire_source_image creates never
seems to be released, probably because there is no release_source_image callback
in the quartz code.

The attached patch fixes that problem, at least insofar as the image surface
itself is no longer leaking.  I'm not sure whether any other cleanup needs to
happen here.

-Boris
2007-05-24 23:48:01 +01:00
Carl Worth
2c8598aafb Fix typo in comment. 2007-05-18 13:23:04 -07:00
Carl Worth
3cb67435f8 Document behavior of color stops added with identical offsets. 2007-05-18 13:22:36 -07:00
Carl Worth
1cf4ed9894 ROADMAP: Add bugs for 565 and 655 Visuals to the list 2007-05-18 13:16:36 -07:00
Behdad Esfahbod
7260ee23ec [Type1] #include <ctype.h> (#10989) 2007-05-18 11:55:56 -04:00
Adrian Johnson
6a42ddf0f9 TrueType Subsetting: Remove post table
The post table is not used now that TrueType fonts are embedded
in PDF as CID fonts.
2007-05-17 12:45:22 +09:30
Adrian Johnson
67e752f75f CFF Subsetting: Filter out Unique ID from subset
The subsetted font is not the same as the original font so it should not
have the same XUID and UniqueID.
2007-05-17 11:48:25 +09:30
Adrian Johnson
99a6983017 Ensure surface backend finish() is never called more than once.
Previously if the backend finish() function returned an error status,
surface->finished was not set true. This would result in the backend
finish() function being called twice which in the case of the PostScript
backend caused a seg fault.
2007-05-17 10:17:09 +09:30
Chris Wilson
c5ae0f1232 [cairo-truetype-subset] Avoid a potential 0 byte allocation.
During _cairo_truetype_subset_init skip copying the string_offsets if
the vector is empty.
2007-05-16 16:18:46 +01:00
Chris Wilson
e37bee3f52 [cairo-pdf-surface] emit_pattern_stops() array overrun.
_cairo_pdf_surface_emit_pattern_stops() tried to set the last element
to have an offset of exactly 1.0, but missed and set the next element
after the end of the array.
2007-05-16 16:06:26 +01:00
Chris Wilson
27de1869f5 [cairo-pdf-surface] Free allstops on error.
Ensure the locally allocated resources are freed on the error paths.
2007-05-16 16:06:26 +01:00
Chris Wilson
79e6c0207c [cairo-pattern] Check for the nil surface.
cairo_surface_create_similar() does not return NULL as was being checked
for, but the nil surface on error. Also ensure that the returned surface
is destroyed if we encounter an error whilst compositing.
2007-05-16 16:06:26 +01:00
Chris Wilson
32c0ef9f14 [cairo-gstate] Remove a redundant conditional.
Simplify _cairo_gstate_text_to_glyphs() with a tail call.
2007-05-16 16:06:26 +01:00
Chris Wilson
37d8c18b3f [cairo-scaled-font-subsets] Destroy the glyph if we fail to cache it.
If we fail to insert the glyph into the sub_font glyph cache then we
must destroy it before propagating the error.
2007-05-16 16:06:26 +01:00
Chris Wilson
76e758df5b [cairo-truetype-subset] Destroy the arrays on error.
Growing the arrays may successfully allocate the indirect pointer, but
fail whilst allocating the actual array - so always call
_cairo_array_fini after _cairo_array_grow_by().
2007-05-16 16:06:25 +01:00
Chris Wilson
b63b32958e [cairo-scaled-font-subsets] Destroy the parent and subfont on error.
If we fail to create the sub font destroy the local reference to the
parent font and if we fail to insert the sub font into the hash table,
destroy the newly create sub font.
2007-05-16 16:06:25 +01:00
Chris Wilson
fcd1076bcf [cairo-ft-font] Destroy the path on error.
During _decompose_glyph_outline() destroy the fixed path if we
encounter an error.
2007-05-16 16:06:25 +01:00
Chris Wilson
abb19e61cf [cairo-ft-font] Destroy the unscaled reference on error.
Release the reference to the unscaled font if we encounter an error
whilst initialising the cairo_ft_scaled_font_t.
2007-05-16 16:06:25 +01:00
Chris Wilson
e4055f02a1 [cairo-ft-font] Race between unscaled removal from hash table and creation
Small window of opportunity for the unscaled font to be destroyed and
removed from the hash table before
_cairo_ft_unscaled_font_create_for_pattern() takes a reference on behalf
of its cairo. Close the window by taking the reference with the font
map lock held.
2007-05-16 16:06:25 +01:00
Chris Wilson
f239308ef1 [cairo-deflate-stream] Free the stream on error.
Before returning the nil output stream, free the locally allocated
stream when encountering an error during _cairo_deflate_stream_Create().
2007-05-16 16:06:25 +01:00
Chris Wilson
35a2ed0335 [cairo-ft-font] Destroy surface if glyph transformation fails.
As we allocated the surface we need to destroy it if we encounter an
error.
2007-05-16 16:06:25 +01:00
Chris Wilson
6a43c02723 [cairo-xlib-screen] Increase number of GC depths.
Add support for depths 12 and 30, and a separate unknown.
2007-05-16 16:06:25 +01:00
Chris Wilson
70611846de [cairo-xlib-surface] Always nullify GC after pushing to screen.
The status return from _cairo_xlib_screen_put_gc() indicates the failure
to queue a job to free an old GC - the current GC is always transferred
away from the caller, so always nullify it in the surface.
2007-05-16 16:06:25 +01:00
Chris Wilson
58c35e6d7b [cairo-paginated-surface] Check surface status during finish.
Propagate children status during finish.
2007-05-16 16:06:25 +01:00
Chris Wilson
9ffd8154e2 [cairo-scaled-font-subsets] Correctly destroy the hash table.
After an allocation failure in
_cairo_scaled_font_subsets_create_internal() call
_cairo_hash_table_destroy() instead of a mere free().
2007-05-16 16:06:25 +01:00
Chris Wilson
bcfc5f0bdb [pixman] Propagate allocation failure.
pixman_op() failed to propagate the failure from
pixman_region_appendNonO() and the generic op.
2007-05-16 16:06:24 +01:00
Chris Wilson
9e99f0611c [cairo-traps] Initialize traps to use embedded buffer.
Set the traps to use the embedded buffer during initialization which will
save one redundant _cairo_traps_grow()
2007-05-16 16:06:12 +01:00
Chris Wilson
35eb65b777 [cairo-path] Check for errors during the count.
Return the nil object if we encounter any error whilst trying to
generate the path.

Also special case the NO_MEMORY error object to return the nil object.
2007-05-16 15:28:57 +01:00
Chris Wilson
a60afb0e78 [cairo-scaled-font] Return status of _cairo_scaled_font_glyph_path()
The status return of _cairo_path_fixed_interpret() was being ignored,
propagate it.
2007-05-16 15:21:02 +01:00
Behdad Esfahbod
d46f6872a5 [docs] Update to latest source changes and kill warnings 2007-05-13 21:52:52 -04:00
Chris Wilson
40558cb15e [cairo-xlib-screen] Clear the gc_needs_clip_reset after use.
After consuming the GC we need to unset the clip reset flag, so that
if we try and get a new GC without first putting a fresh one we do not
try to call XSetClipMask on a NULL GC.

(Fixes http://bugs.freedesktop.org/show_bug.cgi?id=10921)
2007-05-12 10:11:46 +01:00
Chris Wilson
abba3f2375 [valgrind-suppressions] Update to cover XrmGetStringDatabase
By dropping the top frame from suppression, the XrmGetFileDatabase
suppressions will also match XrmGetStringDatabase leaks which are
starting to occur.
2007-05-10 23:05:46 +01:00
Chris Wilson
c4abc3a0e3 [cairo-truetype-subset] Set CAIRO_STATUS_NO_MEMORY on malloc failure.
_cairo_truetype_font_create() failed to update the status before
returning after detecting an allocation failure, leaving its callers
none the wishing - and eventually triggering a segmentation fault when
the font was used in anger.
2007-05-10 21:29:03 +01:00
Chris Wilson
ebababc0cf [cairo-pattern] Return the nil cairo_pattern_t for CAIRO_STATUS_NO_MEMORY.
If we asked to create a pattern after encountering an allocation failure,
we can avoid another allocation by returning the nil pattern object.
2007-05-10 21:03:03 +01:00
Chris Wilson
e8e5f93ffe [cairo-meta-surface] Add a surface->status guard to meta_surface_replay()
Before attempting to access the cairo_meta_surface_t specific members,
we need to ensure that _cairo_meta_surface_replay() has received a true
meta surface rather than an error surface (e.g. _cairo_surface_nil).
2007-05-10 20:53:37 +01:00
elaine
195112697f [xlib] The buggy_repeat path should be removed for Xsun now
Sun never released a version of Solaris with Xorg with the buggy repeat
problem.  This patch was only needed for development versions of Solaris
Nevada (roughly builds 25-30).  The latest S10U release and Nevada releases
have a fixed Xorg.  So no users should ever encounter this bug.

We need to remove this test because Xsun has the same VendorString and a lower
VendorRelease number so it falsely triggers buggy_repeat to be turned on.
They just added Xrender support recently to Xsun, so this wasn't an issue
before recently.
2007-05-10 13:58:44 -04:00
Chris Wilson
ab6a767cf4 [cairo-scaled-font] Check for allocation failure.
cairo_scaled_font_create() returns a nil object on failure whereas a few
callers were checking for NULL.

Secondly review the public entry points for cairo_scaled_font_*() to
ensure that all check that they will not attempt to overwrite the
read-only nil object.
2007-05-10 17:18:27 +01:00
Chris Wilson
aec92188f1 [cairo-clip] Correctly report allocation failure
Distinguish between the unrepresentable clip and the failure to allocate
the clip extents.
2007-05-10 09:30:14 +01:00
Chris Wilson
1a719d1189 [cairo] Use _cairo_clip_nil for CAIRO_STATUS_NO_MEMORY
When creating a error clip list for CAIRO_STATUS_NO_MEMORY, simply
reuse the nil object rather than allocate a fresh list.
2007-05-10 09:30:06 +01:00
Chris Wilson
3fbc4bb5ae [cairo-clip] Add missing error status for _cairo__clip_intersect_region()
An out-of-memory error path missed setting CAIRO_STATUS_NO_MEMORY.
2007-05-09 21:42:15 +01:00
Chris Wilson
b5d2506879 [cairo] cairo_pop_group() returns a NULL pattern
cairo_pop_group() checks for a NULL return from
cairo_pattern_create_for_surface() instead of the nil cairo_pattern_t,
and then returns a NULL pattern instead of the nil object.
2007-05-09 16:29:39 +01:00
Chris Wilson
6f09e93ad7 [ciro-surface-fallback] Propagate status for _clip_and_composite_trapezoids
The result of _clip_and_composite_trapezoids() was ignored by 2/3 of
its callers - simply propagate the status.
2007-05-09 16:29:04 +01:00
Chris Wilson
ae5d4a1c17 [cairo] Return after detecting the invalid font-options.
Do not continue to copy the contents of the nil cairo_font_options_t,
but set the error on the context and return.
2007-05-09 16:28:52 +01:00
Chris Wilson
dfd4d41ac9 [cairo-xlib-surface] Free the allocation if we fail to queue the work.
Avoid the leak of the allocated argument if we fail to queue the work to
free the glyph.
2007-05-09 12:56:49 +01:00
Chris Wilson
8ddfc1b2e4 [cairo-pattern] Return status from _cairo_pattern_init_copy()
During the copy, allocation of the gradient may fail and so the callers
need to check for a pattern that returned in an error state. No callers
did so and in order to force all callers to check the error status,
the status return was added to _cairo_pattern_init_copy().  The early
error checking may appear redundant for an object with an embedded
structure, however it does fix an error where an uninitialised pattern
was being used:

==1922== Process terminating with default action of signal 11 (SIGSEGV)
==1922==  Access not within mapped region at address 0x55555555
==1922==    at 0x402CF6F: _cairo_array_index (cairo-array.c:208)
==1922==    by 0x402D4F3: _cairo_user_data_array_fini (cairo-array.c:370)
==1922==    by 0x4046464: _cairo_pattern_fini (cairo-pattern.c:188)
==1922==    by 0x404992A: _cairo_meta_surface_paint (cairo-meta-surface.c:266)
==1922==    by 0x403FCE0: _cairo_surface_paint (cairo-surface.c:1331)
==1922==    by 0x405CB5E: _test_meta_surface_paint (test-meta-surface.c:195)
==1922==    by 0x403FCE0: _cairo_surface_paint (cairo-surface.c:1331)
==1922==    by 0x4032A60: _cairo_gstate_paint (cairo-gstate.c:822)
==1922==    by 0x402B2D1: cairo_paint (cairo.c:1879)
==1922==    by 0x804A4F7: draw (radial-gradient.c:73)
==1922==    by 0x804AFA4: cairo_test_expecting (cairo-test.c:326)
==1922==    by 0x804A57C: main (radial-gradient.c:109)
==1922== Injected fault at:
==1922==    at 0x4020EA5: malloc (vg_replace_malloc.c:207)
==1922==    by 0x404475C: _cairo_pattern_init_copy (cairo-pattern.c:136)
==1922==    by 0x403F779: _cairo_surface_copy_pattern_for_destination (cairo-surface.c:2153)
==1922==    by 0x403FCC1: _cairo_surface_paint (cairo-surface.c:1328)
==1922==    by 0x405CB5E: _test_meta_surface_paint (test-meta-surface.c:195)
==1922==    by 0x403FCE0: _cairo_surface_paint (cairo-surface.c:1331)
==1922==    by 0x4032A60: _cairo_gstate_paint (cairo-gstate.c:822)
==1922==    by 0x402B2D1: cairo_paint (cairo.c:1879)
==1922==    by 0x804A4F7: draw (radial-gradient.c:73)
==1922==    by 0x804AFA4: cairo_test_expecting (cairo-test.c:326)
==1922==    by 0x804A57C: main (radial-gradient.c:109)
2007-05-09 10:14:20 +01:00
Chris Wilson
dbdaf0690e [cairo-scaled-font] Check _cairo_scaled_glyph_loop() status
In _cairo_scaled_font_glyph_path() we forgot to check the status return
of _cairo_scaled_glyph_loop() - propagate any failures.
2007-05-09 09:23:57 +01:00
James Cloos
b744c27051 [cairo-directfb-surface] Fix typo from commit a8c8e17d
Fix typo in name of _cairo_directfb_surface_is_similar().
2007-05-09 09:03:21 +01:00
Chris Wilson
cbc9218cd3 [cairo-xcb-surface] Fix compilation
As spotted by James Cloos <cloos@jbcloos.com>, I broke the compilation...
This is a minimal fix with no claims of completeness.
2007-05-09 09:03:04 +01:00