Commit graph

3918 commits

Author SHA1 Message Date
Chris Wilson
a5b74da68b [malloc] Check for integer overflow when realloc'ing.
Perform similar sanity checks to Vlad's _cairo_malloc_ab() but on the
arguments to realloc instead.
(cherry picked from commit e49bcde27f)
2007-11-26 21:24:46 -08:00
Chris Wilson
96d0c44ac8 [cairo-path] Don't raise an error when attempting to create an empty path.
Generate a real empty path structure instead of returning
_cairo_path_nil, if we have been asked to create an empty path.

(Also add a couple of missing _cairo_error()s and an appropriate test
case.)

Spotted by Fred Kiefer.
(cherry picked from commit b4f86638cc)
2007-11-26 21:24:46 -08:00
Adrian Johnson
fb62103c7b CFF Subetting: Fix for #10849
This fixes the problem Apple Preview has with viewing PDFs with CFF
font subsets.
(cherry picked from commit 042c382c09)
2007-11-26 21:24:45 -08:00
Adrian Johnson
9457131f8b Truetype Subsetting: Avoid failing when fonts are missing optional tables
Previously, the TrueType subsetting would fail if any of the "cvt",
"fpgm", or "prep" tables were missing from the source font. However
these tables are optional and not required in the subsetted font if
they do not appear in the source font.

The "name" table has been removed from the subsetted font as the
Type42 specification does not require this table.
(cherry picked from commit b20e08999e)
2007-11-26 21:24:45 -08:00
Brian Ewins
4e2a11e0f1 [type1-subset] only subset ft fonts
If atsui and ft were both enabled, the code crashed trying to subset
type-1 fonts; fixed by checking if fonts really are ft before using
them as ft fonts. This is a temporary fix until we support subsetting
across all font backends.
(cherry picked from commit 8132b8b417)
2007-11-26 21:24:45 -08:00
Vladimir Vukicevic
d672c26396 Avoid divide-by-zero when trying to allocate a 0-sized array
Fix up the _cairo_malloc_* wrappers to avoid blindly dividing by zero;
any attempt to allocate a zero-sized chunk of memory will result in
NULL.
(cherry picked from commit 6020f67f1a)
2007-11-26 21:24:44 -08:00
Vladimir Vukicevic
d5bdb91809 Make NO_MUTEX really mean no mutexes
(cherry picked from commit e3c16e15e3)
2007-11-26 21:24:44 -08:00
Behdad Esfahbod
1ea1fadf7e [cairo-ft-font] Ignore FT_Load_Glyph errors other than out-of-memory
Same for FT_Render_Glyph.

When the user asks us to render a glyph that is not available in the font,
it's mostly an unavoidable kind of error for them, as in, they can't
avoid such a call.  So it's not nice to put cairo_t in an error state and
refuse any further drawying.

Many PDF files are created using buggy software and cause such glpyh-not-found
errors for CID 0 for example.

Eventually we should propagate these kind of errors up and return it from
the function call causing it, but that needs API change to add return value
to all text functions, so for now we just ignore these errors.
(cherry picked from commit 79d975f84b)
2007-11-26 21:24:41 -08:00
Behdad Esfahbod
57bc62a61e =?utf-8?q?[ChangeLog.mk]=20Make=20make=20rule=20depend=20on=20.git/HEAD,=20not=20.git
=20That=20is=20exactly=20what=20we=20want.=20=20Kristian=20H=C3=B8gsberg=20suggested=20it.
=20(cherry=20picked=20from=20commit=2021ab44f11d3d20eead5d988c7a6cf48eebff08c7)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
2007-11-26 21:24:41 -08:00
Chris Wilson
7092924195 [cairo-ft-font] Early detection of a zero sized bitmap.
Under rare circumstances we may need to extract a surface that
represents a bitmap with width==0 and rows==0. Detect this case at the
start and simply return a zero-sized surface.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=12284.
(cherry picked from commit d62f886168)
2007-11-26 21:24:41 -08:00
Adrian Johnson
9b0a093547 Create meta-surface source image with same content type as the
meta-surface
(cherry picked from commit 1e21220f0e)
2007-11-26 21:24:41 -08:00
Adrian Johnson
fce1a3fdd4 Eliminate unclipped CLEAR from meta-surface playback
The optimization that avoids replaying commands prior to an unclipped
CLEAR operation now starts playback from the first command after the
CLEAR. This avoids the need to handle the unclipped CLEAR in the PDF
surface.
(cherry picked from commit 875e32178e)
2007-11-26 21:24:41 -08:00
Behdad Esfahbod
11d83334ce [configure.in] Fix non-pkgconfig Xrender detection path (#4724)
(cherry picked from commit b85032584b)
2007-11-26 21:24:40 -08:00
Adrian Johnson
c92dae4144 Fix PDF gradients bug
The PDF surface was adding extra stops at the 0.0 and 1.0 offset when
there was not already stops at these offsets. This has been replaced
with code to move the coordinates of the linear gradient line in to
the position of the first and last offset.
(cherry picked from commit 3216275fd9)
2007-11-26 21:24:40 -08:00
Vladimir Vukicevic
66add99fb6 [win32] call scaled_font_fini in create before returning NULL
(cherry picked from commit bdc70d1fc2)
2007-11-26 21:24:40 -08:00
Behdad Esfahbod
003dc9edab [configure.in] Make PS backend require zlib too (#12210)
The PS backend uses zlib these days.  Make it depend on zlib being available
like PDF has been doing.
(cherry picked from commit 114b07881e)
2007-11-26 21:24:40 -08:00
Vladimir Vukicevic
e544c75f6a Fix previous create_similar fallback patch
We can't use composite, as some backends don't implement it.
Use paint() instead.
(cherry picked from commit 93aee43690)
2007-11-26 21:24:39 -08:00
Vladimir Vukicevic
23278efcdb [win32] call free() and not scaled_font_destroy() if scaled init fails
If scaled_font_destroy() is called, a deadlock can result; there's no
reason to call destroy since the initialization failed (and, indeed,
it might not be valid to do so anyway).
(cherry picked from commit 6525d4debb)
2007-11-26 21:24:39 -08:00
Vladimir Vukicevic
1432c9232f Implement fallback for clone_similar
(cherry picked from commit 69dae7ee4a)
2007-11-26 21:24:39 -08:00
Vladimir Vukicevic
ce3744f796 [win32] check correct surface for BitBlt support in get_subimage
(cherry picked from commit f4a8633fce)
2007-11-26 21:24:39 -08:00
Carl Worth
c8aff910c4 Ensure the Render extension is initialized before calling XESetCloseDisplay
This avoids a potential crash from the Render extension being cleaned
up during XCloseDisplay before the cairo CloseDisplay hook goes on to
call into XRenderFreePicture.
(cherry picked from commit 9f4e643649)
2007-11-26 21:24:38 -08:00
Chris Wilson
578e38eaa7 [cairo-ft-font] Decrement lock count on error.
As noted in http://bugs.freedesktop.org/show_bug.cgi?id=12026 the error
path of _cairo_ft_unscaled_font_lock_face() failed to reset the
unscaled->lock_count before releasing the mutex and returning NULL.
(cherry picked from commit bc635da45a)
2007-11-26 21:24:38 -08:00
Adrian Johnson
849f402b85 PDF: Fix regression in pdf_surface_set_size()
(cherry picked from commit 8881265cca)
2007-11-26 21:24:38 -08:00
Carl Worth
afda117972 Ensure that a copied pattern gets its own user_data array
This fixes the bug reported here:

	Segfault with cairo_pattern_set_user_data
	https://bugs.freedesktop.org/show_bug.cgi?id=11855
(cherry picked from commit 13cae8b5e6)
2007-11-26 21:24:37 -08:00
Adrian Johnson
a76f8653d6 CFF Subsetting: fix integer encoding bug
Bug report at https://bugzilla.mozilla.org/show_bug.cgi?id=368668
(cherry picked from commit f52aa4c13e)
2007-11-21 10:43:34 -08:00
Chris Wilson
553d8a9319 [Makefile.am] Add missing headers and reference images.
Andrew Jorgensen spotted that make dist was missing a few headers needed
for compilation and running make distcheck had spurious failures. Add
the missing files to the distribution and a silly one-liner to check for
missing reference images.
(cherry picked from commit e5b01e6797)

[With some edits after cherry-picking to elide files that don't exist
in the 1.4 branch.]
2007-11-21 10:43:34 -08:00
Carl Worth
33b1e9ad8b Add missing definition of INT32_MAX
Some win32 builds were broken without this.
2007-11-21 10:43:21 -08:00
Vladimir Vukicevic
1786c05f6e [fix] Avoid int overflow when allocating large buffers
This patch introduces three macros: _cairo_malloc_ab,
_cairo_malloc_abc, _cairo_malloc_ab_plus_c and replaces various calls
to malloc(a*b), malloc(a*b*c), and malloc(a*b+c) with them.  The macros
return NULL if int overflow would occur during the allocation.  See
CODING_STYLE for more information.
(cherry picked from commit 5c7d2d14d7)
2007-11-20 19:43:11 -08:00
Carl Worth
cf0e1b8e89 Update version to 1.4.11 after the 1.4.10 release 2007-11-20 19:41:31 -08:00
Carl Worth
107a74885a Increment cairo version to 1.4.10 (and libtool versioning to 13:5:11) 2007-06-27 14:05:56 -07:00
Carl Worth
f595ad2348 Add notes to NEWS for 1.4.10 2007-06-27 14:04:27 -07:00
Carl Worth
2bf3e31da9 Prefer local dpy variable instead of display->display
This was a tiny piece of cleanup that had been erroneously included
with some earlier functional changes, (so it went through a cycle
of being applied and reverted). It's back now in its own commit.
2007-06-27 11:11:36 -07:00
Carl Worth
eebb0df512 Revert "[cairo-xlib-display] Hide XErrors during processing of the work queue."
This reverts commit 285b702ef6.

The recent commit of 0791f342b9 fixes
the same bug that 285b702e was fixing, but without introducing any
performance-killing calls to XSync. So we can drop those now.
2007-06-27 11:08:53 -07:00
Carl Worth
b019cb8a7a Revert "[cairo-xlib-surface] Check for errors before installing a NOOP error handler."
This reverts commit 7016614dd9.

We want to avoid any negative performance impacts due to extra calls
to XSync. The fact that X errors can be missed with this appraoch is
undesirable of course---a proper fix will likely involve moving to
XCB which will hopefully allow us to do the error-checking the way
we want without any performance penalty.
2007-06-27 11:07:07 -07:00
Carl Worth
6d021eb4b6 Merge branch 'ooo-fix' into cairo 2007-06-27 11:01:00 -07:00
Chris Wilson
0791f342b9 Avoid deferring resource cleanup for application drawables
This eliminates X errors propagated from cairo due to cleaning up
Render Pictures after the application had already destroyed the
Drawable they reference. (It would be nice if the X server wouldn't
complain that some cleanup work is already done, but there you
have it.)

This fix has been verified to fix the bug causing OpenOffice.org to
crash as described here:

	XError on right click menus in OOo.
	https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=243811

And unlike other proposed fixes for this bug, this fix does not
introduce any new calls to XSync, (and thereby avoids performance
concerns from those).
2007-06-27 10:53:29 -07:00
Chris Wilson
9109946a1a [cairo-directfb] Correct minor typo.
Correct the reference to _cairo_directfb_surface_is_similar.
2007-06-21 15:40:23 +01:00
Nis Martensen
1e76aa66b2 Update INSTALL about status of backends 2007-06-19 11:48:43 -07:00
Carl Worth
02f753c23a Fix cairo-perf-diff to compile cairo-perf explicitly 2007-06-18 18:24:09 -07:00
Vladimir Vukicevic
2477e57de5 [perf] Add pixman_region_init_rects and use in extract_region
Avoid O(N*N) loop in traps_extract_region by letting us hand pixman
an array of rects all at once.
2007-06-18 14:02:41 -07:00
Chris Wilson
285b702ef6 [cairo-xlib-display] Hide XErrors during processing of the work queue.
It is possible for the resources that we defer freeing to be already
destroyed and trigger an XError whilst processing the work queue. For
example, the application renders to a Window and then destroys the
Drawable before proceeding with more rendering. This will trigger an
invalid Picture from RenderFreePicture whilst attempting to free the
resources.

By ignoring the possibility that the application could allocate a fresh
resource with the same ID, we can simply hide the XErrors...

Fixes: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=243811
2007-06-15 21:16:49 +01:00
Chris Wilson
7016614dd9 [cairo-xlib-surface] Check for errors before installing a NOOP error handler.
Call XSync before ignoring errors from XGetImage to avoid hiding
unassociated errors. Similarly, call XSync before reinstalling the old
error handler to ensure no errors creep out of the ignored section.
2007-06-15 21:00:50 +01:00
Ryan Lortie
0c5d28a4e5 [xlib] Create source xrender Picture with IncludeInferiors
When an xlib surface is used as the source of a draw operation this
will cause the contents of child windows to be included in the source
data.  The semantics of drawing to xlib surfaces are unchanged (ie:
draws are still clipped by child windows overlapping the destination
window).
2007-06-13 18:59:22 -04:00
Brian Ewins
817d4b0c9a [atsui] Document ATSUI
Add cairo_atsui_font_face_create_for_atsu_font_id
and ATSUI to the documentation. Don't enable it yet,
since this is still unsupported.
2007-06-13 01:27:37 +01:00
Brian Ewins
fd1edaa5d3 [quartz] remove unused code
clean up warnings about unused code: removing 
_cairo_quartz_cairo_path_to_quartz_path and the functions
it calls.
2007-06-13 01:27:36 +01:00
Brian Ewins
d7a0816ec3 [quartz] move glyph array declarations
Move declarations causing a warning. A separate patch from
the other warning cleanups because it moves where the allocation
happens.
2007-06-13 01:27:36 +01:00
Brian Ewins
bf39b28b77 commit 75be87b4093aaa7f477d587d5a68308cade1b29c
[quartz] move glyph array declarations

    Move declarations causing a warning. A separate patch from
    the other warning cleanups because it moves where the allocation
    happens.
2007-06-13 01:27:36 +01:00
Brian Ewins
2034d1dbd5 [quartz] pass quartz_stroke_t not CGContextRef
Fix a typo where an incompatible pointer was being passed.
2007-06-13 01:27:36 +01:00
Behdad Esfahbod
54bbe44b08 [TODO] Add link to Adrian's finer-grain fallback thread 2007-06-11 17:51:37 -04:00
Vladimir Vukicevic
ef3c64fd13 [misc] Blow away last remaining $Id$ directives in sources 2007-06-11 09:27:11 -07:00