gfx/cairo/bgr.patch

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/cairo/bgr.patch	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,104 @@
     1.4 +commit d2120bdb06c9aacc470bb346d6bc2071c2e0749d
     1.5 +Author: Jeff Muizelaar <jmuizelaar@mozilla.com>
     1.6 +Date:   Fri Mar 12 15:32:09 2010 -0500
     1.7 +
     1.8 +    BGR
     1.9 +
    1.10 +diff --git a/src/cairo-surface.c b/src/cairo-surface.c
    1.11 +index 332e3ab..4a1d6a0 100644
    1.12 +--- a/src/cairo-surface.c
    1.13 ++++ b/src/cairo-surface.c
    1.14 +@@ -1501,7 +1501,9 @@ static void
    1.15 + _wrap_release_source_image (void *data)
    1.16 + {
    1.17 +     struct acquire_source_image_data *acquire_data = data;
    1.18 +-    _cairo_surface_release_source_image (acquire_data->src, acquire_data->image, acquire_data->image_extra);
    1.19 ++    _cairo_surface_release_source_image (acquire_data->src,
    1.20 ++					 acquire_data->image,
    1.21 ++					 acquire_data->image_extra);
    1.22 +     free(data);
    1.23 + }
    1.24 + 
    1.25 +@@ -1515,42 +1517,47 @@ _wrap_image (cairo_surface_t *src,
    1.26 +     cairo_image_surface_t *surface;
    1.27 +     cairo_status_t status;
    1.28 + 
    1.29 +-    struct acquire_source_image_data *data = malloc(sizeof(*data));
    1.30 ++    struct acquire_source_image_data *data = malloc (sizeof (*data));
    1.31 ++    if (unlikely (data == NULL))
    1.32 ++	return _cairo_error (CAIRO_STATUS_NO_MEMORY);
    1.33 +     data->src = src;
    1.34 +     data->image = image;
    1.35 +     data->image_extra = image_extra;
    1.36 + 
    1.37 +-    surface = (cairo_image_surface_t*)cairo_image_surface_create_for_data (image->data,
    1.38 +-	    image->format,
    1.39 +-	    image->width,
    1.40 +-	    image->height,
    1.41 +-	    image->stride);
    1.42 ++    surface = (cairo_image_surface_t*)
    1.43 ++	_cairo_image_surface_create_with_pixman_format (image->data,
    1.44 ++							image->pixman_format,
    1.45 ++							image->width,
    1.46 ++							image->height,
    1.47 ++							image->stride);
    1.48 +     status = surface->base.status;
    1.49 +-    if (status)
    1.50 ++    if (status) {
    1.51 ++	free (data);
    1.52 + 	return status;
    1.53 ++    }
    1.54 + 
    1.55 +     status = _cairo_user_data_array_set_data (&surface->base.user_data,
    1.56 +-	    &wrap_image_key,
    1.57 +-	    data,
    1.58 +-	    _wrap_release_source_image);
    1.59 ++					      &wrap_image_key,
    1.60 ++					      data,
    1.61 ++					      _wrap_release_source_image);
    1.62 +     if (status) {
    1.63 + 	cairo_surface_destroy (&surface->base);
    1.64 ++	free (data);
    1.65 + 	return status;
    1.66 +     }
    1.67 +-/*
    1.68 +-    pixman_image_set_component_alpha (surface->pixman_image,
    1.69 +-            pixman_image_get_component_alpha (image->pixman_image));
    1.70 +-*/
    1.71 ++
    1.72 ++    pixman_image_set_component_alpha (
    1.73 ++	surface->pixman_image,
    1.74 ++	pixman_image_get_component_alpha (image->pixman_image));
    1.75 ++
    1.76 +     *out = surface;
    1.77 +     return CAIRO_STATUS_SUCCESS;
    1.78 + }
    1.79 + 
    1.80 +-
    1.81 + /**
    1.82 +  * _cairo_surface_clone_similar:
    1.83 +  * @surface: a #cairo_surface_t
    1.84 +  * @src: the source image
    1.85 +- * @content: target content mask
    1.86 +  * @src_x: extent for the rectangle in src we actually care about
    1.87 +  * @src_y: extent for the rectangle in src we actually care about
    1.88 +  * @width: extent for the rectangle in src we actually care about
    1.89 +@@ -1627,12 +1634,12 @@ _cairo_surface_clone_similar (cairo_surface_t  *surface,
    1.90 + 		    _cairo_surface_release_source_image (src, image, image_extra);
    1.91 + 		} else {
    1.92 + 		    status =
    1.93 +-		    surface->backend->clone_similar (surface, &image->base,
    1.94 +-						     src_x, src_y,
    1.95 +-						     width, height,
    1.96 +-						     clone_offset_x,
    1.97 +-						     clone_offset_y,
    1.98 +-						     clone_out);
    1.99 ++			surface->backend->clone_similar (surface, &image->base,
   1.100 ++							 src_x, src_y,
   1.101 ++							 width, height,
   1.102 ++							 clone_offset_x,
   1.103 ++							 clone_offset_y,
   1.104 ++							 clone_out);
   1.105 + 		    cairo_surface_destroy(&image->base);
   1.106 + 		}
   1.107 + 	    }

mercurial