[cairo-commit] cairo/src cairo_gstate.c, 1.43, 1.44 cairo_image_surface.c, 1.8, 1.9 cairo_xlib_surface.c, 1.17, 1.18 cairoint.h, 1.53, 1.54

Carl Worth commit at pdx.freedesktop.org
Tue Mar 30 17:49:33 PST 2004


Committed by: cworth

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

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

        * src/cairo_xlib_surface.c (_cairo_xlib_surface_set_clip_region):
        Add question on semantics with empty region. Fix missing return
        value.

        * src/cairo_image_surface.c
        (_cairo_image_surface_set_clip_region): Export for internal use.
        (_cairo_image_abstract_surface_set_clip_region): Add silly wrapper
        to match the backend interface.

        * src/cairo_gstate.c (_cairo_gstate_init_clip): Remove unused
        variables.


Index: cairo_gstate.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_gstate.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -d -r1.43 -r1.44
*** a/cairo_gstate.c	19 Mar 2004 23:47:25 -0000	1.43
--- b/cairo_gstate.c	31 Mar 2004 01:49:31 -0000	1.44
***************
*** 1565,1573 ****
  _cairo_gstate_init_clip (cairo_gstate_t *gstate)
  {
-     pixman_region16_t *rect = NULL;
-     pixman_box16_t box;
- 
      /* destroy any existing clip-region artifacts */
- 
      if (gstate->clip.surface)
  	cairo_surface_destroy (gstate->clip.surface);
--- 1565,1569 ----

Index: cairo_image_surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_image_surface.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** a/cairo_image_surface.c	19 Mar 2004 23:47:25 -0000	1.8
--- b/cairo_image_surface.c	31 Mar 2004 01:49:31 -0000	1.9
***************
*** 451,459 ****
  
  static cairo_int_status_t
! _cairo_image_surface_set_clip_region (void *abstract_surface,
  				      pixman_region16_t *region)
  {
!     cairo_image_surface_t *surf = (cairo_image_surface_t *) abstract_surface;
!     pixman_image_set_clip_region (surf->pixman_image, region);
      return CAIRO_STATUS_SUCCESS;
  }
--- 451,468 ----
  
  static cairo_int_status_t
! _cairo_image_abstract_surface_set_clip_region (void *abstract_surface,
! 					       pixman_region16_t *region)
! {
!     cairo_image_surface_t *surface = (cairo_image_surface_t *) abstract_surface;
! 
!     return _cairo_image_surface_set_clip_region (surface, region);
! }
! 
! cairo_int_status_t
! _cairo_image_surface_set_clip_region (cairo_image_surface_t *surface,
  				      pixman_region16_t *region)
  {
!     pixman_image_set_clip_region (surface->pixman_image, region);
! 
      return CAIRO_STATUS_SUCCESS;
  }
***************
*** 473,476 ****
      _cairo_image_surface_copy_page,
      _cairo_image_surface_show_page,
!     _cairo_image_surface_set_clip_region
  };
--- 482,485 ----
      _cairo_image_surface_copy_page,
      _cairo_image_surface_show_page,
!     _cairo_image_abstract_surface_set_clip_region
  };

Index: cairo_xlib_surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo_xlib_surface.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** a/cairo_xlib_surface.c	19 Mar 2004 23:47:25 -0000	1.17
--- b/cairo_xlib_surface.c	31 Mar 2004 01:49:31 -0000	1.18
***************
*** 594,602 ****
  	xr.height = surf->height;
  	XUnionRectWithRegion (&xr, xregion, xregion);
- 
      } else {
  	n = pixman_region_num_rects (region);
  	if (n == 0)
! 	    return;
  	box = pixman_region_rects (region);
  	xregion = XCreateRegion();
--- 594,604 ----
  	xr.height = surf->height;
  	XUnionRectWithRegion (&xr, xregion, xregion);
      } else {
  	n = pixman_region_num_rects (region);
+ 	/* XXX: Are we sure these are the semantics we want for an
+ 	 * empty, (not null) region? */
  	if (n == 0)
! 	    return CAIRO_STATUS_SUCCESS;
! 
  	box = pixman_region_rects (region);
  	xregion = XCreateRegion();
***************
*** 614,617 ****
--- 616,620 ----
      XRenderSetPictureClipRegion (surf->dpy, surf->picture, xregion);
      XDestroyRegion(xregion);
+ 
      return CAIRO_STATUS_SUCCESS;
  }

Index: cairoint.h
===================================================================
RCS file: /cvs/cairo/cairo/src/cairoint.h,v
retrieving revision 1.53
retrieving revision 1.54
diff -C2 -d -r1.53 -r1.54
*** a/cairoint.h	19 Mar 2004 23:47:25 -0000	1.53
--- b/cairoint.h	31 Mar 2004 01:49:31 -0000	1.54
***************
*** 1072,1076 ****
  				 cairo_matrix_t		*matrix);
  
! cairo_status_t
  _cairo_image_surface_set_filter (cairo_image_surface_t	*surface,
  				 cairo_filter_t		filter);
--- 1072,1076 ----
  				 cairo_matrix_t		*matrix);
  
! extern cairo_status_t __internal_linkage
  _cairo_image_surface_set_filter (cairo_image_surface_t	*surface,
  				 cairo_filter_t		filter);
***************
*** 1080,1083 ****
--- 1080,1087 ----
  				 int			repeat);
  
+ extern cairo_int_status_t __internal_linkage
+ _cairo_image_surface_set_clip_region (cairo_image_surface_t *surface,
+ 				      pixman_region16_t *region);
+ 
  /* cairo_pen.c */
  extern cairo_status_t __internal_linkage





More information about the cairo-commit mailing list