Commit b8f6633e authored by Carl Worth's avatar Carl Worth
Browse files

Remove pixman from LGPL_CHANGE_BEFORE

parents 1d28eecd b0a6de8f
cairo_clip is returning the wrong result in several cases. And when it
doesn't get the wrong result, it is horribly slow. This really needs
to be fixed.
cairo_clip is really slow, (with at least the Xlib and image
backends). An accelerated implementation of the IN operator would
probably help a lot here.
--
......@@ -17,6 +17,11 @@ following paper has the right answers:
Finite Precision Output, Computation Geometry Theory and
Applications, 13(4), 1999.
Recent improvements to make the intersection code more robust (using
128-bit arithmetic where needed), have exposed some of the weakness in
the current tessellation implementation. So, for now, filling some
polygons will cause "leaking" until we implement Hobby's algorithm.
--
Stroking a self-intersecting path generates the wrong answer, (in
......
2004-08-02 Carl Worth <cworth@isi.edu>
* BUGS: Note that cairo_clip is fixed now.
2004-08-01 Øyvind Kolås <oeyvindk@hig.no>
* src/cairo.h: replaced ct with cr in public headers to keep
usage consistent.
2004-07-24 Jamey Sharp <jamey@minilop.net>
* src/cairo_xcb_surface.c:
Updating for XCB API change around iterators.
2004-07-20 David Reveman <c99drn@cs.umu.se>
* src/cairo_gl_surface.c (_cairo_gl_surface_get_image): Use new
pixel buffer interface.
(_cairo_gl_surface_set_image): Use new pixel buffer interface.
(_cairo_gl_surface_set_filter): Don't use convolution filter for
gaussian filter type as we have no software fall-back.
(_cairo_gl_surface_create_pattern): Color ranges now need a surface
reference.
Added new CAIRO_GL_SURFACE_IS_DRAWABLE macro.
2004-07-16 David Reveman <c99drn@cs.umu.se>
* src/cairo_font.c (_cairo_font_copy): Fixed stupid typo.
Added decleration of _cairo_glyph_cache_destroy.
2004-07-15 David Reveman <c99drn@cs.umu.se>
* src/cairo_font.c (_cairo_font_copy): Destroy glyph cache
created by font backend.
2004-07-11 Carl Worth <cworth@isi.edu>
* src/cairo_gstate.c (_cairo_gstate_init_clip): Don't call
_cairo_surface_set_clip_region with a NULL surface.
2004-07-09 Carl Worth <cworth@isi.edu>
* src/cairo_gstate.c (_cairo_gstate_arc_dir): Fix numerical
problem that could lead to infinite loops.
2004-07-09 Dave Beckett <Dave.Beckett@bristol.ac.uk>
* autogen.sh: Require automake 1.7 (and thus aclocal 1.7) which
requires autoconf 2.54. Changed since newer libtools may fail to
work with older automake versions such as 1.4. I bet this will
annoy people with older tool chains :(
2004-07-05 Carl Worth <cworth@isi.edu>
* src/cairo.c (CAIRO_CHECK_SANITY): Remove errant semicolon from
macro definition.
2004-06-21 David Reveman <c99drn@cs.umu.se>
* configure.in: Require glitz >= 0.1.5.
* src/cairo_gstate.c (_cairo_gstate_clip_and_composite_trapezoids):
Use correct source offset when creating clip surface.
* src/cairo_gl_surface.c (_cairo_gl_surface_get_image): Use glitz's
new pixel interface.
(_cairo_gl_surface_set_image): Use glitz's new pixel interface.
(_cairo_gl_surface_create_similar): First try to create a drawable
surface and if that fails, create a read only surface.
(_cairo_gl_surface_create_similar): Glitz now handles inheritance of
anti-aliasing hints, so it can be removed from here.
(_cairo_gl_surface_create_pattern): Temporary fix for gradients.
2004-06-16 Keith Packard <keithp@keithp.com>
* src/cairo_xcb_surface.c: (bytes_per_line),
(_cairo_xcb_surface_set_image):
Fix image data length computation (XCB doesn't do this part).
2004-06-11 David Reveman <c99drn@cs.umu.se>
* configure.in: Require glitz 0.1.4.
* src/cairo_gl_surface.c: Added CAIRO_GL_SURFACE_MULTISAMPLE macro.
(_cairo_gl_extract_rectangle): Added _cairo_gl_extract_rectangle.
(_cairo_gl_surface_composite_trapezoids): Use fill_rectangles if
we can represent the traps as a rectangle. fill_trapezoids cannot be
used with software multi-sampling.
(CAIRO_GL_COMPOSITE_TRAPEZOIDS_SUPPORT): Glitz can no longer composite
trapezoids just by using offscreen drawing.
(_cairo_gl_surface_create_similar): Inherit anti-aliasing properties.
* src/cairo_gstate.c (_cairo_gstate_create_pattern): Get solid color
from color stop components.
* src/cairoint.h: Removed cairo color from color stop.
* src/cairo_pattern.c: Added MULTIPLY_COLORCOMP macro.
(cairo_pattern_add_color_stop): Do not pre-multiply stop color.
(_cairo_pattern_calc_color_at_pixel): Multiply with alpha.
2004-05-28 Carl Worth <cworth@isi.edu>
* These two fixes are from David Reveman <c99drn@cs.umu.se>:
* src/cairo_surface.c (_cairo_surface_create_similar_scratch)
(_cairo_surface_create_similar_solid): Move NULL test from
create_similar_scratch to create_similar_solid.
* src/cairo_font.c (_cairo_glyph_surface_init): Fix for when
surface->backend != image->backend, but the backend does use
images for similar surfaces.
2004-05-28 Keith Packard <keithp@keithp.com>
* configure.in:
* src/Makefile.am:
Add WARN_CFLAGS, autodetection for 64/128 bit ints and
cairo_wideint.[ch]
* src/cairo_gstate.c: (_cairo_gstate_show_glyphs):
Check status return from _cairo_gstate_glyph_extents
* src/cairo_pattern.c: (_cairo_image_data_set_radial),
(_cairo_pattern_get_image):
* src/cairo_png_surface.c: (_cairo_png_surface_copy_page):
* src/cairo_surface.c: (_cairo_surface_composite):
Quiet compiler warnings about uninitialized variables
* src/cairo_traps.c: (_det16_32), (_det32_64),
(_fixed_16_16_to_fixed_32_32), (_line_segs_intersect_ceil):
Switch to alternate exact line intersection code.
* src/cairo_wideint.c: (_cairo_uint64_divrem),
(_cairo_uint32_to_uint64), (_cairo_int32_to_int64),
(_cairo_uint32s_to_uint64), (_cairo_uint64_add),
(_cairo_uint64_sub), (_cairo_uint32x32_64_mul),
(_cairo_uint64_mul), (_cairo_uint64_lsl), (_cairo_uint64_rsl),
(_cairo_uint64_rsa), (_cairo_uint64_lt), (_cairo_uint64_eq),
(_cairo_int64_lt), (_cairo_uint64_not), (_cairo_uint64_negate),
(_cairo_leading_zeros32), (_cairo_uint64x32_normalized_divrem),
(_cairo_int64_divrem), (_cairo_uint128_divrem),
(_cairo_uint32_to_uint128), (_cairo_int32_to_int128),
(_cairo_uint64_to_uint128), (_cairo_int64_to_int128),
(_cairo_uint128_add), (_cairo_uint128_sub), (uint64_lo),
(uint64_hi), (uint64_shift32), (_cairo_uint64x64_128_mul),
(_cairo_uint128_mul), (_cairo_uint128_lsl), (_cairo_uint128_rsl),
(_cairo_uint128_rsa), (_cairo_uint128_lt), (_cairo_int128_lt),
(_cairo_uint128_eq), (_cairo_uint128x64_normalized_divrem),
(_cairo_leading_zeros64), (_cairo_int128_negate),
(_cairo_int128_not), (_cairo_int128_divrem):
* src/cairo_wideint.h:
Add 64/128-bit wide integer arithmetic.
* src/cairoint.h:
Switch to stdint.h types (and new wide types).
2004-05-24 David Reveman <c99drn@cs.umu.se>
* src/cairo.c (cairo_restore): Moved CAIRO_CHECK_SANITY below
declarations.
(cairo_current_font): Moved CAIRO_CHECK_SANITY below declarations.
* src/cairoint.h: Added cairo_glyph_size_t, cairo_glyph_surface_t,
cairo_glyph_surface_node_t and cairo_glyph_cache_t.
Added font backend functions text_bbox, glyph_bbox and create_glyph.
Added source offset parameter to show_text and show_glyphs.
Added drawable parameter to backend function create_similar.
cairo_font_t now contains a glyph_cache pointer.
Added _cairo_font_text_bbox, _cairo_font_glyph_bbox,
_cairo_font_lookup_glyph and _cairo_surface_create_similar_scratch.
* src/cairo_xlib_surface.c (_cairo_xlib_surface_create_similar):
(_cairo_xlib_surface_clone_similar):
Added drawable parameter to backend function create_similar.
* src/cairo_xcb_surface.c (_cairo_xcb_surface_create_similar):
(_cairo_xcb_surface_clone_similar):
Added drawable parameter to backend function create_similar.
* src/cairo_surface.c: Added _cairo_surface_create_similar_scratch.
Added drawable parameter to backend function create_similar.
* src/cairo_ps_surface.c (_cairo_ps_surface_create_similar):
Added drawable parameter to backend function create_similar.
* src/cairo_png_surface.c (_cairo_png_surface_create_similar):
Added drawable parameter to backend function create_similar.
* src/cairo_image_surface.c (_cairo_image_surface_create_similar):
Added drawable parameter to backend function create_similar.
* src/cairo_gstate.c (_cairo_gstate_show_text): Use new text
bounding box function. Pass pattern source offset to show_text.
(_cairo_gstate_show_glyphs): Use new text
bounding box function. Pass pattern source offset to show_glyps.
* src/cairo_gl_surface.c (_cairo_gl_surface_create_similar): Added
drawable parameter to backend function create_similar. Use glitz's
new create similar interface. Support for read-only surfaces.
(_cairo_gl_surface_clone_similar): Added drawable parameter to
backend function create_similar.
* src/cairo_ft_font.c: Use new glyph caching system. Added bounding box
font backend functions.
* src/cairo_font.c: Added glyph caching system. Added bounding box
font backend functions.
(_cairo_font_init): Create new glyph cache.
(_cairo_font_copy): Take a reference to other fonts glyph cache.
(_cairo_font_show_text):
(_cairo_font_show_glyphs): Handle source offset.
(cairo_font_destroy): Destroy glyph cache.
2004-05-20 Graydon Hoare <graydon@redhat.com>
* configure.in: Add sanity checking feature configury.
* src/cairo-features.h.in: Add sanity checking feature.
* src/cairo.c: Add sanity checking.
* src/cairoint.h: Add prototypes.
* src/cairo_fixed.c
(_cairo_fixed_is_integer):
(_cairo_fixed_integer_part): New functions.
* src/cairo_matrix.c
(_cairo_matrix_is_integer_translation): New function.
* src/cairo_gstate.c
(extract_transformed_rectangle): Use fixed functions.
(_cairo_gstate_clip): Arithmetic fixes.
(_cairo_gstate_clip_and_composite_trapezoids):
(_cairo_gstate_show_surface):
(_cairo_gstate_show_text):
(_cairo_gstate_show_glyphs): Corrections to clipping.
* src/cairo_xlib_surface.c
(_cairo_xlib_surface_composite): Add XCopyArea fast path.
(_cairo_xlib_surface_set_clip_region): Drive clip to drawable.
2004-05-17 Carl Worth <cworth@isi.edu>
* src/cairo.c (cairo_show_text): Do nothing when passed a NULL
string.
2004-05-11 Øyvind Kolås <oeyvindk@hig.no>
* src/cairoint.h : changed CAIRO_FILTER_DEFAULT to CAIRO_FILTER_BEST
to make gradients easier.
2004-05-11 David Reveman <c99drn@cs.umu.se>
* src/cairo_pattern.c (_cairo_pattern_get_image): Removed
pattern_offset.
* src/cairo_surface.c (_cairo_surface_create_pattern): Removed
pattern_offset.
* src/cairo_gstate.c: Removed pattern_offset.
* src/cairoint.h: Removed pattern_offset.
2004-05-11 Carl Worth <cworth@isi.edu>
* configure.in: Increment CAIRO_VERSION to 0.1.23.
......
Glyph caching
-------------
Internal caching of glyphs provides a major improvement to
text rendering performance, especially for Xlib and OpenGL
backends.
Snapshot 0.1.23 (2004-05-11 Carl Worth <cworth@isi.edu>)
========================================================
Fixes for gcc 3.4
......
......@@ -3,6 +3,8 @@
set -e
PACKAGE=cairo
LIBTOOLIZE=${LIBTOOLIZE-libtoolize}
LIBTOOLIZE_FLAGS="--copy --force"
ACLOCAL=${ACLOCAL-aclocal}
......@@ -11,8 +13,82 @@ AUTOMAKE=${AUTOMAKE-automake}
AUTOMAKE_FLAGS="--add-missing"
AUTOCONF=${AUTOCONF-autoconf}
# automake 1.8 requires autoconf 2.58
# automake 1.7 requires autoconf 2.54
automake_min_vers=1.7
aclocal_min_vers=$automake_min_vers
autoconf_min_vers=2.54
libtoolize_min_vers=1.4
ARGV0=$0
if ($AUTOCONF --version) < /dev/null > /dev/null 2>&1 ; then
if ($AUTOCONF --version | head -1 | awk 'NR==1 { if( $(NF) >= '$autoconf_min_vers') \
exit 1; exit 0; }');
then
echo "$ARGV0: ERROR: \`$AUTOCONF' is too old."
$AUTOCONF --version
echo " (version $autoconf_min_vers or newer is required)"
DIE="yes"
fi
else
echo $AUTOCONF: command not found
echo
echo "$ARGV0: ERROR: You must have \`autoconf' installed to compile $PACKAGE."
echo " (version $autoconf_min_vers or newer is required)"
DIE="yes"
fi
if ($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 ; then
if ($AUTOMAKE --version | head -1 | awk 'NR==1 { if( $(NF) >= '$automake_min_vers') \
exit 1; exit 0; }');
then
echo "$ARGV0: ERROR: \`$AUTOMAKE' is too old."
$AUTOMAKE --version
echo " (version $automake_min_vers or newer is required)"
DIE="yes"
fi
if ($ACLOCAL --version) < /dev/null > /dev/null 2>&1; then
if ($ACLOCAL --version | head -1 | awk 'NR==1 { if( $(NF) >= '$aclocal_min_vers' ) \
exit 1; exit 0; }' );
then
echo "$ARGV0: ERROR: \`$ACLOCAL' is too old."
$ACLOCAL --version
echo " (version $aclocal_min_vers or newer is required)"
DIE="yes"
fi
else
echo $ACLOCAL: command not found
echo
echo "$ARGV0: ERROR: Missing \`$ACLOCAL'"
echo " The version of $AUTOMAKE installed doesn't appear recent enough."
DIE="yes"
fi
else
echo $AUTOMAKE: command not found
echo
echo "$ARGV0: ERROR: You must have \`automake' installed to compile $PACKAGE."
echo " (version $automake_min_vers or newer is required)"
DIE="yes"
fi
if ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 ; then
if ($LIBTOOLIZE --version | awk 'NR==1 { if( $4 >= '$libtoolize_min_vers') \
exit 1; exit 0; }');
then
echo "$ARGV0: ERROR: \`$LIBTOOLIZE' is too old."
echo " (version $libtoolize_min_vers or newer is required)"
DIE="yes"
fi
else
echo $LIBTOOLIZE: command not found
echo
echo "$ARGV0: ERROR: You must have \`libtoolize' installed to compile $PACKAGE."
echo " (version $libtoolize_min_vers or newer is required)"
DIE="yes"
fi
if test -z "$ACLOCAL_FLAGS"; then
acdir=`aclocal --print-ac-dir`
if [ ! -f $acdir/pkg.m4 ]; then
......@@ -24,10 +100,15 @@ if test -z "$ACLOCAL_FLAGS"; then
echo ""
echo "pkg-config is available from:"
echo "http://www.freedesktop.org/software/pkgconfig/"
exit 1
DIE=yes
fi
fi
if test "X$DIE" != X; then
exit 1
fi
if test -z "$*"; then
echo "$ARGV0: Note: \`./configure' will be run with no arguments."
echo " If you wish to pass any to it, please specify them on the"
......
......@@ -141,7 +141,7 @@ AC_ARG_ENABLE(gl,
[use_gl=$enableval], [use_gl=yes])
if test "x$use_gl" = "xyes"; then
PKG_CHECK_MODULES(GL, glitz >= 0.1.2, [
PKG_CHECK_MODULES(GL, glitz >= 0.1.5, [
GL_REQUIRES=glitz
use_gl=yes], [use_gl="no (requires glitz http://freedesktop.org/software/glitz)"])
fi
......@@ -161,6 +161,20 @@ AC_SUBST(GL_REQUIRES)
dnl ===========================================================================
AC_ARG_ENABLE(sanity-checking,
[ --disable-sanity Disable cairo's sanity checking routines],
[check_sanity=$enableval], [check_sanity=yes])
if test "x$check_sanity" != "xyes"; then
SANITY_CHECKING_FEATURE=CAIRO_NO_SANITY_CHECKING
else
SANITY_CHECKING_FEATURE=CAIRO_DO_SANITY_CHECKING
fi
AC_SUBST(SANITY_CHECKING_FEATURE)
dnl ===========================================================================
PKG_CHECK_MODULES(FONTCONFIG, fontconfig)
PKG_CHECK_MODULES(CAIRO, libpixman >= 0.1.1)
......@@ -213,6 +227,22 @@ AC_SUBST(CAIRO_LIBS)
dnl ===========================================================================
dnl Checks for precise integer types
AC_CHECK_TYPES([uint64_t, uint128_t])
dnl Use lots of warning flags with GCC
WARN_CFLAGS=""
if test "x$GCC" = "xyes"; then
WARN_CFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes \
-Wmissing-prototypes -Wmissing-declarations \
-Wnested-externs -fno-strict-aliasing"
fi
AC_SUBST(WARN_CFLAGS)
dnl ===========================================================================
AC_OUTPUT([
cairo.pc
Makefile
......
......@@ -50,6 +50,8 @@ libcairo_la_SOURCES = \
cairo_surface.c \
cairo_traps.c \
cairo_pattern.c \
cairo_wideint.c \
cairo_wideint.h \
$(libcairo_ps_sources) \
$(libcairo_png_sources) \
$(libcairo_xlib_sources)\
......@@ -59,6 +61,6 @@ libcairo_la_SOURCES = \
libcairo_la_LDFLAGS = -version-info @VERSION_INFO@ -no-undefined
INCLUDES = -I$(srcdir) $(CAIRO_CFLAGS) $(FONTCONFIG_CFLAGS) $(XRENDER_CFLAGS) $(XCB_CFLAGS) $(PNG_CFLAGS) $(GL_CFLAGS)
INCLUDES = -I$(srcdir) $(WARN_CFLAGS) $(CAIRO_CFLAGS) $(FONTCONFIG_CFLAGS) $(XRENDER_CFLAGS) $(XCB_CFLAGS) $(PNG_CFLAGS) $(GL_CFLAGS)
libcairo_la_LIBADD = $(CAIRO_LIBS) $(FONTCONFIG_LIBS) $(XRENDER_LIBS) $(XCB_LIBS) $(PS_LIBS) $(PNG_LIBS) $(GL_LIBS) -lm
......@@ -38,4 +38,6 @@
#define @GL_SURFACE_FEATURE@
#define @SANITY_CHECKING_FEATURE@
#endif
......@@ -51,3 +51,14 @@ _cairo_fixed_to_double (cairo_fixed_t f)
return ((double) f) / 65536.0;
}
int
_cairo_fixed_is_integer (cairo_fixed_t f)
{
return (f & 0xFFFF) == 0;
}
int
_cairo_fixed_integer_part (cairo_fixed_t f)
{
return f >> 16;
}
......@@ -27,6 +27,15 @@
#include "cairoint.h"
static cairo_glyph_cache_t *
_cairo_glyph_cache_create (void);
static void
_cairo_glyph_cache_destroy (cairo_glyph_cache_t *glyph_cache);
static void
_cairo_glyph_cache_reference (cairo_glyph_cache_t *glyph_cache);
cairo_font_t *
_cairo_font_create (const char *family,
cairo_font_slant_t slant,
......@@ -50,6 +59,9 @@ _cairo_font_init (cairo_font_t *font,
cairo_matrix_set_identity (&font->matrix);
font->refcount = 1;
font->backend = backend;
font->glyph_cache = _cairo_glyph_cache_create ();
if (font->glyph_cache == NULL)
return CAIRO_STATUS_NO_MEMORY;
return CAIRO_STATUS_SUCCESS;
}
......@@ -72,6 +84,13 @@ _cairo_font_copy (cairo_font_t *font)
newfont->refcount = 1;
cairo_matrix_copy(&newfont->matrix, &font->matrix);
newfont->backend = font->backend;
if (newfont->glyph_cache)
_cairo_glyph_cache_destroy (newfont->glyph_cache);
newfont->glyph_cache = font->glyph_cache;
_cairo_glyph_cache_reference (font->glyph_cache);
return newfont;
}
......@@ -105,18 +124,40 @@ _cairo_font_glyph_extents (cairo_font_t *font,
return font->backend->glyph_extents(font, glyphs, num_glyphs, extents);
}
cairo_status_t
_cairo_font_text_bbox (cairo_font_t *font,
cairo_surface_t *surface,
double x,
double y,
const unsigned char *utf8,
cairo_box_t *bbox)
{
return font->backend->text_bbox (font, surface, x, y, utf8, bbox);
}
cairo_status_t
_cairo_font_glyph_bbox (cairo_font_t *font,
cairo_surface_t *surface,
cairo_glyph_t *glyphs,
int num_glyphs,
cairo_box_t *bbox)
{
return font->backend->glyph_bbox (font, surface, glyphs, num_glyphs, bbox);
}
cairo_status_t
_cairo_font_show_text (cairo_font_t *font,
cairo_operator_t operator,
cairo_surface_t *source,
cairo_surface_t *surface,
int source_x,
int source_y,
double x,
double y,
const unsigned char *utf8)
{
return font->backend->show_text(font, operator, source,
surface, x, y, utf8);
surface, source_x, source_y, x, y, utf8);
}
cairo_status_t
......@@ -124,11 +165,14 @@ _cairo_font_show_glyphs (cairo_font_t *font,
cairo_operator_t operator,
cairo_surface_t *source,
cairo_surface_t *surface,
int source_x,
int source_y,
cairo_glyph_t *glyphs,
int num_glyphs)
{
return font->backend->show_glyphs(font, operator, source,
surface, glyphs, num_glyphs);
surface, source_x, source_y,
glyphs, num_glyphs);
}
cairo_status_t
......@@ -157,6 +201,183 @@ _cairo_font_font_extents (cairo_font_t *font,
return font->backend->font_extents(font, extents);
}
static void
_cairo_glyph_cache_pop_last (cairo_glyph_cache_t *glyph_cache)
{
if (glyph_cache->last) {
cairo_glyph_surface_node_t *remove = glyph_cache->last;
cairo_surface_destroy (remove->s.surface);
glyph_cache->last = remove->prev;
if (glyph_cache->last)
glyph_cache->last->next = NULL;
free (remove);
glyph_cache->n_nodes--;
}
}
static cairo_glyph_cache_t *
_cairo_glyph_cache_create (void)
{
cairo_glyph_cache_t *glyph_cache;
glyph_cache = malloc (sizeof (cairo_glyph_cache_t));
if (glyph_cache == NULL)
return NULL;
glyph_cache->n_nodes = 0;
glyph_cache->first = NULL;
glyph_cache->last = NULL;
glyph_cache->cache_size = CAIRO_FONT_CACHE_SIZE_DEFAULT;
glyph_cache->ref_count = 1;
return glyph_cache;
}
static void
_cairo_glyph_cache_reference (cairo_glyph_cache_t *glyph_cache)
{
if (glyph_cache == NULL)
return;
glyph_cache->ref_count++;
}
static void
_cairo_glyph_cache_destroy (cairo_glyph_cache_t *glyph_cache)
{
if (glyph_cache == NULL)