Commit 1d28eecd authored by Carl Worth's avatar Carl Worth
Browse files

Remove pixman from SNAPSHOT_0_1_23

parents 7146e2fc 2f7b4a3a
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.
--
Splines are not dashed.
--
......@@ -57,5 +63,16 @@ Caps are added only to the last subpath in a complex path.
--
ref_counts will go negative if destroy is called with ref_count ==
0. We noticed this is cairo_surface.c but it likely happens in several
0. We noticed this in cairo_surface.c but it likely happens in several
places.
--
Patterns are broken in various ways. The SVG test case demonstrates
some regressions, so something has changed in cairo. Also,
transformation plus repeat doesn't work in either Xrender or
libpixman, (nor in glitz?).
--
font-size="0" in an SVG file does very bad things.
2004-05-11 Carl Worth <cworth@isi.edu>
* configure.in: Increment CAIRO_VERSION to 0.1.23.
* NEWS: Added notes for snapshot 0.1.23.
* RELEASING: Add reminder to mention incompatible API changes in
NEWS. Re-order steps to avoid clobbering pre-existing tar
files.
2004-05-11 Carl Worth <cworth@isi.edu>
* BUGS: Several people have reported that cairo_clip is not
working right now. And it's always been slow.
2004-05-11 David Reveman <c99drn@cs.umu.se>
* configure.in: Require glitz 0.1.2.
* src/cairo_gl_surface.c: Added opacity attribute. Fixed broken
CAIRO_GL_COMPOSITE_TRAPEZOIDS_SUPPORT macro.
(_cairo_gl_surface_composite_trapezoids): Use polygon opacity.
(_cairo_gl_surface_create_pattern): Added surface pattern support.
(_cairo_gl_surface_create): Initialize opacity to 0xffff.
2004-05-07 Carl Worth <cworth@isi.edu>
* src/cairo_ft_font.c (_utf8_to_ucs4): Bail on NULL utf8 string.
* src/cairo_spline.c (_cairo_spline_add_point): Don't add two
consecutive, identical points when decomposing the spline, (which
was leading to an infinte loop in the stroke algorithm when it
found a slope of (0,0)).
2004-05-04 Carl Worth <cworth@isi.edu>
* src/cairo_png_surface.c (cairo_png_surface_create): Move all
libpng-related code into copy_page.
(unpremultiply_data): Add missing unpremultiply step.
(_cairo_png_surface_copy_page): Move PNG output to copy_page. Add
support for A8 and A1 images. Remove time from header (we may want
to add it again later, but for now it messes up my test suite).
(_cairo_png_surface_destroy): Call copy_page if it hasn't been
called already.
(_cairo_png_surface_show_page): Add implementation.
(_cairo_png_surface_copy_page): Don't close a file we didn't open.
2004-05-04 David Reveman <c99drn@cs.umu.se>
* src/cairo_pattern.c (_cairo_image_data_set_radial): Corrected some
confusing comments about the math used for radial gradients.
2004-05-01 David Reveman <c99drn@cs.umu.se>
* src/cairo_gl_surface.c (_cairo_gl_surface_create_pattern):
cairo_surface_t pointer to cairo_surface_set_matrix.
2004-04-29 Carl Worth <cworth@isi.edu>
* src/cairo_gstate.c (_cairo_gstate_set_pattern): Don't set
pattern_offset by the current point. Perhaps we can eliminate
pattern_offset altogether now?
2004-04-30 David Reveman <c99drn@cs.umu.se>
* src/cairoint.h: Radial patterns only store radius per circle.
Only inverse CTM to _cairo_pattern_transform.
* src/cairo_pattern.c (cairo_pattern_create_radial): Only one radius
per circle now.
(_cairo_pattern_transform): A matrix multiplication with inverse CTM
is all that's needed here.
(_cairo_pattern_calc_color_at_pixel): Fixed extend type reflect.
(_cairo_image_data_set_linear): New linear gradient code.
Transformation of linear gradient is now handled correctly.
(_cairo_image_data_set_radial): New radial gradient code. Inner circle
is now used for creating radial gradients. Transformation of radial
gradient is now handled correctly.
(_cairo_pattern_get_image): Fixed handling of pattern offset.
* src/cairo_gstate.c (_cairo_gstate_create_pattern): All pattern types
are transformed using inverse CTM.
* src/cairo_gl_surface.c (_cairo_gl_surface_create_pattern): Updated
to use glitz's new linear and radial gradients.
* configure.in: Require glitz 0.1.1.
2004-04-28 David Reveman <c99drn@cs.umu.se>
* src/cairo_gl_surface.c: Added CAIRO_GL_MULTITEXTURE_SUPPORT and
CAIRO_GL_SURFACE_IS_SOLID macros.
(_cairo_gl_surface_get_image): Simpler way for calculating rowstride.
(_cairo_gl_surface_composite): Support compositing with mask surface
when mask is solid or multi-texturing is available.
2004-04-25 David Reveman <c99drn@cs.umu.se>
* src/cairo_gl_surface.c (_cairo_gl_surface_set_clip_region):
Fixed conversion of pixman_box16_t to glitz_rectangle_t.
* src/cairoint.h: Added scale factor value to cairo_color_stop_t.
Added cairo_shader_function_t and cairo_shader_op_t.
* src/cairo_surface.c (_cairo_surface_create_pattern):
Fixed point updates.
* src/cairo_pattern.c (cairo_pattern_create_radial): Use absolute value
of radius parameters.
(cairo_pattern_add_color_stop): Precalculate scale factors and convert
offset to fixed point value.
(_cairo_image_data_set_radial):
(_cairo_image_data_set_linear): Initialize and use shading operator.
(_cairo_pattern_get_image): Fixed point updates.
(_cairo_pattern_shader_nearest):
(_cairo_pattern_shader_linear):
(_cairo_pattern_shader_gaussian):
(_cairo_pattern_calc_color_at_pixel):
Converted shading routines to use fixed point values and introduced
a shading operator structure for more efficient shading calculations.
Added _cairo_pattern_shader_init function.
* src/cairo_gl_surface.c (_cairo_gl_surface_composite):
(_cairo_gl_surface_fill_rectangles):
(_cairo_gl_surface_composite_trapezoids):
Make sure that target surface is OK.
(_cairo_gl_create_color_range): Initialize and use shading operator.
(_cairo_gl_surface_create_pattern):
(_cairo_gl_surface_set_clip_region): Fixed point updates.
2004-04-23 Carl Worth <cworth@isi.edu>
* src/cairoint.h:
* src/cairo_surface.c (_cairo_surface_composite):
* src/cairo_gstate.c (_cairo_gstate_current_fill_rule): Fixed
several function prototype mismatches between internal header file
and implementation (thanks to Carlos Romero and gcc-3.4).
2004-04-22 David Reveman <c99drn@cs.umu.se>
* src/cairoint.h:
* src/cairo_surface.c (_cairo_surface_create_pattern):
* src/cairo_pattern.c (_cairo_pattern_set_source_offset)
(_cairo_pattern_get_image):
* src/cairo_gstate.c (_cairo_gstate_create_pattern):
* src/cairo_gl_surface.c (_cairo_gl_surface_create_pattern): Fixed
pattern source offset.
2004-04-20 David Reveman <c99drn@cs.umu.se>
* src/cairo_pattern.c (_cairo_image_data_set_linear): Use
CAIRO_MAXSHORT instead of INT_MAX.
* src/cairo_traps.c (_cairo_traps_extents): Use CAIRO_MAXSHORT and
CAIRO_MINSHORT instead of SHRT_MAX and SHRT_MIN.
* src/cairoint.h: including limits.h and defining CAIRO_MAXSHORT and
CAIRO_MINSHORT.
2004-04-16 Carl Worth <cworth@isi.edu>
* NEWS: Added notes for snapshot 0.1.22.
......
Snapshot 0.1.23 (2004-05-11 Carl Worth <cworth@isi.edu>)
========================================================
Fixes for gcc 3.4
-----------------
Fix prototype mismatches so that cairo can be built by gcc 3.4.
Updates to track glitz
----------------------
Various fixes to support the latest glitz snapshot (0.1.2).
Gradient updates
----------------
Radial gradients now support both inner and outer circles.
Transformed linear gradients are now properly handled.
Fixes for extend type reflect.
Glitz updates
-------------
Converted shading routines to use fixed point values and introduced a
shading operator structure for more efficient shading calculations.
Support compositing with mask surface when mask is solid or
multi-texturing is available.
PNG backend cleanups
--------------------
Fix output to properly compensate for pre-multiplied alpha format in cairo.
Add support for A8 and A1 image formats.
Bug fixes
---------
Avoid crash or infinite loop on null strings and degeneratively short
splines.
New? bugs in cairo_clip
-----------------------
There are some fairly serious bugs in cairo_clip. It is sometimes
causing an incorrect result. And even when it does work, it is
sometimes so slow as to be unusable. Some of these bugs may not be
new, (indeed cairo_clip has only ever had a braindead-slow
implementation), but I think they're worth mentioning here.
Snapshot 0.1.22 (2004-04-16 Carl Worth <cworth@isi.edu>)
========================================================
Cairo was updated to track the changes in libpixman, and now depends
......
......@@ -13,7 +13,15 @@ snapshots.
version numbers in order to get access to a specific set of
features.
2) Verify that the code passes "make distcheck"
2) Increment CAIRO_VERSION in configure.in
Right now, in its pre-release form, we are incrementing
CAIRO_VERSION for each snapshot but we are not changing the
libtool shared library version information. Until now, we've
only incremented the sub-minor version. We'll invent rules for
incrementing major and minor numbers when the time is right.
3) Verify that the code passes "make distcheck"
Running "make distcheck" should result in no warnings or
errors and end with a message of the form:
......@@ -25,19 +33,13 @@ snapshots.
(But the tar file isn't actually ready yet, as we still have
some more steps to follow).
3) Fill out an entry in the NEWS file
4) Fill out an entry in the NEWS file
Sift through the information in ChangeLog since the last
snapshot. Summarize major changes briefly in a style similar
to other entries in NEWS.
4) Increment CAIRO_VERSION in configure.in
Right now, in its pre-release form, we are incrementing
CAIRO_VERSION for each snapshot but we are not changing the
libtool shared library version information. Until now, we've
only incremented the sub-minor version. We'll invent rules for
incrementing major and minor numbers when the time is right.
to other entries in NEWS. Take special care to note any
incompatible changes in the API. These should be easy to find
by looking for cairo.h in the ChangeLog.
5) Commit the changes to NEWS and configure.in
......@@ -45,8 +47,8 @@ snapshots.
other commit. It's especially important to mention the new
version number in the ChangeLog.
6) Run "make distcheck" to generate the final tar file with the
correct version number.
6) Run "make distcheck" to generate the final tar file including the
changes to NEWS and ChangeLog.
7) Copy the resulting tar file to the cairo snapshots distribution
directory:
......
......@@ -13,6 +13,9 @@ problems with stroking self-intersecting paths.
* Implement cairo_stroke_path, (very easy to do after the above change
is done).
* Re-work the backend clipping interface to use geometry rather than
images.
* Fix the intersection problem, (see reference to Hobby's paper
mentioned in cairo_traps.c).
......@@ -57,8 +60,8 @@ functions:
* Re-implement the trapezoid rasterization algorithm according to the
new "specification".
* Stroking degenerate paths should still draw caps. Round caps are
easy; square should probably draw an axis aligned square.
* Stroking closed, degenerate paths should still draw caps. Round
caps are easy; square should probably draw an axis aligned square.
* Verification, profiling, optimization.
......
......@@ -3,7 +3,7 @@ AC_INIT(src/cairo.h)
dnl ===========================================================================
# Package version number, (as distinct from shared library version)
CAIRO_VERSION=0.1.22
CAIRO_VERSION=0.1.23
# libtool shared library version
......@@ -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.0, [
PKG_CHECK_MODULES(GL, glitz >= 0.1.2, [
GL_REQUIRES=glitz
use_gl=yes], [use_gl="no (requires glitz http://freedesktop.org/software/glitz)"])
fi
......
......@@ -241,7 +241,7 @@ _utf8_to_ucs4 (char const *utf8,
size_t n = 0, alloc = 0;
FcChar32 u = 0;
if (ucs4 == NULL || nchars == NULL)
if (utf8 == NULL || ucs4 == NULL || nchars == NULL)
return;
len = strlen (utf8);
......
......@@ -363,10 +363,6 @@ _cairo_gstate_set_pattern (cairo_gstate_t *gstate, cairo_pattern_t *pattern)
gstate->pattern = pattern;
cairo_pattern_reference (pattern);
_cairo_gstate_current_point (gstate,
&gstate->pattern_offset.x,
&gstate->pattern_offset.y);
return CAIRO_STATUS_SUCCESS;
}
......@@ -452,7 +448,7 @@ _cairo_gstate_set_fill_rule (cairo_gstate_t *gstate, cairo_fill_rule_t fill_rule
return CAIRO_STATUS_SUCCESS;
}
cairo_status_t
cairo_fill_rule_t
_cairo_gstate_current_fill_rule (cairo_gstate_t *gstate)
{
return gstate->fill_rule;
......@@ -1278,7 +1274,11 @@ _cairo_gstate_create_pattern (cairo_gstate_t *gstate,
}
_cairo_pattern_set_alpha (pattern, gstate->alpha);
_cairo_pattern_transform (pattern, &gstate->ctm, &gstate->ctm_inverse);
_cairo_pattern_transform (pattern, &gstate->ctm_inverse);
_cairo_pattern_set_source_offset (pattern,
gstate->pattern_offset.x,
gstate->pattern_offset.y);
status = _cairo_surface_create_pattern (gstate->surface, pattern, extents);
if (status) {
......@@ -1288,10 +1288,6 @@ _cairo_gstate_create_pattern (cairo_gstate_t *gstate,
if (pattern->type == CAIRO_PATTERN_SURFACE)
_cairo_pattern_prepare_surface (pattern);
_cairo_pattern_add_source_offset (pattern,
gstate->pattern_offset.x,
gstate->pattern_offset.y);
return CAIRO_STATUS_SUCCESS;
}
......
......@@ -175,12 +175,10 @@ cairo_pattern_create_radial (double cx0, double cy0, double radius0,
pattern->type = CAIRO_PATTERN_RADIAL;
pattern->u.radial.center0.x = cx0;
pattern->u.radial.center0.y = cy0;
pattern->u.radial.radius0.dx = radius0;
pattern->u.radial.radius0.dy = radius0;
pattern->u.radial.radius0 = fabs (radius0);
pattern->u.radial.center1.x = cx1;
pattern->u.radial.center1.y = cy1;
pattern->u.radial.radius1.dx = radius1;
pattern->u.radial.radius1.dy = radius1;
pattern->u.radial.radius1 = fabs (radius1);
return pattern;
}
......@@ -229,6 +227,7 @@ cairo_pattern_add_color_stop (cairo_pattern_t *pattern,
double alpha)
{
cairo_color_stop_t *stop;
int i;
_cairo_restrict_value (&offset, 0.0, 1.0);
_cairo_restrict_value (&red, 0.0, 1.0);
......@@ -246,7 +245,7 @@ cairo_pattern_add_color_stop (cairo_pattern_t *pattern,
stop = &pattern->stops[pattern->n_stops - 1];
stop->offset = offset;
stop->offset = _cairo_fixed_from_double (offset);
stop->id = pattern->n_stops;
_cairo_color_init (&stop->color);
_cairo_color_set_rgb (&stop->color, red, green, blue);
......@@ -260,6 +259,13 @@ cairo_pattern_add_color_stop (cairo_pattern_t *pattern,
qsort (pattern->stops, pattern->n_stops, sizeof (cairo_color_stop_t),
_cairo_pattern_stop_compare);
for (i = 0; i < pattern->n_stops - 1; i++) {
pattern->stops[i + 1].scale =
pattern->stops[i + 1].offset - pattern->stops[i].offset;
if (pattern->stops[i + 1].scale == 65536)
pattern->stops[i + 1].scale = 0;
}
return CAIRO_STATUS_SUCCESS;
}
......@@ -336,54 +342,18 @@ _cairo_pattern_set_alpha (cairo_pattern_t *pattern, double alpha)
}
void
_cairo_pattern_add_source_offset (cairo_pattern_t *pattern,
_cairo_pattern_set_source_offset (cairo_pattern_t *pattern,
double x, double y)
{
pattern->source_offset.x += x;
pattern->source_offset.y += y;
pattern->source_offset.x = x;
pattern->source_offset.y = y;
}
void
_cairo_pattern_transform (cairo_pattern_t *pattern,
cairo_matrix_t *ctm,
cairo_matrix_t *ctm_inverse)
{
cairo_matrix_t matrix;
switch (pattern->type) {
case CAIRO_PATTERN_SURFACE:
/* hmm, maybe we should instead multiply with the inverse of the
pattern matrix here? */
cairo_matrix_multiply (&pattern->matrix, ctm_inverse,
&pattern->matrix);
break;
case CAIRO_PATTERN_LINEAR:
cairo_matrix_multiply (&matrix, &pattern->matrix, ctm);
cairo_matrix_transform_point (&matrix,
&pattern->u.linear.point0.x,
&pattern->u.linear.point0.y);
cairo_matrix_transform_point (&matrix,
&pattern->u.linear.point1.x,
&pattern->u.linear.point1.y);
break;
case CAIRO_PATTERN_RADIAL:
cairo_matrix_multiply (&matrix, &pattern->matrix, ctm);
cairo_matrix_transform_point (&matrix,
&pattern->u.radial.center0.x,
&pattern->u.radial.center0.y);
cairo_matrix_transform_distance (&matrix,
&pattern->u.radial.radius0.dx,
&pattern->u.radial.radius0.dy);
cairo_matrix_transform_point (&matrix,
&pattern->u.radial.center1.x,
&pattern->u.radial.center1.y);
cairo_matrix_transform_distance (&matrix,
&pattern->u.radial.radius1.dx,
&pattern->u.radial.radius1.dy);
break;
case CAIRO_PATTERN_SOLID:
break;
}
cairo_matrix_multiply (&pattern->matrix, ctm_inverse, &pattern->matrix);
}
void
......@@ -419,135 +389,127 @@ _cairo_pattern_prepare_surface (cairo_pattern_t *pattern)
cairo_surface_set_filter (pattern->source, pattern->filter);
}
typedef void (*cairo_shader_function_t) (unsigned char *color0,
unsigned char *color1,
double factor,
unsigned char *result_color);
#define INTERPOLATE_COLOR_NEAREST(c1, c2, factor) \
((unsigned char) ((factor < 0.5)? c1: c2))
((factor < 32768)? c1: c2)
static void
_cairo_pattern_shader_nearest (unsigned char *color0,
unsigned char *color1,
double factor,
unsigned char *result_color)
cairo_fixed_t factor,
int *pixel)
{
result_color[0] = INTERPOLATE_COLOR_NEAREST (color0[0], color1[0], factor);
result_color[1] = INTERPOLATE_COLOR_NEAREST (color0[1], color1[1], factor);
result_color[2] = INTERPOLATE_COLOR_NEAREST (color0[2], color1[2], factor);
result_color[3] = INTERPOLATE_COLOR_NEAREST (color0[3], color1[3], factor);
*pixel =
((INTERPOLATE_COLOR_NEAREST (color0[3], color1[3], factor) << 24) |
(INTERPOLATE_COLOR_NEAREST (color0[0], color1[0], factor) << 16) |
(INTERPOLATE_COLOR_NEAREST (color0[1], color1[1], factor) << 8) |
(INTERPOLATE_COLOR_NEAREST (color0[2], color1[2], factor) << 0));
}
#undef INTERPOLATE_COLOR_NEAREST
#define INTERPOLATE_COLOR_LINEAR(c1, c2, factor) \
((unsigned char) ((c2 * factor) + (c1 * (1.0 - factor))))
(((c2 * factor) + (c1 * (65536 - factor))) / 65536)
static void
_cairo_pattern_shader_linear (unsigned char *color0,
unsigned char *color1,
double factor,
unsigned char *result_color)
cairo_fixed_t factor,
int *pixel)
{
result_color[0] = INTERPOLATE_COLOR_LINEAR (color0[0], color1[0], factor);
result_color[1] = INTERPOLATE_COLOR_LINEAR (color0[1], color1[1], factor);
result_color[2] = INTERPOLATE_COLOR_LINEAR (color0[2], color1[2], factor);
result_color[3] = INTERPOLATE_COLOR_LINEAR (color0[3], color1[3], factor);
*pixel = ((INTERPOLATE_COLOR_LINEAR (color0[3], color1[3], factor) << 24) |
(INTERPOLATE_COLOR_LINEAR (color0[0], color1[0], factor) << 16) |
(INTERPOLATE_COLOR_LINEAR (color0[1], color1[1], factor) << 8) |
(INTERPOLATE_COLOR_LINEAR (color0[2], color1[2], factor) << 0));
}
#define E_MINUS_ONE 1.7182818284590452354
static void
_cairo_pattern_shader_gaussian (unsigned char *color0,
unsigned char *color1,
double factor,
unsigned char *result_color)
cairo_fixed_t factor,
int *pixel)
{
factor = (exp (factor * factor) - 1.0) / (M_E - 1.0);
double f = ((double) factor) / 65536.0;
result_color[0] = INTERPOLATE_COLOR_LINEAR (color0[0], color1[0], factor);
result_color[1] = INTERPOLATE_COLOR_LINEAR (color0[1], color1[1], factor);
result_color[2] = INTERPOLATE_COLOR_LINEAR (color0[2], color1[2], factor);
result_color[3] = INTERPOLATE_COLOR_LINEAR (color0[3], color1[3], factor);
factor = (cairo_fixed_t) (((exp (f * f) - 1.0) / E_MINUS_ONE) * 65536);
*pixel = ((INTERPOLATE_COLOR_LINEAR (color0[3], color1[3], factor) << 24) |
(INTERPOLATE_COLOR_LINEAR (color0[0], color1[0], factor) << 16) |
(INTERPOLATE_COLOR_LINEAR (color0[1], color1[1], factor) << 8) |
(INTERPOLATE_COLOR_LINEAR (color0[2], color1[2], factor) << 0));
}
#undef INTERPOLATE_COLOR_LINEAR
void
_cairo_pattern_calc_color_at_pixel (cairo_pattern_t *pattern,
double factor,
int *pixel)
_cairo_pattern_shader_init (cairo_pattern_t *pattern,
cairo_shader_op_t *op)
{
int p, colorstop;
double factorscale;
unsigned char result_color[4];
cairo_shader_function_t shader_function;
op->stops = pattern->stops;
op->n_stops = pattern->n_stops - 1;
op->min_offset = pattern->stops[0].offset;
op->max_offset = pattern->stops[op->n_stops].offset;
op->extend = pattern->extend;
switch (pattern->filter) {
case CAIRO_FILTER_FAST:
case CAIRO_FILTER_NEAREST:
shader_function = _cairo_pattern_shader_nearest;
op->shader_function = _cairo_pattern_shader_nearest;
break;
case CAIRO_FILTER_GAUSSIAN:
shader_function = _cairo_pattern_shader_gaussian;
op->shader_function = _cairo_pattern_shader_gaussian;
break;
case CAIRO_FILTER_GOOD:
case CAIRO_FILTER_BEST:
case CAIRO_FILTER_BILINEAR:
shader_function = _cairo_pattern_shader_linear;
op->shader_function = _cairo_pattern_shader_linear;
break;
}
}
void
_cairo_pattern_calc_color_at_pixel (cairo_shader_op_t *op,
cairo_fixed_t factor,
int *pixel)
{
int i;
if (factor > 1.0 || factor < 0.0) {
switch (pattern->extend) {
case CAIRO_EXTEND_REPEAT:
factor -= floor (factor);
break;
case CAIRO_EXTEND_REFLECT:
if (factor >= 0.0) {
if (((int) factor) % 2)
factor = 1.0 - (factor - floor (factor));
else
factor -= floor (factor);
} else {
if (((int) factor) % 2)
factor -= floor (factor);
else
factor = 1.0 - (factor - floor (factor));
}
break;
case CAIRO_EXTEND_NONE:
break;
switch (op->extend) {
case CAIRO_EXTEND_REPEAT: