Index: Makefile
===================================================================
RCS file: /cvs/ports/graphics/cairo/Makefile,v
retrieving revision 1.17
diff -u -r1.17 Makefile
--- Makefile	22 Jan 2008 20:30:01 -0000	1.17
+++ Makefile	11 Apr 2008 22:45:47 -0000
@@ -2,15 +2,16 @@
 
 COMMENT=		vector graphics library
 
-DISTNAME=		cairo-1.4.14
-SHARED_LIBS=		cairo   7.2
+DISTNAME=		cairo-1.6.4
+SHARED_LIBS=		cairo   8.0
 CATEGORIES=		graphics
 
 HOMEPAGE=		http://cairographics.org/introduction
 
 MAINTAINER=		Eric Faurot <eric@openbsd.org>
 
-WANTLIB=		X11 Xau Xdmcp Xrender expat fontconfig freetype m z
+WANTLIB=		X11 Xau Xdmcp Xrender expat fontconfig freetype m \
+			pixman-1.>=11.0 z
 
 # LGPL
 PERMIT_PACKAGE_CDROM=	Yes
@@ -18,7 +19,8 @@
 PERMIT_DISTFILES_CDROM= Yes
 PERMIT_DISTFILES_FTP=	Yes
 
-MASTER_SITES=		http://cairographics.org/releases/
+MASTER_SITES=		http://cairographics.org/releases/ \
+			http://cairographics.org/snapshots/
 
 USE_X11=		Yes
 USE_LIBTOOL=		Yes
@@ -27,6 +29,7 @@
 			glitz.>=2:glitz->=0.5.6:graphics/glitz
 
 CONFIGURE_STYLE=	gnu
+CONFIGURE_ENV=		png_REQUIRES=libpng
 CONFIGURE_ARGS=		--enable-glitz
 
 
Index: distinfo
===================================================================
RCS file: /cvs/ports/graphics/cairo/distinfo,v
retrieving revision 1.10
diff -u -r1.10 distinfo
--- distinfo	22 Jan 2008 20:30:01 -0000	1.10
+++ distinfo	11 Apr 2008 22:45:47 -0000
@@ -1,5 +1,5 @@
-MD5 (cairo-1.4.14.tar.gz) = 6MRC/4IcBxmmlQj+y6kDjw==
-RMD160 (cairo-1.4.14.tar.gz) = nnyHopLIibBrKeliK+Cn2qPd1v0=
-SHA1 (cairo-1.4.14.tar.gz) = YzECQ7qK+UkGCwbAH8KO5Uce1aQ=
-SHA256 (cairo-1.4.14.tar.gz) = iRT5w0p3v52QiwxhfC1//r3W0ehVz9Nn0qGz1nfyLjw=
-SIZE (cairo-1.4.14.tar.gz) = 3283608
+MD5 (cairo-1.6.4.tar.gz) = oZjVCfnjo1t43ouwIXTruQ==
+RMD160 (cairo-1.6.4.tar.gz) = zK5zakDZhbcr2nwvCpigg4AgZY4=
+SHA1 (cairo-1.6.4.tar.gz) = nZkP45oSXOsHIhYjwjfNcBWFXVw=
+SHA256 (cairo-1.6.4.tar.gz) = fwzijDWHBpE7w55pMKGK6J87mmqheZj6orWdHg4rT0I=
+SIZE (cairo-1.6.4.tar.gz) = 5042623
Index: patches/patch-configure
===================================================================
RCS file: patches/patch-configure
diff -N patches/patch-configure
--- patches/patch-configure	8 Dec 2007 22:39:36 -0000	1.7
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,21 +0,0 @@
-$OpenBSD: patch-configure,v 1.7 2007/12/08 22:39:36 eric Exp $
---- configure.orig	Tue Nov 27 07:31:49 2007
-+++ configure	Fri Nov 30 22:14:14 2007
-@@ -26153,7 +26153,7 @@ else
- 
-   if test "x$png_REQUIRES" = x; then
-     # libpng13 is GnuWin32's libpng-1.2.8 :-(
--    for l in libpng12 libpng13 libpng10 ; do
-+    for l in libpng; do
-       if $PKG_CONFIG --exists $l ; then
-         png_REQUIRES=$l
-         use_png=yes
-@@ -30010,7 +30010,7 @@ fi
- 
- case `$PKG_CONFIG --version` in
- 0.?|0.?.?|0.1[0-7]|0.1[0-7].?) PKGCONFIG_REQUIRES="Requires"; ;;
--*) PKGCONFIG_REQUIRES="Requires.private"; ;;
-+*) PKGCONFIG_REQUIRES="Requires"; ;;
- esac
- 
- 
Index: patches/patch-src_cairo-xlib-surface-private_h
===================================================================
RCS file: patches/patch-src_cairo-xlib-surface-private_h
diff -N patches/patch-src_cairo-xlib-surface-private_h
--- patches/patch-src_cairo-xlib-surface-private_h	24 Jul 2007 17:47:07 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,22 +0,0 @@
-$OpenBSD: patch-src_cairo-xlib-surface-private_h,v 1.2 2007/07/24 17:47:07 steven Exp $
---- src/cairo-xlib-surface-private.h.orig	Wed May  9 15:37:39 2007
-+++ src/cairo-xlib-surface-private.h	Sun Jul  8 12:20:08 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;
- 
-@@ -89,6 +91,9 @@ struct _cairo_xlib_surface {
-     cairo_filter_t filter;
-     int repeat;
-     XTransform xtransform;
-+
-+    struct clut_r3g3b2 *clut;
-+    int workaround;
- };
- 
- enum {
Index: patches/patch-src_cairo-xlib-surface_c
===================================================================
RCS file: patches/patch-src_cairo-xlib-surface_c
diff -N patches/patch-src_cairo-xlib-surface_c
--- patches/patch-src_cairo-xlib-surface_c	22 Jan 2008 20:30:01 -0000	1.8
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,553 +0,0 @@
-$OpenBSD: patch-src_cairo-xlib-surface_c,v 1.8 2008/01/22 20:30:01 eric Exp $
---- src/cairo-xlib-surface.c.orig	Tue Jan 15 00:23:07 2008
-+++ src/cairo-xlib-surface.c	Sun Jan 20 00:09:24 2008
-@@ -494,6 +494,255 @@ _swap_ximage_to_native (XImage *ximage)
-     }
- }
- 
-+
-+#if 0
-+static void _set_optimal_cmap(Display *dpy, Colormap cmap) {
-+    int i, r, g, b;
-+    XColor cm[256];
-+
-+    for (i = 0; i < 256; i++) {
-+	r = i >> 5;
-+	g = (i >> 2) & 0x7;
-+	b = (i << 1) & 0x7;
-+	cm[i].pixel = i;
-+	cm[i].flags = DoRed | DoGreen | DoBlue;
-+	cm[i].red   = r << 13 | r << 10 | r << 7 | r << 4 | r << 1 | r >> 2;
-+	cm[i].green = g << 13 | g << 10 | g << 7 | g << 4 | g << 1 | g >> 2;
-+	cm[i].blue  = b << 13 | b << 10 | b << 7 | b << 4 | b << 1 | b >> 2;
-+    }
-+    XStoreColors(dpy, cmap, cm, 256);
-+}
-+#endif
-+
-+struct clut_r3g3b2 {
-+    struct clut_r3g3b2 *next;
-+    Display            *dpy;
-+    Colormap           cmap;
-+    uint32_t           clut[256];
-+    unsigned char      ilut[256];
-+};
-+
-+static struct clut_r3g3b2 * _get_clut_r3g3b2(Display *dpy, Colormap cmap) {
-+    static struct clut_r3g3b2 *first = NULL;
-+    int i,j, min, d;
-+    struct clut_r3g3b2 *clut;
-+    unsigned char r,g,b, r2,g2,b2;
-+    
-+    clut = first;
-+    while(clut) {
-+	if ( clut->dpy == dpy && clut->cmap == cmap )
-+	    return clut;
-+	clut = clut->next;
-+    }
-+    
-+    clut = calloc(1, sizeof(*clut));
-+    if(clut == NULL) {
-+	fprintf(stderr, "cairo-xlib: cannot allocate clut_r3g3b2\n");
-+	return NULL;
-+    }
-+    clut->next = first;
-+    clut->dpy = dpy;
-+    clut->cmap = cmap;
-+    first = clut;
-+
-+    /* Construct the clut from Colormap */
-+    for (i = 0; i < 256; i++) {
-+	XColor xcol;
-+	xcol.pixel = i;
-+	XQueryColor(dpy, cmap, &xcol);
-+	clut->clut[i] = ( ( ((uint32_t)xcol.red   & 0xff00 ) << 8) |
-+			  ( ((uint32_t)xcol.green & 0xff00 ) ) |
-+			  ( ((uint32_t)xcol.blue  & 0xff00 ) >> 8) );
-+    }
-+    /*
-+      
-+    Find the best matching color in the colormap for all r3g3b2
-+    values. The distance is maybe not perceptively valid, but it
-+    should not be too bad.
-+    
-+    */
-+    for (i = 0; i < 256; i++) {
-+	r = i >> 5;
-+	g = (i >> 2) & 0x7;
-+	b = (i << 1) & 0x7;
-+	min = 255;
-+	for(j = 0; j < 256; j++) {
-+	    r2 = (clut->clut[j] & 0xff0000) >> 21;
-+	    g2 = (clut->clut[j] & 0x00ff00) >> 13;
-+	    b2 = (clut->clut[j] & 0x0000ff) >> 5;
-+	    if ( r2 == r && g2 == g && (b2 & 0x6) == b ) {
-+		clut->ilut[i] = j;
-+		break;
-+	    }
-+	    /*
-+	      Squares make higher bits much more important than lower
-+	      ones.
-+	    */
-+	    d  = (r2 ^ r) * (r2 ^ r);
-+	    d += (g2 ^ g) * (g2 ^ g);
-+	    d += (b2 ^ b) * (b2 ^ b);
-+	    if(d < min) {
-+		clut->ilut[i] = j;
-+		min = d;
-+	    }
-+	}
-+    }
-+    
-+    return clut;
-+}
-+
-+static const char * _visualClass[] = {
-+    "StaticGray",
-+    "GrayScale",
-+    "StaticColor",
-+    "PseudoColor",
-+    "TrueColor",
-+    "DirectColor"
-+};
-+
-+
-+static void _print_Visual(Visual *v) {
-+    if(v)
-+	fprintf(stderr,
-+		"  Visual: %p\n"
-+		"    class: %s\n"
-+		"    bpRGB: %i\n"
-+		"    map_entries: %i\n"
-+		"    RGB masks: %08lx %08lx %08lx\n",
-+		v,
-+		_visualClass[v->class],
-+		v->bits_per_rgb,
-+		v->map_entries,
-+		v->red_mask, v->green_mask, v->blue_mask);
-+    else
-+	fprintf(stderr, "  Visual: NULL\n");
-+}
-+
-+
-+#if 0
-+static void _print_XImage(XImage *x)
-+{
-+    const char * format[] = { "XYBitmap", "XYPixmap", "ZPixmap" };
-+    if(XImage)
-+	fprintf(stderr, 
-+		"  XImage: %p\n"
-+		"    size: %ix%i\n"
-+		"    xoffset: %i\n"
-+		"    format: %s\n"
-+		"    depth: %i\n"
-+		"    bpp: %i\n"
-+		"    stride: %i\n"
-+                "    RGB masks: %08lx %08lx %08lx\n"
-+		"    bitmap_unit: %i\n"
-+		"    bitmap_pad: %i\n",
-+		x,
-+		x->width,
-+		x->height,
-+		x->xoffset,
-+		format[x->format],
-+		x->depth,
-+		x->bits_per_pixel,
-+		x->bytes_per_line,
-+		x->red_mask, x->green_mask, x->blue_mask,
-+		x->bitmap_unit, x->bitmap_pad);
-+    else
-+	fprintf(stderr, "  XImage: NULL\n")
-+}
-+
-+const char * _cairoFormats[] = { "ARGB32", "RGB24", "A8", "A1" };
-+
-+static void _print_cairo_image_surface(cairo_image_surface_t *i)
-+{
-+    if(i)
-+	fprintf(stderr,
-+		"  CairoImage: %p\n"
-+		"    size: %ix%i\n"
-+		"    format: %s\n"
-+		"    depth: %i\n"
-+		"    stride: %i\n",
-+		i,
-+		i->width,
-+		i->height,
-+		_cairoFormats[i->format],
-+		i->depth,
-+		i->stride);
-+    else
-+	fprintf(stderr, "  CairoImage: NULL\n")
-+}
-+
-+static void _print_cairo_format_masks(cairo_format_masks_t *m)
-+{
-+    if(m)
-+	printf(stderr,
-+	       "  CairoFormatMask: %p\n"
-+	       "    bpp: %i\n"
-+	       "    ARGB masks: %lx %lx %lx %lx\n",
-+	       m,
-+	       m->bpp, m->alpha_mask,
-+	       m->red_mask, m->green_mask, m->blue_mask);
-+    else
-+	fprintf(stderr, "  CairoFormatMasks: NULL\n")
-+}
-+#endif
-+
-+#define WORKAROUND_NONE           0
-+#define WORKAROUND_8BIT_GRAYLEVEL 1
-+#define WORKAROUND_8BIT_PALETTE   2
-+#define WORKAROUND_R5G6B5         3
-+
-+static const char *workarounds[] = {
-+    "NONE",
-+    "8BIT_GRAYLEVEL",
-+    "8BIT_PALETTE",
-+    "R5G6B5"
-+};
-+
-+static void
-+_print_XRenderPictFormat(XRenderPictFormat *f)
-+{
-+    if(f)
-+	fprintf(stderr,
-+		"  XRenderPictFormat: %p\n"
-+		"    format: %lu\n"
-+                "    type: %i\n"
-+		"    depth: %i\n"
-+		"    red: %hx mask: %hx\n"
-+		"    green: %hx mask: %hx\n"
-+		"    blue: %hx mask: %hx\n"
-+		"    alpha: %hx mask: %hx\n",
-+		f,
-+		f->id, f->type, f->depth,
-+		f->direct.red, f->direct.redMask,
-+		f->direct.green, f->direct.greenMask,
-+		f->direct.blue, f->direct.blueMask,
-+		f->direct.alpha, f->direct.alphaMask
-+		);
-+    else
-+	fprintf(stderr,
-+		"  XRenderPictFormat: NULL\n");
-+}
-+
-+static void
-+_print_surface(cairo_xlib_surface_t *s)
-+{
-+    if(!s) {
-+	fprintf(stderr, "CairoXlibSurface: NULL\n");
-+	    return;
-+    }
-+    fprintf(stderr,
-+	    "CairoXlibSurface: %p\n"
-+	    "  render version: %i.%i\n"
-+	    "  width: %i\n"
-+	    "  height: %i\n"
-+	    "  depth: %i\n",
-+	    s,
-+	    s->render_major, s->render_minor,
-+	    s->width, s->height, s->depth);
-+    _print_Visual(s->visual);
-+    _print_XRenderPictFormat(s->xrender_format);
-+}
-+
-+
- static cairo_status_t
- _get_image_surface (cairo_xlib_surface_t    *surface,
- 		    cairo_rectangle_int16_t *interest_rect,
-@@ -652,9 +901,14 @@ _get_image_surface (cairo_xlib_surface_t    *surface,
- 						 ximage->bytes_per_line);
- 	if (image->base.status)
- 	    goto FAIL;
-+	if (surface->workaround != WORKAROUND_NONE) {
-+	    fprintf(stderr, "cancelling workaround %s\n", workarounds[surface->workaround]);
-+	    surface->workaround = WORKAROUND_NONE;
-+	}
-     }
-     else
-     {
-+#if 0
- 	/*
- 	 * XXX This can't work.  We must convert the data to one of the
- 	 * supported pixman formats.  Pixman needs another function
-@@ -669,6 +923,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;
-+	int i,j;
-+	
-+	if(surface->visual == NULL) {
-+	    fprintf(stderr, "cairo-xlib: no visual for surface\n");
-+	    goto FAIL;
-+	}
-+
-+	if (surface->workaround == WORKAROUND_NONE) {
-+	    fprintf(stderr, "cairo-xlib: no workaround for surface\n");
-+	    _print_surface(surface);
-+	    goto FAIL;
-+	}
-+	
-+	data = (uint32_t*)malloc(ximage->height * ximage->width * 4);
-+	if(data == NULL) {
-+	    fprintf(stderr, "cairo-xlib: cannot allocate ARGB buffer\n");
-+	    goto FAIL;
-+	}
-+	
-+	switch (surface->workaround) {
-+	    
-+	case WORKAROUND_8BIT_GRAYLEVEL:
-+
-+	    dst = data;
-+	    for(j = 0; j < ximage->height; j++) {
-+		src8 = (uint8_t *) (ximage->data + ximage->bytes_per_line * j);
-+		for(i = 0; i < ximage->width; i++) {
-+		    *dst++ = (*src8 << 16) | (*src8 << 8) | *src8;
-+		    src8++;
-+		}
-+	    }
-+	    break;
-+	    
-+	case WORKAROUND_8BIT_PALETTE:
-+
-+	    if(surface->clut == NULL) {
-+		surface->clut = _get_clut_r3g3b2(
-+		    surface->dpy,
-+		    DefaultColormapOfScreen(surface->screen));
-+	    }
-+
-+	    if(surface->clut == NULL) {
-+		free(data);
-+		goto FAIL;
-+	    }
-+
-+	    clut = surface->clut->clut;
-+	    src8 = (uint8_t*) ximage->data;
-+	    dst = data;
-+	    for(j = 0; j < ximage->height; j++) {
-+		for(i = 0; i < ximage->width; i++)
-+		    *dst++ = clut[src8[i]];
-+		src8 += ximage->bytes_per_line;
-+	    }
-+	    break;
-+
-+	case WORKAROUND_R5G6B5:
-+
-+	    src16 = (uint16_t*)ximage->data;
-+	    dst = data;
-+	    for(j = 0; j < ximage->height; j++) {
-+		for(i = 0; i < ximage->width; i++) {
-+		    *dst++ = ( ( ((src16[i] & 0xf800) << 8) | ((src16[i] & 0xe000) << 3) ) |
-+			       ( ((src16[i] & 0x07e0) << 5) | ((src16[i] & 0x0600) >> 1) ) |
-+			       ( ((src16[i] & 0x001f) << 3) | ((src16[i] & 0x001f) >> 2) ) );
-+		}
-+		src16 += ximage->bytes_per_line / sizeof(*src16);
-+	    }
-+	    break;
-+	default:
-+	    fprintf(stderr, "cairo-xlib: dunno what to do with surface\n");
-+	    _print_surface(surface);
-+	    goto FAIL;
-+	}
-+	free(ximage->data);
-+	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;
-+	}
-+#endif
-     }
- 
-     /* Let the surface take ownership of the data */
-@@ -770,6 +1116,30 @@ _cairo_xlib_surface_ensure_gc (cairo_xlib_surface_t *s
-     return CAIRO_STATUS_SUCCESS;
- }
- 
-+static int
-+make_space_for(unsigned char ** buf, int *size, int *stride, int width, int height, int Bpp) {
-+    unsigned char * data;
-+    int l;
-+
-+    *stride = width * Bpp;
-+    if(*stride%4)
-+	*stride += 4 - *stride % 4;
-+    l = (*stride * height);
-+    if (*size < l) {
-+	if(*buf)
-+	    data = realloc(*buf, l);
-+	else
-+	    data = malloc(l);
-+	if(data) {
-+	    *buf = data;
-+	    *size = l;
-+	} else {
-+	    return -1;
-+	}
-+    } 
-+    return 0;
-+}
-+
- static cairo_status_t
- _draw_image_surface (cairo_xlib_surface_t   *surface,
- 		     cairo_image_surface_t  *image,
-@@ -785,19 +1155,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;
-+    int i, j, depth, stride;
-+    unsigned char *data, *ilut;
-+    uint32_t *src;
-+    uint8_t *dst8;
-+    uint16_t *dst16;
-+
-     pixman_format_get_masks (pixman_image_get_format (image->pixman_image),
- 			     &bpp, &alpha, &red, &green, &blue);
- 
-+
-+    switch(surface->workaround) {
-+
-+    case WORKAROUND_NONE:
-+	/* Default behaviour is supposed to work */
-+	stride = image->stride;
-+	depth = image->depth;
-+	data = image->data;
-+	break;
-+
-+    case WORKAROUND_8BIT_GRAYLEVEL:
-+
-+	if (make_space_for(&buf, &size, &stride, image->width, image->height, 1))
-+	    return CAIRO_STATUS_NO_MEMORY;
-+	data = buf;
-+	
-+	for(j=0;j<image->height;j++) {
-+	    src = (uint32_t*)(image->data);
-+	    dst8 = data + j * stride;
-+	    for(i=0;i<image->width;i++) {
-+		dst8[i] = ( 30 * ((*src >> 16) & 0xff) +
-+			    59 * ((*src >> 8) & 0xff) +
-+			    11 * (*src & 0xff) ) / 100;
-+		src++;
-+	    }
-+	}
-+	
-+	alpha = red = green = blue = 0;
-+	depth = bpp = 8;
-+	break;
-+	
-+    case WORKAROUND_8BIT_PALETTE:
-+	
-+	if (make_space_for(&buf, &size, &stride, image->width, image->height, 1))
-+	    return CAIRO_STATUS_NO_MEMORY;
-+	data = buf;
-+	src = (uint32_t*)image->data;
-+	ilut = surface->clut->ilut;
-+	for(j=0;j<image->height;j++) {
-+	    dst8 = data + j * stride;
-+	    for(i=0;i<image->width;i++) {
-+		dst8[i] = ilut[ ((*src >> 16) & 0xe0) |
-+				((*src >> 11) & 0x1c) |
-+				((*src >> 6)  & 0x03) ];
-+		src++;
-+	    }
-+	}
-+	alpha = red = green = blue = 0;
-+	depth = bpp = 8;
-+	break;
-+
-+    case WORKAROUND_R5G6B5:
-+
-+	if (make_space_for(&buf, &size, &stride, image->width, image->height, 2))
-+	    return CAIRO_STATUS_NO_MEMORY;
-+	data = buf;
-+	src = (uint32_t*)image->data;
-+	for(j=0;j<image->height;j++) {
-+	    dst16 = (uint16_t*)(data + j * stride);
-+	    for(i=0;i<image->width;i++) {
-+		dst16[i] = ( ((*src >> 8) & 0xf800) |
-+			     ((*src >> 5) & 0x07e0) |
-+			     ((*src >> 3) & 0x001f) );
-+		src++;
-+	    }
-+	}
-+	alpha = 0; red = 0xf800; green = 0x07e0; blue = 0x001f;
-+	depth = bpp = 16;
-+	break;
-+    }
-+    
-     ximage.width = image->width;
-     ximage.height = image->height;
-     ximage.format = ZPixmap;
--    ximage.data = (char *)image->data;
-+    ximage.data = data;
-     ximage.byte_order = native_byte_order;
-     ximage.bitmap_unit = 32;	/* always for libpixman */
-     ximage.bitmap_bit_order = native_byte_order;
-     ximage.bitmap_pad = 32;	/* always for libpixman */
--    ximage.depth = image->depth;
--    ximage.bytes_per_line = image->stride;
-+    ximage.depth = depth;
-+    ximage.bytes_per_line = stride;
-     ximage.bits_per_pixel = bpp;
-     ximage.red_mask = red;
-     ximage.green_mask = green;
-@@ -1947,6 +2396,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;
- 
-@@ -2044,7 +2494,38 @@ _cairo_xlib_surface_create_internal (Display		       *
-     surface->have_clip_rects = FALSE;
-     surface->clip_rects = surface->embedded_clip_rects;
-     surface->num_clip_rects = 0;
-+    
-+    surface->clut = NULL;
-+    surface->workaround = WORKAROUND_NONE;
- 
-+    if (visual) {
-+	/* Install the correct workaround */
-+	switch (visual->class) {
-+	case StaticGray:
-+	case GrayScale:
-+	    surface->workaround = WORKAROUND_8BIT_GRAYLEVEL;
-+	    break;
-+	case PseudoColor:
-+	case StaticColor:
-+	    surface->workaround = WORKAROUND_8BIT_PALETTE;
-+	    break;
-+	case TrueColor:
-+	    if (visual->red_mask   == 0xf800 &&
-+		visual->green_mask == 0x07e0 &&
-+		visual->blue_mask  == 0x001f) {
-+		surface->workaround = WORKAROUND_R5G6B5;
-+	    }
-+	}
-+    }
-+
-+    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);
-+    }
-+    
-     return (cairo_surface_t *) surface;
- }
- 
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/graphics/cairo/pkg/PLIST,v
retrieving revision 1.4
diff -u -r1.4 PLIST
--- pkg/PLIST	24 Jul 2007 17:47:07 -0000	1.4
+++ pkg/PLIST	11 Apr 2008 22:45:47 -0000
@@ -48,6 +48,8 @@
 share/gtk-doc/html/cairo/cairo-Paths.html
 share/gtk-doc/html/cairo/cairo-Patterns.html
 share/gtk-doc/html/cairo/cairo-PostScript-Surfaces.html
+share/gtk-doc/html/cairo/cairo-Quartz-Fonts.html
+share/gtk-doc/html/cairo/cairo-Quartz-Surfaces.html
 share/gtk-doc/html/cairo/cairo-SVG-Surfaces.html
 share/gtk-doc/html/cairo/cairo-Scaled-Fonts.html
 share/gtk-doc/html/cairo/cairo-Text.html
@@ -66,13 +68,12 @@
 share/gtk-doc/html/cairo/home.png
 share/gtk-doc/html/cairo/index-1.2.html
 share/gtk-doc/html/cairo/index-1.4.html
+share/gtk-doc/html/cairo/index-1.6.html
 share/gtk-doc/html/cairo/index.html
 share/gtk-doc/html/cairo/index.sgml
 share/gtk-doc/html/cairo/ix01.html
 share/gtk-doc/html/cairo/language-bindings.html
 share/gtk-doc/html/cairo/left.png
-share/gtk-doc/html/cairo/pt01.html
-share/gtk-doc/html/cairo/pt02.html
 share/gtk-doc/html/cairo/right.png
 share/gtk-doc/html/cairo/style.css
 share/gtk-doc/html/cairo/up.png
