[cairo-commit] 4 commits - boilerplate/cairo-boilerplate-xcb.c configure.ac src/cairo-path-fixed.c src/cairo-xcb-surface-render.c
Uli Schlachter
psychon at kemper.freedesktop.org
Fri Sep 16 09:02:20 PDT 2011
boilerplate/cairo-boilerplate-xcb.c | 16 ++++++----------
configure.ac | 5 +----
src/cairo-path-fixed.c | 2 +-
src/cairo-xcb-surface-render.c | 12 +++++++-----
4 files changed, 15 insertions(+), 20 deletions(-)
New commits:
commit 84d1eac61fd8b5515711bd23b2ac886efd86a42f
Author: Uli Schlachter <psychon at znc.in>
Date: Fri Sep 16 18:00:21 2011 +0200
path: Fix a minor oversight in 1ce5d4707cf26061
The plan was "path: Skip calls to zero-length memcpy". However, this skipped
calls if the buffer was still empty, which means that it skipped all calls.
Fixes: Half the test suite, lots of assertion failures
Signed-off-by: Uli Schlachter <psychon at znc.in>
diff --git a/src/cairo-path-fixed.c b/src/cairo-path-fixed.c
index f4410b3..1e9a759 100644
--- a/src/cairo-path-fixed.c
+++ b/src/cairo-path-fixed.c
@@ -808,7 +808,7 @@ _cairo_path_buf_add_points (cairo_path_buf_t *buf,
const cairo_point_t *points,
int num_points)
{
- if (buf->num_points == 0)
+ if (num_points == 0)
return;
memcpy (buf->points + buf->num_points,
commit a1be14693bb53f1818be2dee90f642143002d6d5
Author: Uli Schlachter <psychon at znc.in>
Date: Fri Sep 16 10:49:28 2011 +0200
boilerplate-xcb: Print sequence numbers
The boilerplate code will now also print the low 16 bits of the sequence number
for errors and events. This should make it a lot easier to find errors in e.g.
a long xtrace output.
Signed-off-by: Uli Schlachter <psychon at znc.in>
diff --git a/boilerplate/cairo-boilerplate-xcb.c b/boilerplate/cairo-boilerplate-xcb.c
index 3e1b681..f9810ee 100644
--- a/boilerplate/cairo-boilerplate-xcb.c
+++ b/boilerplate/cairo-boilerplate-xcb.c
@@ -53,12 +53,14 @@ _cairo_boilerplate_xcb_handle_errors (xcb_target_closure_t *xtc)
xcb_generic_error_t *error = (xcb_generic_error_t *) ev;
fprintf (stderr,
- "Detected error during xcb run: %d major=%d, minor=%d\n",
- error->error_code, error->major_code, error->minor_code);
+ "Detected error during xcb run: error=%d, "
+ "seqno=0x%02x, major=%d, minor=%d\n",
+ error->error_code, error->sequence,
+ error->major_code, error->minor_code);
} else {
fprintf (stderr,
- "Detected unexpected event during xcb run: %d\n",
- ev->response_type);
+ "Detected unexpected event during xcb run: type=%d, seqno=0x%02x\n",
+ ev->response_type, ev->sequence);
}
free (ev);
commit 7ba28ff563ab8a8e77213789860b2d412577a309
Author: Uli Schlachter <psychon at znc.in>
Date: Fri Sep 16 10:43:44 2011 +0200
cairo-xcb: Require libxcb 1.6
Since commit 968eb30bba1dc94, we use xcb_discard_reply(). This function was
added in libxcb 1.6.
"Fixes": https://bugs.freedesktop.org/show_bug.cgi?id=40925
Signed-off-by: Uli Schlachter <psychon at znc.in>
diff --git a/boilerplate/cairo-boilerplate-xcb.c b/boilerplate/cairo-boilerplate-xcb.c
index abb982b..3e1b681 100644
--- a/boilerplate/cairo-boilerplate-xcb.c
+++ b/boilerplate/cairo-boilerplate-xcb.c
@@ -52,15 +52,9 @@ _cairo_boilerplate_xcb_handle_errors (xcb_target_closure_t *xtc)
if (ev->response_type == CAIRO_XCB_ERROR) {
xcb_generic_error_t *error = (xcb_generic_error_t *) ev;
-#if XCB_GENERIC_ERROR_HAS_MAJOR_MINOR_CODES
fprintf (stderr,
"Detected error during xcb run: %d major=%d, minor=%d\n",
error->error_code, error->major_code, error->minor_code);
-#else
- fprintf (stderr,
- "Detected error during xcb run: %d\n",
- error->error_code);
-#endif
} else {
fprintf (stderr,
"Detected unexpected event during xcb run: %d\n",
diff --git a/configure.ac b/configure.ac
index e66ddff..2d3fd36 100644
--- a/configure.ac
+++ b/configure.ac
@@ -101,13 +101,10 @@ CAIRO_ENABLE_SURFACE_BACKEND(xlib_xrender, Xlib Xrender, auto, [
dnl ===========================================================================
CAIRO_ENABLE_SURFACE_BACKEND(xcb, XCB, auto, [
- xcb_REQUIRES="xcb >= 1.1.92 xcb-render >= 0.9.92"
+ xcb_REQUIRES="xcb >= 1.6 xcb-render >= 1.6"
PKG_CHECK_MODULES(xcb, $xcb_REQUIRES, ,
[AC_MSG_RESULT(no)
use_xcb="no (requires $xcb_REQUIRES http://xcb.freedesktop.org)"])
- if $PKG_CONFIG --atleast-version=1.4 xcb; then
- CAIRO_CFLAGS="$CAIRO_CFLAGS -DXCB_GENERIC_ERROR_HAS_MAJOR_MINOR_CODES"
- fi
])
CAIRO_ENABLE_FUNCTIONS(xlib_xcb, Xlib/XCB, no, [
commit b6c3fea672592a77b0b6fa487b403c981921b13a
Author: Uli Schlachter <psychon at znc.in>
Date: Thu Sep 15 16:27:20 2011 +0200
xcb: Improve error cases in _clip_and_composite_combine
This makes sure that errors from _cairo_clip_get_surface() aren't lost and that
we really got an xcb surface.
Signed-off-by: Uli Schlachter <psychon at znc.in>
diff --git a/src/cairo-xcb-surface-render.c b/src/cairo-xcb-surface-render.c
index a6a8c77..88333e3 100644
--- a/src/cairo-xcb-surface-render.c
+++ b/src/cairo-xcb-surface-render.c
@@ -1827,7 +1827,7 @@ _clip_and_composite_combine (cairo_clip_t *clip,
const cairo_rectangle_int_t*extents)
{
cairo_xcb_surface_t *tmp;
- cairo_surface_t *clip_surface;
+ cairo_xcb_surface_t *clip_surface;
int clip_x, clip_y;
xcb_render_picture_t clip_picture;
cairo_status_t status;
@@ -1890,11 +1890,13 @@ _clip_and_composite_combine (cairo_clip_t *clip,
if (unlikely (status))
goto CLEANUP_SURFACE;
- clip_surface = _cairo_clip_get_surface (clip, &dst->base, &clip_x, &clip_y);
- if (unlikely (clip_surface->status))
+ clip_surface = (cairo_xcb_surface_t *) _cairo_clip_get_surface (clip, &dst->base, &clip_x, &clip_y);
+ status = clip_surface->base.status;
+ if (unlikely (status))
goto CLEANUP_SURFACE;
- clip_picture = ((cairo_xcb_surface_t *) clip_surface)->picture;
+ assert (clip_surface->base.backend == &_cairo_xcb_surface_backend);
+ clip_picture = clip_surface->picture;
assert (clip_picture != XCB_NONE);
if (dst->base.is_clear) {
@@ -1926,7 +1928,7 @@ _clip_and_composite_combine (cairo_clip_t *clip,
extents->x, extents->y,
extents->width, extents->height);
}
- cairo_surface_destroy (clip_surface);
+ cairo_surface_destroy (&clip_surface->base);
CLEANUP_SURFACE:
cairo_surface_destroy (&tmp->base);
More information about the cairo-commit
mailing list