[cairo-commit] src/cairo-surface.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Aug 31 09:23:53 PDT 2007

 src/cairo-surface.c |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
diff-tree c14cf02f61105b755b380bd0a5d5b9e83a97d2c9 (from e8e3bfc1308aa30ea08ec530b6a5ddf532fd3088)
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Aug 31 17:20:54 2007 +0100

    [cairo-surface] Add a comment about why the glyph array is not const.
    As penance for attempting to make the glyph array constant, add a
    comment block to explain that the backends rely on being able to modify
    the array.

diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index b44b853..d3f100d 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -1897,6 +1897,14 @@ _cairo_surface_get_extents (cairo_surfac
     return surface->backend->get_extents (surface, rectangle);
+/* Note: the backends may modify the contents of the glyph array as long as
+ * they do not return CAIRO_STATUS_UNSUPPORTED. This makes it possible to
+ * avoid copying the array again and again, and edit it in-place.
+ * Backends are in fact free to use the array as a generic buffer as they
+ * see fit.
+ * See commits 5a9642c5746fd677aed35ce620ce90b1029b1a0c and
+ * 1781e6018c17909311295a9cc74b70500c6b4d0a for the rationale.
+ */
 _cairo_surface_show_glyphs (cairo_surface_t	*surface,
 			    cairo_operator_t	 op,

More information about the cairo-commit mailing list