[cairo-commit] cairo/src cairo_image_surface.c,1.6,1.7 cairoint.h,1.43,1.44

Carl Worth commit at pdx.freedesktop.org
Thu Dec 11 13:04:41 PST 2003


Committed by: cworth

Update of /cvs/cairo/cairo/src
In directory pdx:/tmp/cvs-serv8824/src

Modified Files:
	cairo_image_surface.c cairoint.h 
Log Message:

        * src/cairoint.h: Rename surface->ic_image to
        surface->pixman_image.

        * src/cairo_image_surface.c
        (_cairo_image_surface_create_for_pixman_image):
        (_cairo_image_surface_create_with_masks):
        (_create_pixman_format):
        (cairo_image_surface_create):
        (cairo_image_surface_create_for_data):
        (_cairo_image_abstract_surface_destroy):
        (_cairo_image_surface_set_matrix):
        (_cairo_image_surface_set_filter):
        (_cairo_image_surface_set_repeat):
        (_pixman_operator):
        (_cairo_image_surface_fill_rectangles):
        (_cairo_image_surface_composite_trapezoids): Rename functions and
        indentifiers with ic_ in the name that were missed by the recent
        renaming. Fix indentation problems left by the recent renaming.

        * Shift everything over from libic/libpixregion/slim to
        libpixman. Many thanks to Dave Beckett
        <dave.beckett at bristol.ac.uk> for all of the heavy lifting with
        this renaming effort.


Index: cairo_image_surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_image_surface.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** cairo_image_surface.c	11 Dec 2003 20:43:58 -0000	1.6
--- cairo_image_surface.c	11 Dec 2003 21:04:39 -0000	1.7
***************
*** 46,50 ****
  
  static cairo_image_surface_t *
! _cairo_image_surface_create_for_ic_image (pixman_image_t *ic_image)
  {
      cairo_image_surface_t *surface;
--- 46,50 ----
  
  static cairo_image_surface_t *
! _cairo_image_surface_create_for_pixman_image (pixman_image_t *pixman_image)
  {
      cairo_image_surface_t *surface;
***************
*** 56,68 ****
      _cairo_surface_init (&surface->base, &cairo_image_surface_backend);
  
!     surface->ic_image = ic_image;
  
!     surface->data = (char *) pixman_image_get_data (ic_image);
      surface->owns_data = 0;
  
!     surface->width = pixman_image_get_width (ic_image);
!     surface->height = pixman_image_get_height (ic_image);
!     surface->stride = pixman_image_get_stride (ic_image);
!     surface->depth = pixman_image_get_depth (ic_image);
  
      return surface;
--- 56,68 ----
      _cairo_surface_init (&surface->base, &cairo_image_surface_backend);
  
!     surface->pixman_image = pixman_image;
  
!     surface->data = (char *) pixman_image_get_data (pixman_image);
      surface->owns_data = 0;
  
!     surface->width = pixman_image_get_width (pixman_image);
!     surface->height = pixman_image_get_height (pixman_image);
!     surface->stride = pixman_image_get_stride (pixman_image);
!     surface->depth = pixman_image_get_depth (pixman_image);
  
      return surface;
***************
*** 77,101 ****
  {
      cairo_image_surface_t *surface;
!     pixman_format_t *ic_format;
!     pixman_image_t *ic_image;
  
!     ic_format = pixman_format_create_masks (format->bpp,
! 				     format->alpha_mask,
! 				     format->red_mask,
! 				     format->green_mask,
! 				     format->blue_mask);
  
!     if (ic_format == NULL)
  	return NULL;
  
!     ic_image = pixman_image_create_for_data ((pixman_bits_t *) data, ic_format,
! 				     width, height, format->bpp, stride);
  
!     pixman_format_destroy (ic_format);
  
!     if (ic_image == NULL)
  	return NULL;
  
!     surface = _cairo_image_surface_create_for_ic_image (ic_image);
  
      return surface;
--- 77,101 ----
  {
      cairo_image_surface_t *surface;
!     pixman_format_t *pixman_format;
!     pixman_image_t *pixman_image;
  
!     pixman_format = pixman_format_create_masks (format->bpp,
! 						format->alpha_mask,
! 						format->red_mask,
! 						format->green_mask,
! 						format->blue_mask);
  
!     if (pixman_format == NULL)
  	return NULL;
  
!     pixman_image = pixman_image_create_for_data ((pixman_bits_t *) data, pixman_format,
! 						 width, height, format->bpp, stride);
  
!     pixman_format_destroy (pixman_format);
  
!     if (pixman_image == NULL)
  	return NULL;
  
!     surface = _cairo_image_surface_create_for_pixman_image (pixman_image);
  
      return surface;
***************
*** 103,107 ****
  
  static pixman_format_t *
! _create_ic_format (cairo_format_t format)
  {
      switch (format) {
--- 103,107 ----
  
  static pixman_format_t *
! _create_pixman_format (cairo_format_t format)
  {
      switch (format) {
***************
*** 128,146 ****
  {
      cairo_image_surface_t *surface;
!     pixman_format_t *ic_format;
!     pixman_image_t *ic_image;
  
!     ic_format = _create_ic_format (format);
!     if (ic_format == NULL)
  	return NULL;
  
!     ic_image = pixman_image_create (ic_format, width, height);
  
!     pixman_format_destroy (ic_format);
  
!     if (ic_image == NULL)
  	return NULL;
  
!     surface = _cairo_image_surface_create_for_ic_image (ic_image);
  
      return &surface->base;
--- 128,146 ----
  {
      cairo_image_surface_t *surface;
!     pixman_format_t *pixman_format;
!     pixman_image_t *pixman_image;
  
!     pixman_format = _create_pixman_format (format);
!     if (pixman_format == NULL)
  	return NULL;
  
!     pixman_image = pixman_image_create (pixman_format, width, height);
  
!     pixman_format_destroy (pixman_format);
  
!     if (pixman_image == NULL)
  	return NULL;
  
!     surface = _cairo_image_surface_create_for_pixman_image (pixman_image);
  
      return &surface->base;
***************
*** 155,176 ****
  {
      cairo_image_surface_t *surface;
!     pixman_format_t *ic_format;
!     pixman_image_t *ic_image;
  
!     ic_format = _create_ic_format (format);
!     if (ic_format == NULL)
  	return NULL;
  
!     ic_image = pixman_image_create_for_data ((pixman_bits_t *) data, ic_format,
! 				     width, height,
! 				     _cairo_format_bpp (format),
! 				     stride);
  
!     pixman_format_destroy (ic_format);
  
!     if (ic_image == NULL)
  	return NULL;
  
!     surface = _cairo_image_surface_create_for_ic_image (ic_image);
  
      return &surface->base;
--- 155,176 ----
  {
      cairo_image_surface_t *surface;
!     pixman_format_t *pixman_format;
!     pixman_image_t *pixman_image;
  
!     pixman_format = _create_pixman_format (format);
!     if (pixman_format == NULL)
  	return NULL;
  
!     pixman_image = pixman_image_create_for_data ((pixman_bits_t *) data, pixman_format,
! 						 width, height,
! 						 _cairo_format_bpp (format),
! 						 stride);
  
!     pixman_format_destroy (pixman_format);
  
!     if (pixman_image == NULL)
  	return NULL;
  
!     surface = _cairo_image_surface_create_for_pixman_image (pixman_image);
  
      return &surface->base;
***************
*** 191,196 ****
      cairo_image_surface_t *surface = abstract_surface;
      
!     if (surface->ic_image)
! 	pixman_image_destroy (surface->ic_image);
  
      if (surface->owns_data) {
--- 191,196 ----
      cairo_image_surface_t *surface = abstract_surface;
      
!     if (surface->pixman_image)
! 	pixman_image_destroy (surface->pixman_image);
  
      if (surface->owns_data) {
***************
*** 248,266 ****
  				 cairo_matrix_t		*matrix)
  {
!     pixman_transform_t ic_transform;
  
!     ic_transform.matrix[0][0] = _cairo_fixed_from_double (matrix->m[0][0]);
!     ic_transform.matrix[0][1] = _cairo_fixed_from_double (matrix->m[1][0]);
!     ic_transform.matrix[0][2] = _cairo_fixed_from_double (matrix->m[2][0]);
  
!     ic_transform.matrix[1][0] = _cairo_fixed_from_double (matrix->m[0][1]);
!     ic_transform.matrix[1][1] = _cairo_fixed_from_double (matrix->m[1][1]);
!     ic_transform.matrix[1][2] = _cairo_fixed_from_double (matrix->m[2][1]);
  
!     ic_transform.matrix[2][0] = 0;
!     ic_transform.matrix[2][1] = 0;
!     ic_transform.matrix[2][2] = _cairo_fixed_from_double (1);
  
!     pixman_image_set_transform (surface->ic_image, &ic_transform);
  
      return CAIRO_STATUS_SUCCESS;
--- 248,266 ----
  				 cairo_matrix_t		*matrix)
  {
!     pixman_transform_t pixman_transform;
  
!     pixman_transform.matrix[0][0] = _cairo_fixed_from_double (matrix->m[0][0]);
!     pixman_transform.matrix[0][1] = _cairo_fixed_from_double (matrix->m[1][0]);
!     pixman_transform.matrix[0][2] = _cairo_fixed_from_double (matrix->m[2][0]);
  
!     pixman_transform.matrix[1][0] = _cairo_fixed_from_double (matrix->m[0][1]);
!     pixman_transform.matrix[1][1] = _cairo_fixed_from_double (matrix->m[1][1]);
!     pixman_transform.matrix[1][2] = _cairo_fixed_from_double (matrix->m[2][1]);
  
!     pixman_transform.matrix[2][0] = 0;
!     pixman_transform.matrix[2][1] = 0;
!     pixman_transform.matrix[2][2] = _cairo_fixed_from_double (1);
  
!     pixman_image_set_transform (surface->pixman_image, &pixman_transform);
  
      return CAIRO_STATUS_SUCCESS;
***************
*** 278,304 ****
  _cairo_image_surface_set_filter (cairo_image_surface_t *surface, cairo_filter_t filter)
  {
!     pixman_filter_t ic_filter;
  
      switch (filter) {
      case CAIRO_FILTER_FAST:
! 	ic_filter = PIXMAN_FILTER_FAST;
  	break;
      case CAIRO_FILTER_GOOD:
! 	ic_filter = PIXMAN_FILTER_GOOD;
  	break;
      case CAIRO_FILTER_BEST:
! 	ic_filter = PIXMAN_FILTER_BEST;
  	break;
      case CAIRO_FILTER_NEAREST:
! 	ic_filter = PIXMAN_FILTER_NEAREST;
  	break;
      case CAIRO_FILTER_BILINEAR:
! 	ic_filter = PIXMAN_FILTER_BILINEAR;
  	break;
      default:
! 	ic_filter = PIXMAN_FILTER_BEST;
      }
  
!     pixman_image_set_filter (surface->ic_image, ic_filter);
  
      return CAIRO_STATUS_SUCCESS;
--- 278,304 ----
  _cairo_image_surface_set_filter (cairo_image_surface_t *surface, cairo_filter_t filter)
  {
!     pixman_filter_t pixman_filter;
  
      switch (filter) {
      case CAIRO_FILTER_FAST:
! 	pixman_filter = PIXMAN_FILTER_FAST;
  	break;
      case CAIRO_FILTER_GOOD:
! 	pixman_filter = PIXMAN_FILTER_GOOD;
  	break;
      case CAIRO_FILTER_BEST:
! 	pixman_filter = PIXMAN_FILTER_BEST;
  	break;
      case CAIRO_FILTER_NEAREST:
! 	pixman_filter = PIXMAN_FILTER_NEAREST;
  	break;
      case CAIRO_FILTER_BILINEAR:
! 	pixman_filter = PIXMAN_FILTER_BILINEAR;
  	break;
      default:
! 	pixman_filter = PIXMAN_FILTER_BEST;
      }
  
!     pixman_image_set_filter (surface->pixman_image, pixman_filter);
  
      return CAIRO_STATUS_SUCCESS;
***************
*** 315,319 ****
  _cairo_image_surface_set_repeat (cairo_image_surface_t *surface, int repeat)
  {
!     pixman_image_set_repeat (surface->ic_image, repeat);
  
      return CAIRO_STATUS_SUCCESS;
--- 315,319 ----
  _cairo_image_surface_set_repeat (cairo_image_surface_t *surface, int repeat)
  {
!     pixman_image_set_repeat (surface->pixman_image, repeat);
  
      return CAIRO_STATUS_SUCCESS;
***************
*** 321,325 ****
  
  static pixman_operator_t
! _ic_operator (cairo_operator_t operator)
  {
      switch (operator) {
--- 321,325 ----
  
  static pixman_operator_t
! _pixman_operator (cairo_operator_t operator)
  {
      switch (operator) {
***************
*** 381,392 ****
      }
  
!     pixman_composite (_ic_operator (operator),
! 		 src->ic_image,
! 		 mask ? mask->ic_image : NULL,
! 		 dst->ic_image,
! 		 src_x, src_y,
! 		 mask_x, mask_y,
! 		 dst_x, dst_y,
! 		 width, height);
  
      return CAIRO_STATUS_SUCCESS;
--- 381,392 ----
      }
  
!     pixman_composite (_pixman_operator (operator),
! 		      src->pixman_image,
! 		      mask ? mask->pixman_image : NULL,
! 		      dst->pixman_image,
! 		      src_x, src_y,
! 		      mask_x, mask_y,
! 		      dst_x, dst_y,
! 		      width, height);
  
      return CAIRO_STATUS_SUCCESS;
***************
*** 402,415 ****
      cairo_image_surface_t *surface = abstract_surface;
  
!     pixman_color_t ic_color;
  
!     ic_color.red   = color->red_short;
!     ic_color.green = color->green_short;
!     ic_color.blue  = color->blue_short;
!     ic_color.alpha = color->alpha_short;
  
      /* XXX: The pixman_rectangle_t cast is evil... it needs to go away somehow. */
!     pixman_fill_rectangles (_ic_operator(operator), surface->ic_image,
! 		      &ic_color, (pixman_rectangle_t *) rects, num_rects);
  
      return CAIRO_STATUS_SUCCESS;
--- 402,415 ----
      cairo_image_surface_t *surface = abstract_surface;
  
!     pixman_color_t pixman_color;
  
!     pixman_color.red   = color->red_short;
!     pixman_color.green = color->green_short;
!     pixman_color.blue  = color->blue_short;
!     pixman_color.alpha = color->alpha_short;
  
      /* XXX: The pixman_rectangle_t cast is evil... it needs to go away somehow. */
!     pixman_fill_rectangles (_pixman_operator(operator), surface->pixman_image,
! 			    &pixman_color, (pixman_rectangle_t *) rects, num_rects);
  
      return CAIRO_STATUS_SUCCESS;
***************
*** 432,437 ****
  
      /* XXX: The pixman_trapezoid_t cast is evil and needs to go away somehow. */
!     pixman_composite_trapezoids (operator, src->ic_image, dst->ic_image,
! 			   x_src, y_src, (pixman_trapezoid_t *) traps, num_traps);
  
      return CAIRO_STATUS_SUCCESS;
--- 432,437 ----
  
      /* XXX: The pixman_trapezoid_t cast is evil and needs to go away somehow. */
!     pixman_composite_trapezoids (operator, src->pixman_image, dst->pixman_image,
! 				 x_src, y_src, (pixman_trapezoid_t *) traps, num_traps);
  
      return CAIRO_STATUS_SUCCESS;

Index: cairoint.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairoint.h,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -d -r1.43 -r1.44
*** cairoint.h	11 Dec 2003 20:43:58 -0000	1.43
--- cairoint.h	11 Dec 2003 21:04:39 -0000	1.44
***************
*** 414,418 ****
      int depth;
  
!     pixman_image_t *ic_image;
  };
  
--- 414,418 ----
      int depth;
  
!     pixman_image_t *pixman_image;
  };
  





More information about the cairo-commit mailing list