[cairo-commit] 2 commits - boilerplate/cairo-boilerplate.c
src/cairo-xcb-surface.c
Ian Osgood
iano at kemper.freedesktop.org
Wed Oct 18 08:16:04 PDT 2006
boilerplate/cairo-boilerplate.c | 8 ++++----
src/cairo-xcb-surface.c | 20 ++++++++++----------
2 files changed, 14 insertions(+), 14 deletions(-)
New commits:
diff-tree c1f134fa13928f31c903d513920448b127749a4b (from parents)
Merge: 968ceeec1d2223e823ec56883bc00da512549ea5 157663e1fdf120a71c6cc8222b88d2915a5a73eb
Author: Ian Osgood <iano at quirkster.com>
Date: Wed Oct 18 08:15:47 2006 -0700
Merge branch 'master' of git+ssh://iano@git.cairographics.org/git/cairo
diff-tree 968ceeec1d2223e823ec56883bc00da512549ea5 (from e2a0c57c1fc20f3e2ee641273b5f059ca221d265)
Author: Ian Osgood <iano at quirkster.com>
Date: Wed Oct 18 08:14:55 2006 -0700
XCB: find_standard_format using wrong enumeration.
Requires latest xcb/util/renderutil library from git.
diff --git a/boilerplate/cairo-boilerplate.c b/boilerplate/cairo-boilerplate.c
index 0320816..27f9a2d 100644
--- a/boilerplate/cairo-boilerplate.c
+++ b/boilerplate/cairo-boilerplate.c
@@ -800,7 +800,7 @@ create_xcb_surface (const char *name,
cairo_surface_t *surface;
xcb_connection_t *c;
xcb_render_pictforminfo_t *render_format;
- cairo_format_t format;
+ xcb_pict_standard_t format;
*closure = xtc = xmalloc (sizeof (xcb_target_closure_t));
@@ -823,12 +823,12 @@ create_xcb_surface (const char *name,
switch (content) {
case CAIRO_CONTENT_COLOR:
- format = CAIRO_FORMAT_RGB24;
+ format = XCB_PICT_STANDARD_RGB_24;
break;
case CAIRO_CONTENT_COLOR_ALPHA:
- format = CAIRO_FORMAT_ARGB32;
+ format = XCB_PICT_STANDARD_ARGB_32;
break;
- case CAIRO_CONTENT_ALPHA:
+ case CAIRO_CONTENT_ALPHA: /* would be XCB_PICT_STANDARD_A_8 */
default:
CAIRO_BOILERPLATE_LOG ("Invalid content for XCB test: %d\n", content);
return NULL;
diff --git a/src/cairo-xcb-surface.c b/src/cairo-xcb-surface.c
index 60f79a8..4039605 100644
--- a/src/cairo-xcb-surface.c
+++ b/src/cairo-xcb-surface.c
@@ -37,7 +37,7 @@
#include "cairoint.h"
#include "cairo-xcb.h"
#include "cairo-xcb-xrender.h"
-#include "cairo-clip-private.h" /* XXX */
+#include "cairo-clip-private.h"
#include <xcb/xcb_renderutil.h>
#define AllPlanes ((unsigned long)~0L)
@@ -125,19 +125,19 @@ _CAIRO_FORMAT_DEPTH (cairo_format_t form
static xcb_render_pictforminfo_t *
_CAIRO_FORMAT_TO_XRENDER_FORMAT(xcb_connection_t *dpy, cairo_format_t format)
{
- int pict_format;
+ xcb_pict_standard_t std_format;
switch (format) {
case CAIRO_FORMAT_A1:
- pict_format = PictStandardA1; break;
+ std_format = XCB_PICT_STANDARD_A_1; break;
case CAIRO_FORMAT_A8:
- pict_format = PictStandardA8; break;
+ std_format = XCB_PICT_STANDARD_A_8; break;
case CAIRO_FORMAT_RGB24:
- pict_format = PictStandardRGB24; break;
+ std_format = XCB_PICT_STANDARD_RGB_24; break;
case CAIRO_FORMAT_ARGB32:
default:
- pict_format = PictStandardARGB32; break;
+ std_format = XCB_PICT_STANDARD_ARGB_32; break;
}
- return xcb_render_util_find_standard_format (xcb_render_util_query_formats (dpy), format);
+ return xcb_render_util_find_standard_format (xcb_render_util_query_formats (dpy), std_format);
}
static cairo_content_t
@@ -192,7 +192,7 @@ _cairo_xcb_surface_create_similar (void
width <= 0 ? 1 : width,
height <= 0 ? 1 : height);
- xrender_format = xcb_render_util_find_standard_format (xcb_render_util_query_formats (dpy), format);
+ xrender_format = _CAIRO_FORMAT_TO_XRENDER_FORMAT (dpy, format);
/* XXX: what to do if xrender_format is null? */
surface = (cairo_xcb_surface_t *)
cairo_xcb_surface_create_with_xrender_format (dpy, pixmap, src->screen,
@@ -1187,7 +1187,7 @@ _cairo_xcb_surface_composite_trapezoids
cairo_format = CAIRO_FORMAT_A8;
break;
}
- render_format = xcb_render_util_find_standard_format (xcb_render_util_query_formats (dst->dpy), cairo_format);
+ render_format = _CAIRO_FORMAT_TO_XRENDER_FORMAT (dst->dpy, cairo_format);
/* XXX: what to do if render_format is null? */
if (traps[0].left.p1.y < traps[0].left.p2.y) {
@@ -1462,7 +1462,7 @@ _cairo_xcb_surface_create_internal (xcb_
pict_format = &pict_visual->format;
} else if (depth == 1) {
xcb_render_pictforminfo_t *format_info;
- format_info = xcb_render_util_find_standard_format (xcb_render_util_query_formats (dpy), CAIRO_FORMAT_A1);
+ format_info = _CAIRO_FORMAT_TO_XRENDER_FORMAT (dpy, CAIRO_FORMAT_A1);
if (format_info)
pict_format = &format_info->id;
}
More information about the cairo-commit
mailing list