[cairo-commit] 2 commits - src/cairo-bentley-ottmann.c src/cairo-png.c src/cairo-ps-surface.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Jan 30 13:55:31 PST 2009


 src/cairo-bentley-ottmann.c |    1 -
 src/cairo-png.c             |   14 --------------
 src/cairo-ps-surface.c      |    4 ++--
 3 files changed, 2 insertions(+), 17 deletions(-)

New commits:
commit 7375f4c76bb169cc24d5d714520c337172d3cf69
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jan 30 21:54:56 2009 +0000

    Trivial warning fixes.
    
    Cleanup a few compiler warnings about unused variables and mismatching
    pointer types.

diff --git a/src/cairo-bentley-ottmann.c b/src/cairo-bentley-ottmann.c
index f1f2f83..81eed1d 100644
--- a/src/cairo-bentley-ottmann.c
+++ b/src/cairo-bentley-ottmann.c
@@ -966,7 +966,6 @@ _cairo_bo_event_queue_init (cairo_bo_event_queue_t	*event_queue,
     int i;
     cairo_bo_event_t *events, **sorted_event_ptrs;
     unsigned num_events = 2*num_edges;
-    cairo_status_t status;
 
     /* The skip_elt_t field of a cairo_bo_event_t isn't used for start
      * or stop events, so this allocation is safe.  XXX: make the
diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index a2dd68b..169a539 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -2443,8 +2443,8 @@ static void
 _cairo_ps_surface_release_surface (cairo_ps_surface_t      *surface,
 				   cairo_surface_pattern_t *pattern)
 {
-    if (surface->image != &surface->acquired_image->base)
-	cairo_surface_destroy (surface->image);
+    if (surface->image != surface->acquired_image)
+	cairo_surface_destroy (&surface->image->base);
 
     if (! _cairo_surface_is_meta (pattern->surface)) {
 	_cairo_surface_release_source_image (pattern->surface,
commit f10eaadf89fa94172a81c05a59febab3f7e32396
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jan 30 21:50:24 2009 +0000

    Revert "[png] Complete the idempotent read_png() -> write_png()"
    
    This reverts commit 564d64a1323c5cbcde2dd9365ac790fe8aa1c5a6.
    
    In hindsight, and with further discussion with Jeff Muizelaar, this
    behaviour of using the stored contents from the mime-data is completely
    the opposite of the users' expectations. When the user calls
    cairo_surface_write_to_png(), usually in the course of debugging their
    rendering code, they expect the precise contents of the surface to be
    saved.

diff --git a/src/cairo-png.c b/src/cairo-png.c
index 58e38cb..6f4213f 100644
--- a/src/cairo-png.c
+++ b/src/cairo-png.c
@@ -148,8 +148,6 @@ write_png (cairo_surface_t	*surface,
     png_info *info;
     png_byte **volatile rows = NULL;
     png_color_16 white;
-    const unsigned char *mime_data;
-    unsigned int mime_data_length;
     int png_color_type;
     int depth;
 
@@ -198,18 +196,6 @@ write_png (cairo_surface_t	*surface,
 
     png_set_write_fn (png, closure, write_func, png_simple_output_flush_fn);
 
-    /* XXX This is very questionable.
-     * This breaks the read_from_png(); draw(); write_to_png(); cycle, but
-     * that is affected by mime-data in general. OTOH, by using mime-data
-     * here we are consistent with the other backends.
-     */
-    cairo_surface_get_mime_data (surface, CAIRO_MIME_TYPE_PNG,
-				 &mime_data, &mime_data_length);
-    if (mime_data != NULL) {
-	write_func (png, (png_bytep) mime_data, mime_data_length);
-	goto BAIL3;
-    }
-
     switch (image->format) {
     case CAIRO_FORMAT_ARGB32:
 	depth = 8;


More information about the cairo-commit mailing list