[cairo-commit] 2 commits - boilerplate/cairo-boilerplate.c src/cairo-xlib-surface.c test/surface-source.c util/cairo-script
M. Joonas Pihlaja
joonas at kemper.freedesktop.org
Sun Nov 29 06:09:27 PST 2009
boilerplate/cairo-boilerplate.c | 1 +
src/cairo-xlib-surface.c | 1 +
test/surface-source.c | 4 ++++
util/cairo-script/cairo-script-operators.c | 2 ++
4 files changed, 8 insertions(+)
New commits:
commit e2d75203c515f9740a8e0e9779391de0a1a54b07
Author: M Joonas Pihlaja <jpihlaja at cc.helsinki.fi>
Date: Sun Nov 29 15:56:26 2009 +0200
[dirty] Add more missing surface dirtying notifications.
Now that the image surface actually cares about
cairo_surface_mark_dirty() we're hitting cases where
we've forgotten to mark surfaces dirty.
diff --git a/boilerplate/cairo-boilerplate.c b/boilerplate/cairo-boilerplate.c
index 2036a0e..401e613 100644
--- a/boilerplate/cairo-boilerplate.c
+++ b/boilerplate/cairo-boilerplate.c
@@ -777,6 +777,7 @@ cairo_boilerplate_image_surface_create_from_ppm_stream (FILE *file)
break;
}
}
+ cairo_surface_mark_dirty (image);
return image;
diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
index 92605ff..7e5935d 100644
--- a/src/cairo-xlib-surface.c
+++ b/src/cairo-xlib-surface.c
@@ -914,6 +914,7 @@ _get_image_surface (cairo_xlib_surface_t *surface,
}
row += rowstride;
}
+ cairo_surface_mark_dirty (&image->base);
}
BAIL:
diff --git a/util/cairo-script/cairo-script-operators.c b/util/cairo-script/cairo-script-operators.c
index 27039a4..aea1a0f 100644
--- a/util/cairo-script/cairo-script-operators.c
+++ b/util/cairo-script/cairo-script-operators.c
@@ -2986,6 +2986,7 @@ _image_read_raw (csi_file_t *src,
#endif
}
+ cairo_surface_mark_dirty (image);
*image_out = image;
return CSI_STATUS_SUCCESS;
}
@@ -4956,6 +4957,7 @@ _set_source_image (csi_t *ctx)
memcpy (cairo_image_surface_get_data (surface),
cairo_image_surface_get_data (source),
cairo_image_surface_get_height (source) * cairo_image_surface_get_stride (source));
+ cairo_surface_mark_dirty (surface);
} else {
cairo_t *cr;
commit b76565d2f4a2510aabada4cef968b9b597bbef09
Author: M Joonas Pihlaja <jpihlaja at cc.helsinki.fi>
Date: Sun Nov 29 15:40:30 2009 +0200
[test] Don't use uninitialised data in surface-source.c
The draw_pattern() function assumed the incoming surface
was clear, but it's not. Explicitly clear the surface first.
diff --git a/test/surface-source.c b/test/surface-source.c
index bd047c9..eb8be19 100644
--- a/test/surface-source.c
+++ b/test/surface-source.c
@@ -45,6 +45,10 @@ draw_pattern (cairo_surface_t **surface_inout, int surface_size)
cr = cairo_create (*surface_inout);
cairo_surface_destroy (*surface_inout);
+ cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
+ cairo_set_source_rgba (cr, 0, 0, 0, 0);
+ cairo_paint (cr);
+
cairo_rectangle (cr, 0, 0, surface_size, surface_size);
cairo_rectangle (cr, mid - SIZE/4, mid + SIZE/4, SIZE/2, -SIZE/2);
cairo_clip (cr);
More information about the cairo-commit
mailing list