[cairo] Bug: more grief in 1.9.8
cu
cairouser at yahoo.com
Thu Jun 17 07:05:57 PDT 2010
I downloaded from git the updated cairo-image-surface.c, recompiled and
indeed the memory corruption (and a few other issues) went away.
However, here is a new one. Switching on ANTIALIAS_NONE causes this
polygon to be improperly filled (note that both should be the same - I
am filling the same outline). If you take out the last set of X/Y
(marked with "comment this out") then in ANTIALIAS_NONE mode the fill is
not being performed at all.
I appreciate the work you guys do, no question here. That said, FWIW, my
experience with 1.9.8 so far has not been too great. I realize it is a
snapshot, but I don't recall having so many issues with a snapshot
previously, especially since 1.9.8 is a release candidate and supposed
to be fixing a number of issues.
----------------------- Cut Here -----------------------
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <math.h>
#include <cairo.h>
struct xy_st {
double x;
double y;
};
struct xy_st arrXY[] = {
{ 627.016212, 221.749777 },
{ 756.120787, 221.749777 },
{ 756.120787, 557.602766 },
{ 626.952721, 557.602766 },
{ 626.548456, 493.315729 }, // comment this out for another one
};
int main()
{
int i, num;
cairo_surface_t *surf;
cairo_t *cr;
double w, h, x, y, offt_x, offt_y;
w = 1000;
h = 800;
surf = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, w, h);
cr = cairo_create(surf);
num = sizeof(arrXY) / sizeof(arrXY[0]);
for (i = 0; i < num; ++i) {
x = arrXY[i].x;
y = arrXY[i].y;
if (i == 0)
cairo_move_to(cr, x, y);
else
cairo_line_to(cr, x, y);
}
cairo_close_path(cr);
cairo_set_source_rgba(cr, 1, 0, 0, 1);
cairo_fill_preserve(cr);
cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE);
cairo_set_source_rgba(cr, 0, 1, 0, 1);
cairo_fill(cr);
cairo_destroy(cr);
cairo_surface_write_to_png(surf, "surf.png");
return 0;
}
More information about the cairo
mailing list