Vladimir Vukicevic
61ba63f3a0
[win32] remove ignore_operators flag from win32 printing surface
...
Remove the ignore_operators fallback-avoiding workaround; if apps
want that same behaviour, they'll have to implement it themselves
by taking care when calling cairo_set_operator().
2007-10-09 13:56:59 -07:00
Adrian Johnson
cbc4087a40
Type1 subset: Add check for CFF fonts
2007-10-06 19:18:31 +09:30
Chris Wilson
a1633df6ee
[cairo-scaled-font-subsets] Increment the sub_font counter after insertion.
...
Do not modify the parent subsets->num_sub_font until after we have
successfully created the sub_font and inserted it into the hash table.
2007-10-05 18:47:24 +01:00
Chris Wilson
cf2f994a31
[cairo-paginated-surface] Propagate backend errors to the surface.
...
If we call a srface backend function directly, then it our
responsibility to propagate any fatal errors to the surface.
2007-10-05 18:35:12 +01:00
Chris Wilson
3da62fdd28
[cairo-xlib-display] Rescan the displays list during shutdown.
...
As we drop the list mutex whilst calling the hooks during the
XCloseDisplay callback, we must rescan the list when we reacquire the
mutex in order to remove the display from the list.
2007-10-05 18:34:58 +01:00
Chris Wilson
737cbd25a6
[cairo-ps-surface] Cleanup ps surface after creation failure.
...
If we fail to create the paginated wrapper for the ps surface, cleanup
the resources allocated for the surface.
2007-10-05 18:34:44 +01:00
Chris Wilson
b210bea6c1
[cairo-pdf-surface] Check for pdf_resource_t allocation failure.
...
Check that the resources are actually allocated or propagate the error.
2007-10-05 18:34:11 +01:00
Chris Wilson
5ac7ba9821
[cairo-pdf-surface] Destroy local resources on failed surface creation.
...
During _cairo_pdf_surface_create_for_stream_internal() destroy all
locally allocated resources and the output stream if we fail to create
the pdf surface or its paginated wrapper.
2007-10-05 18:34:01 +01:00
Chris Wilson
63ddfa077c
[cairo-pdf-surface] Propagate error status.
...
Add a few missing propagations of error status.
2007-10-05 18:33:48 +01:00
Chris Wilson
f1b6e2735c
[cairo-ps-surface] Propagate errors from emit_pattern().
...
Do not discard the error status from _cairo_ps_surface_emit_pattern(),
but propagate it back to the caller.
2007-10-05 18:33:38 +01:00
Chris Wilson
709f316036
Cleanup a couple of warnings for use of uninitialized statuses.
...
The compiler spotted a couple of potential uses of an uninitialized
status variable - apply the obvious fixes.
2007-10-05 17:37:05 +01:00
Chris Wilson
2f22510e22
[cairo-xlib] Initialize the global mutexes.
...
The xlib surface creation routines will eventually attempt to lock the
global _cairo_xlib_display_mutex. Under the default environment this is
a non-issue as the CAIRO_MUTEX_INITIALIZE/FINALIZE become no-ops under
pthreads. However, for the sake of correctness (i.e. to silence the
lockdep debugger!) insert a call to initialize the global mutexes at the
start of the public entry points.
2007-10-05 16:25:02 +01:00
Chris Wilson
d2557cd5ee
[test-paginated] Free resources if fail to create the test surface.
...
Ensure that all the locally allocated resources are freed if we fail
to allocate the paginated test surface.
2007-10-05 16:16:36 +01:00
Chris Wilson
60ffeecd48
[test-surfaces] Mark the test backend as static.
...
There is no need to export the test surface backends, so mark them
static.
2007-10-05 16:16:36 +01:00
Chris Wilson
6598973661
[cairo-scaled-font-subset] Propagate errors during collection.
...
Propagate the errors encountered whilst iterating over the scaled font
subsets ie _cairo_scaled_font_subsets_foreach_scaled() and co.
2007-10-05 15:26:30 +01:00
Chris Wilson
3a2dd9d336
[cairo-png] Markup a couple of original error sites with _cairo_error().
...
Add the _cairo_error() markup to the original error sites within the png
read/write functions.
2007-10-05 15:26:14 +01:00
Chris Wilson
81243ee7ef
[cairo-scaled-font] Mask cannot be NULL so remove redundant check.
...
We either generate a mask for the glyphs or throw an error and bypass
the check, so at that point mask can never be NULL and we do not need
the test.
2007-10-05 15:26:03 +01:00
Chris Wilson
f3d921baca
[cairo-scaled-font] Destroy the zombie font.
...
If we do not transfer the font to the holdovers array (because it has
been removed from the cache and left in a zombie state), destroy it.
2007-10-05 15:25:47 +01:00
Chris Wilson
41aab58f3a
[cairo-surface] Add the usual guards to the API entry point.
...
Add the checks for unmodifiable surfaces (snapshots, finished and error) to
cairo_surface_set_fallback_resolution.
2007-10-05 15:25:32 +01:00
Chris Wilson
f3ae783c9c
[cairo-surface-fallback] Release the acquired image on error.
...
Add _cairo_surface_release_source_image() to the error paths.
2007-10-05 15:25:08 +01:00
Chris Wilson
29a5aae958
[cairo-type1-fallback] Propagate error from closing the stream.
...
Propagate the error from destroying the font and closing the output stream.
2007-10-05 15:24:25 +01:00
Chris Wilson
dd0f2d851c
[cairo-atomic] Hide compiler warnings for _cairo_status_set_error().
...
gcc treats cairo_status_t as an unsigned integer and so generates a
warning when passing it address as signed integer pointer to
_cairo_atomic_int_cmpxchg(). Use an ugly cast to hide the warning and
similarly to hide the warning about the unused result.
2007-10-05 15:23:15 +01:00
Chris Wilson
91d18eefe7
[cairo-type1-subset] Propagate error status (correctly!)
...
Adrian Johnson pointed out a couple of mistakes in my previous attempt,
535e7c161b , to ensure propagation of errors
throughout the generation of the type1 subset.
This time the status member of the cairo_type1_font_subset_t is removed
in favour of simply return the error status from each function. This
completely avoids the issue of whether we overwrite a pre-existing error
status and confustion of status returns and the status member. The
removal of the status from the structure is possible due to its
short-lived nature - it is not exposed outside of the
_cairo_type1_subset_init() function, and is not shared by any other
piece of code.
2007-10-05 15:23:06 +01:00
Chris Wilson
bd2245f8b8
[cairo-svg-surface] Review error propagation.
...
Ensure that the error status is propagated and all local resources
are freed on the error path.
2007-10-05 00:45:00 +01:00
Chris Wilson
853b29c56f
[cairo-pdf-surface] Add some missing error propagation.
...
Add a couple of returns where the status was being assigned but not
checked.
2007-10-04 23:39:21 +01:00
Chris Wilson
323511088d
[cairo-pdf-surface] Propagate errors from close_stream.
...
Propagate the status return from _cairo_pdf_surface_close_stream().
2007-10-04 23:23:44 +01:00
Chris Wilson
0e3f5caf9f
[cairo-pdf-surface] Propagate errors during pattern selection.
...
Propagate error from _cairo_pdf_surface_select_pattern ().
2007-10-04 23:18:33 +01:00
Chris Wilson
7940e39c18
[cairo-pdf-surface] Propagate errors from opening/closing groups.
...
Propagate the any error encountered during _cairo_pdf_surface_open_group
and friends.
2007-10-04 23:15:21 +01:00
Chris Wilson
7601939a65
[cairo-deflate-stream] Return the nil stream if creating from an error stream.
...
If _cairo_deflate_stream_create() is passed a stream in the error state,
return a stream also in the error state, namely the _cairo_output_stream_nil.
2007-10-04 23:07:36 +01:00
Chris Wilson
717dcd1a2c
[cairo-pdf-surface] Propagate resource allocation failure.
...
Propagate failure of _cairo_pdf_surface_new_object().
2007-10-04 21:17:31 +01:00
Chris Wilson
8fb40aee97
[cairo-image-surface] Check for errors whilst cloning.
...
After attempting to clone an image, check the context status and return
the nil surface if there was an error.
2007-10-04 20:08:22 +01:00
Chris Wilson
b61931640d
[cairo-ps-surface] Check the creation of output streams.
...
Check for allocation errors during the creation of the output streams.
2007-10-04 20:08:10 +01:00
Chris Wilson
353c2ab5c0
[cairo-output-stream] Guard against destroying the nil streams.
...
Add a guard to return early if we attempt to call
_cairo_output_stream_destroy() on the nil cairo_output_stream_t streams.
2007-10-04 20:07:58 +01:00
Chris Wilson
7cc7bf09c1
[cairo-meta-surface] Propagate errors during replay to the surface.
...
Store any fatal errors raised during the replay on the surface object.
2007-10-04 20:07:43 +01:00
Chris Wilson
042821b566
[cairo-surface] Propagate fatal errors to the surface.
...
Store errors raised by the backend on the surface.
2007-10-04 20:07:36 +01:00
Chris Wilson
535e7c161b
[cairo-type1-subset] Do not mask error returns.
...
When propagating errors, check that we do not overwrite a pre-existing
error.
2007-10-04 18:45:17 +01:00
Chris Wilson
bb8d4c0b14
[cairo-truetype-subset] Do mask error status returns.
...
Be careful not to overwrite existing the error status when propagating
errors and to not blindly return INT_STATUS_UNSUPPORTED from
load_truetype_table() as this will mask fatal errors.
2007-10-04 18:33:24 +01:00
Chris Wilson
37fd0d8967
[cairo-cff-subset] Propagate errors and review error paths.
...
Ensure that errors get duly propagated back to the caller and all
locally allocated resources are freed along error paths.
2007-10-04 17:18:25 +01:00
Chris Wilson
add0959328
[cairo-debug] Finalize mutexes along with other static data.
...
Initialize (so repeated calls of cairo_debug_reset_static_data() is
safe) and finalize the mutexes with the reset of the static data.
2007-10-04 17:00:26 +01:00
Chris Wilson
a4f20610af
[cairo] Protect the getters when operating on the nil object.
...
Put a guard that checks the context's status at the start of each
getter that prevents the function from trying to dereference NULL state.
Use the status, as opposed to the invalid reference count, for
consistency with the existing guards on some of the getters.
2007-10-04 16:44:27 +01:00
Chris Wilson
80c06f4539
[cairo-scaled-font] Don't hold onto to a dropped font.
...
Mark fonts that have been removed from the cache due to an error on a
shared object and do not put them into the holdovers array.
2007-10-04 16:16:58 +01:00
Chris Wilson
6e93941a76
[cairo-scaled-font] Acquire mutex around _cairo_scaled_font_glyph_path().
...
All calls that manipulate the scaled_font->cache must hold its mutex.
2007-10-04 16:04:49 +01:00
Chris Wilson
261971a3fb
[cairo-gstate] Fix resource leaks on error paths.
...
Ensure that all locally allocated (or referenced) resources are freed
if we later encounter an error.
2007-10-04 16:03:12 +01:00
Chris Wilson
4e44d54f3e
[cairo-matrix] Check whether a matrix is invertible before use.
...
Provide an early check as to whether the font matrix is invertible.
2007-10-04 16:00:22 +01:00
Chris Wilson
528da4e5e1
[cairo-scaled-font] Freeze the font cache whilst iterating over glyphs.
...
Prevent glyph cache removal whilst iterating over a glyph string.
2007-10-04 15:50:40 +01:00
Chris Wilson
4b81eeb20e
[cairo-scaled-font] Destroy the mask on the error path.
...
Do not leak the mask if we encounter an error whilst tracing.
2007-10-04 15:46:13 +01:00
Chris Wilson
d0b1308cd7
[cairo-scaled-font] Store fatal errors on the cairo_scaled_font_t.
...
Ensure that all fatal errors raised whilst using the font are stored on
the font.
2007-10-04 15:44:10 +01:00
Chris Wilson
4c32e6bfde
[cairo-scaled-font] Return the error status from _cairo_scaled_font_set_error()
...
Similar to the other _cairo_*_set_error() return the error status.
2007-10-04 15:31:25 +01:00
Chris Wilson
06ae5f1ba3
[cairo-font-face] Set the error on the font.
...
Similar to the other shared objects, store fatal errors on the shared
font_face. And do not return a cached reference to an object in an
error state.
2007-10-04 15:26:09 +01:00
Chris Wilson
4cffdf2681
[cairo-ft-font] Always call _cairo_ft_unscaled_font_fini ().
...
The _cairo_ft_unscaled_font_fini() was skipped during the destroy for
fonts generated by cairo_ft_font_face_create_for_ft_face(). However
this causes a mutex to be 'leaked' for each font.
2007-10-04 14:59:55 +01:00