Index: Makefile
===================================================================
RCS file: /cvs/ports/graphics/cairo/Makefile,v
retrieving revision 1.11
diff -u -r1.11 Makefile
--- Makefile	2007/03/26 21:22:13	1.11
+++ Makefile	2007/05/05 16:51:50
@@ -2,9 +2,9 @@
 
 COMMENT=		"vector graphics library"
 
-DISTNAME=		cairo-1.2.6
-PKGNAME=		${DISTNAME}p1
-SHARED_LIBS +=	cairo                6.0      # .11.3
+DISTNAME=		cairo-1.4.6
+PKGNAME=		${DISTNAME}
+SHARED_LIBS +=	cairo                6.1      # .11.3
 CATEGORIES=		graphics
 
 HOMEPAGE=		http://cairographics.org/introduction
Index: distinfo
===================================================================
RCS file: /cvs/ports/graphics/cairo/distinfo,v
retrieving revision 1.6
diff -u -r1.6 distinfo
--- distinfo	2007/04/05 16:19:55	1.6
+++ distinfo	2007/05/05 16:51:50
@@ -1,5 +1,5 @@
-MD5 (cairo-1.2.6.tar.gz) = SHs9dRV1L+V/eA0P1wewGg==
-RMD160 (cairo-1.2.6.tar.gz) = RGmmYbKU40Lud+cmwc78zUg3ri4=
-SHA1 (cairo-1.2.6.tar.gz) = uGtAF6mr1WXvEccrf67pCCoEEY8=
-SHA256 (cairo-1.2.6.tar.gz) = fTZEnJoFwsm0QkixDp+C8LypnzDiSEhDXmWsp3wos/k=
-SIZE (cairo-1.2.6.tar.gz) = 2973689
+MD5 (cairo-1.4.6.tar.gz) = rhbnP53KRqyTtM5DXpN3PA==
+RMD160 (cairo-1.4.6.tar.gz) = FEulQixBQHDOtpHc1Z+oh/gml7E=
+SHA1 (cairo-1.4.6.tar.gz) = v9FTLhB4n8T4ehllQMBJ2IxuzkI=
+SHA256 (cairo-1.4.6.tar.gz) = ymMq/LSs3lU0Y8BoLAYFODdi6RdPgECqmX1xWv89iJY=
+SIZE (cairo-1.4.6.tar.gz) = 3181592
Index: patches/patch-configure
===================================================================
RCS file: /cvs/ports/graphics/cairo/patches/patch-configure,v
retrieving revision 1.4
diff -u -r1.4 patch-configure
--- patches/patch-configure	2007/02/06 21:29:06	1.4
+++ patches/patch-configure	2007/05/05 16:51:50
@@ -1,7 +1,7 @@
 $OpenBSD: patch-configure,v 1.4 2007/02/06 21:29:06 espie Exp $
---- configure.orig	Fri Nov  3 00:30:03 2006
-+++ configure	Wed Jan 10 21:57:17 2007
-@@ -24786,7 +24786,7 @@ else
+--- configure.orig	Tue May  1 22:25:17 2007
++++ configure	Sat May  5 16:09:43 2007
+@@ -25884,7 +25884,7 @@ else
  
    if test "x$png_REQUIRES" = x; then
      # libpng13 is GnuWin32's libpng-1.2.8 :-(
@@ -10,7 +10,7 @@
        if $PKG_CONFIG --exists $l ; then
          png_REQUIRES=$l
          use_png=yes
-@@ -28124,7 +28124,7 @@ fi
+@@ -29667,7 +29667,7 @@ fi
  
  case `$PKG_CONFIG --version` in
  0.?|0.?.?|0.1[0-7]|0.1[0-7].?) PKGCONFIG_REQUIRES="Requires"; ;;
Index: patches/patch-src_cairo-xlib-surface-private_h
===================================================================
RCS file: patch-src_cairo-xlib-surface-private_h
diff -N patch-src_cairo-xlib-surface-private_h
--- /dev/null	Sat Aug 30 18:16:59 1997
+++ patch-src_cairo-xlib-surface-private_h	Sat May  5 16:51:50 2007
@@ -0,0 +1,22 @@
+$OpenBSD$
+--- src/cairo-xlib-surface-private.h.orig	Sat May  5 16:10:26 2007
++++ src/cairo-xlib-surface-private.h	Sat May  5 16:10:51 2007
+@@ -39,6 +39,8 @@
+ 
+ typedef struct _cairo_xlib_surface cairo_xlib_surface_t;
+ 
++struct clut_r3g3b2;
++
+ struct _cairo_xlib_surface {
+     cairo_surface_t base;
+ 
+@@ -88,6 +90,9 @@ struct _cairo_xlib_surface {
+     cairo_filter_t filter;
+     int repeat;
+     XTransform xtransform;
++
++    struct clut_r3g3b2 *clut;
++    int workaround;
+ };
+ 
+ #endif /* CAIRO_XLIB_SURFACE_PRIVATE_H */
Index: patches/patch-src_cairo-xlib-surface_c
===================================================================
RCS file: /cvs/ports/graphics/cairo/patches/patch-src_cairo-xlib-surface_c,v
retrieving revision 1.4
diff -u -r1.4 patch-src_cairo-xlib-surface_c
--- patches/patch-src_cairo-xlib-surface_c	2007/03/18 14:48:45	1.4
+++ patches/patch-src_cairo-xlib-surface_c	2007/05/05 16:51:50
@@ -1,29 +1,11 @@
-$OpenBSD: patch-src_cairo-xlib-surface_c,v 1.4 2007/03/18 14:48:45 kurt Exp $
---- src/cairo-xlib-surface.c.orig	Thu Nov  2 23:53:40 2006
-+++ src/cairo-xlib-surface.c	Sat Mar 17 14:20:44 2007
-@@ -81,6 +81,8 @@ _cairo_xlib_surface_show_glyphs (void   
- 
- #define CAIRO_ASSUME_PIXMAP	20
- 
-+struct clut_r3g3b2;
-+
- struct _cairo_xlib_surface {
-     cairo_surface_t base;
- 
-@@ -126,6 +128,9 @@ struct _cairo_xlib_surface {
-     int num_clip_rects;
- 
-     XRenderPictFormat *xrender_format;
-+
-+    struct clut_r3g3b2 *clut;
-+    int workaround;
- };
- 
- #define CAIRO_SURFACE_RENDER_AT_LEAST(surface, major, minor)	\
-@@ -504,6 +509,254 @@ _swap_ximage_to_native (XImage *ximage)
+$OpenBSD$
+--- src/cairo-xlib-surface.c.orig	Tue May  1 19:39:47 2007
++++ src/cairo-xlib-surface.c	Sat May  5 18:47:44 2007
+@@ -446,6 +446,255 @@ _swap_ximage_to_native (XImage *ximage)
      }
  }
  
++
 +#if 0
 +static void _set_optimal_cmap(Display *dpy, Colormap cmap) {
 +    int i, r, g, b;
@@ -275,11 +257,8 @@
  static cairo_status_t
  _get_image_surface (cairo_xlib_surface_t    *surface,
  		    cairo_rectangle_int16_t *interest_rect,
-@@ -652,25 +905,106 @@ _get_image_surface (cairo_xlib_surface_t
- 						 ximage->width,
- 						 ximage->height,
+@@ -604,9 +853,14 @@ _get_image_surface (cairo_xlib_surface_t    *surface,
  						 ximage->bytes_per_line);
-+	
  	if (image->base.status)
  	    goto FAIL;
 +	if (surface->workaround != WORKAROUND_NONE) {
@@ -289,14 +268,19 @@
      }
      else
      {
++#if 0
  	/*
--	 * XXX This can't work.  We must convert the data to one of the
--	 * supported pixman formats.  Pixman needs another function
--	 * which takes data in an arbitrary format and converts it
--	 * to something supported by that library.
+ 	 * XXX This can't work.  We must convert the data to one of the
+ 	 * supported pixman formats.  Pixman needs another function
+@@ -621,6 +875,98 @@ _get_image_surface (cairo_xlib_surface_t    *surface,
+ 						    ximage->bytes_per_line);
+ 	if (image->base.status)
+ 	    goto FAIL;
++#else
++	/*
 +	 * Otherwise, we construct a buffer containing RGB24 data
 +	 * using the specified workaround.
- 	 */
++	 */
 +	uint32_t *data, *dst, *clut;
 +	uint8_t  *src8;
 +	uint16_t *src16;
@@ -375,25 +359,20 @@
 +	    goto FAIL;
 +	}
 +	free(ximage->data);
- 	image = (cairo_image_surface_t*)
--	    _cairo_image_surface_create_with_masks ((unsigned char *) ximage->data,
--						    &masks,
--						    ximage->width,
--						    ximage->height,
--						    ximage->bytes_per_line);
--	if (image->base.status)
++	image = (cairo_image_surface_t*)
 +	    cairo_image_surface_create_for_data((unsigned char *)data, CAIRO_FORMAT_RGB24, ximage->width, ximage->height, ximage->width*4);
 +	
 +	if (image->base.status) {
 +	    fprintf(stderr, "cairo-xlib: cairo_image_surface_create_for_data failed\n");
 +	    free(data);
- 	    goto FAIL;
++	    goto FAIL;
 +	}
++#endif
      }
  
      /* Let the surface take ownership of the data */
-@@ -743,29 +1077,132 @@ _cairo_xlib_surface_ensure_gc (cairo_xli
-     _cairo_xlib_surface_set_gc_clip_rects (surface);
+@@ -698,6 +1044,30 @@ _cairo_xlib_surface_ensure_gc (cairo_xlib_surface_t *s
+     return CAIRO_STATUS_SUCCESS;
  }
  
 +static int
@@ -423,27 +402,24 @@
  static cairo_status_t
  _draw_image_surface (cairo_xlib_surface_t   *surface,
  		     cairo_image_surface_t  *image,
- 		     int                    dst_x,
- 		     int                    dst_y)
- {
+@@ -713,19 +1083,98 @@ _draw_image_surface (cairo_xlib_surface_t   *surface,
+     int native_byte_order = _native_byte_order_lsb () ? LSBFirst : MSBFirst;
+     cairo_status_t status;
+ 
 +    static unsigned char *buf = NULL;
 +    static int size = 0;
-     XImage ximage;
--    unsigned int bpp, alpha, red, green, blue;
-+    unsigned int bpp, alpha, red, green, blue, stride, depth;
-+    int i, j;
++    int i, j, depth, stride;
 +    unsigned char *data, *ilut;
 +    uint32_t *src;
 +    uint8_t *dst8;
 +    uint16_t *dst16;
-     int native_byte_order = _native_byte_order_lsb () ? LSBFirst : MSBFirst;
- 
++
      pixman_format_get_masks (pixman_image_get_format (image->pixman_image),
  			     &bpp, &alpha, &red, &green, &blue);
-+    
-+    
-+    switch(surface->workaround) {
  
++
++    switch(surface->workaround) {
++
 +    case WORKAROUND_NONE:
 +	/* Default behaviour is supposed to work */
 +	stride = image->stride;
@@ -512,7 +488,6 @@
 +	break;
 +    }
 +    
-+
      ximage.width = image->width;
      ximage.height = image->height;
      ximage.format = ZPixmap;
@@ -529,10 +504,19 @@
      ximage.bits_per_pixel = bpp;
      ximage.red_mask = red;
      ximage.green_mask = green;
-@@ -1890,7 +2327,35 @@ _cairo_xlib_surface_create_internal (Dis
+@@ -1793,6 +2242,7 @@ _cairo_xlib_surface_create_internal (Display		       *
+ 				     int			height,
+ 				     int			depth)
+ {
++    static int _trace = -1;
+     cairo_xlib_surface_t *surface;
+     cairo_xlib_screen_info_t *screen_info;
+ 
+@@ -1885,7 +2335,38 @@ _cairo_xlib_surface_create_internal (Display		       *
      surface->have_clip_rects = FALSE;
-     surface->clip_rects = NULL;
+     surface->clip_rects = surface->embedded_clip_rects;
      surface->num_clip_rects = 0;
++    
 +    surface->clut = NULL;
 +    surface->workaround = WORKAROUND_NONE;
  
@@ -555,8 +539,10 @@
 +	    }
 +	}
 +    }
-+    
-+    if(getenv("DEBUG_CAIRO_XLIB")) {
++
++    if(_trace == -1)
++	_trace = getenv("DEBUG_CAIRO_XLIB") ? 1 : 0;
++    if(_trace) {
 +	fprintf(stderr, "New surface with workaround %s\n",
 +		workarounds[surface->workaround]);
 +	_print_surface(surface);
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/graphics/cairo/pkg/PLIST,v
retrieving revision 1.2
diff -u -r1.2 PLIST
--- pkg/PLIST	2007/02/06 21:29:06	1.2
+++ pkg/PLIST	2007/05/05 16:51:50
@@ -1,6 +1,7 @@
 @comment $OpenBSD: PLIST,v 1.2 2007/02/06 21:29:06 espie Exp $
 %%SHARED%%
 include/cairo/
+include/cairo/cairo-deprecated.h
 include/cairo/cairo-features.h
 include/cairo/cairo-ft.h
 include/cairo/cairo-glitz.h
@@ -38,7 +39,7 @@
 share/gtk-doc/html/cairo/bindings-return-values.html
 share/gtk-doc/html/cairo/bindings-streams.html
 share/gtk-doc/html/cairo/bindings-surfaces.html
-share/gtk-doc/html/cairo/cairo-Error-handling.html
+share/gtk-doc/html/cairo/cairo-Error-Handling.html
 share/gtk-doc/html/cairo/cairo-Font-Options.html
 share/gtk-doc/html/cairo/cairo-FreeType-Fonts.html
 share/gtk-doc/html/cairo/cairo-Image-Surfaces.html
@@ -67,6 +68,7 @@
 share/gtk-doc/html/cairo/index.sgml
 share/gtk-doc/html/cairo/ix01.html
 share/gtk-doc/html/cairo/ix02.html
+share/gtk-doc/html/cairo/ix03.html
 share/gtk-doc/html/cairo/language-bindings.html
 share/gtk-doc/html/cairo/left.png
 share/gtk-doc/html/cairo/pt01.html
