[cairo-commit] 2 commits - ROADMAP src/cairo-xlib.h src/cairo-xlib-surface.c test/xlib-surface.c

Carl Worth cworth at kemper.freedesktop.org
Sun Jun 25 02:30:55 PDT 2006


 ROADMAP                  |    5 ++++-
 src/cairo-xlib-surface.c |   26 ++++++++++++++++++++++++++
 src/cairo-xlib.h         |    6 ++++++
 test/xlib-surface.c      |    7 ++++++-
 4 files changed, 42 insertions(+), 2 deletions(-)

New commits:
diff-tree ddead8e0612162e121868ba561498b8565112f8b (from 113bef399a2ca27f4c49a3d917ac1e6075449616)
Author: Robert O'Callahan <rocallahan at novell.com>
Date:   Wed Jun 21 15:47:03 2006 +1200

    Surface size getters for xlib
    
    When accessing the underlying drawable etc of an xlib surface, it is
    also helpful to be able to get the width and height without a server
    round trip. This patch provides those functions.

diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
index 32e2bd9..051bf10 100644
--- a/src/cairo-xlib-surface.c
+++ b/src/cairo-xlib-surface.c
@@ -2147,6 +2147,32 @@ cairo_xlib_surface_get_depth (cairo_surf
     return surface->depth;
 }
 
+int
+cairo_xlib_surface_get_width (cairo_surface_t *abstract_surface)
+{
+    cairo_xlib_surface_t *surface = (cairo_xlib_surface_t *) abstract_surface;
+
+    if (! _cairo_surface_is_xlib (abstract_surface)) {
+	_cairo_error (CAIRO_STATUS_SURFACE_TYPE_MISMATCH);
+	return -1;
+    }
+
+    return surface->width;
+}
+
+int
+cairo_xlib_surface_get_height (cairo_surface_t *abstract_surface)
+{
+    cairo_xlib_surface_t *surface = (cairo_xlib_surface_t *) abstract_surface;
+
+    if (! _cairo_surface_is_xlib (abstract_surface)) {
+	_cairo_error (CAIRO_STATUS_SURFACE_TYPE_MISMATCH);
+	return -1;
+    }
+
+    return surface->height;
+}
+
 typedef struct _cairo_xlib_surface_font_private {
     Display		*dpy;
     GlyphSet		glyphset;
diff --git a/src/cairo-xlib.h b/src/cairo-xlib.h
index f7802fd..ad92b39 100644
--- a/src/cairo-xlib.h
+++ b/src/cairo-xlib.h
@@ -85,6 +85,12 @@ cairo_xlib_surface_get_visual (cairo_sur
 cairo_public int
 cairo_xlib_surface_get_depth (cairo_surface_t *surface);
 
+cairo_public int
+cairo_xlib_surface_get_width (cairo_surface_t *surface);
+
+cairo_public int
+cairo_xlib_surface_get_height (cairo_surface_t *surface);
+
 CAIRO_END_DECLS
 
 #else  /* CAIRO_HAS_XLIB_SURFACE */
diff --git a/test/xlib-surface.c b/test/xlib-surface.c
index 7179781..f12e490 100644
--- a/test/xlib-surface.c
+++ b/test/xlib-surface.c
@@ -124,9 +124,14 @@ do_test (Display        *dpy,
 					 DefaultVisual (dpy, screen),
 					 SIZE, SIZE);
 
-    if (set_size)
+    if (set_size) {
 	cairo_xlib_surface_set_size (surface, SIZE, SIZE);
 
+	if (cairo_xlib_surface_get_width (surface) != SIZE ||
+	    cairo_xlib_surface_get_height (surface) != SIZE)
+	    return 0;
+    }
+
     draw_pattern (surface);
 
     test_surface = cairo_image_surface_create_for_data (test_data,
diff-tree 113bef399a2ca27f4c49a3d917ac1e6075449616 (from 9ab5678e53219f95de7183e300bba3edac7fe72d)
Author: Carl Worth <cworth at cworth.org>
Date:   Sun Jun 25 11:20:50 2006 +0200

    ROADMAP: Note that bug 6617 might already be fixed.

diff --git a/ROADMAP b/ROADMAP
index 8b9305c..a7041e4 100644
--- a/ROADMAP
+++ b/ROADMAP
@@ -54,7 +54,6 @@ cairo 1.2.0 plans
      add cairo_xlib_surface_get_width/height
 
  Bug fixes (For each XXXX, see: https://bugs.freedesktop.org/show_bug.cgi?id=XXXX )
-     6617  With cairo 1.0.4 some text just disappears
      6759  fontconfig option AntiAlias doesn't work in cairo 1.1.2
     ✓6955  Some characters aren't displayed when using xlib (cache u...
     ✓7268  positive device_offset values don't work as source
@@ -67,6 +66,10 @@ cairo 1.2.0 plans
  Fix memory leaks
      1. Ensure 'make check-valgrind' passes with no leaks
 
+ Bugs that might already be fixed anyway
+ ---------------------------------------
+     6617  With cairo 1.0.4 some text just disappears
+
  Bugs that won't be fixed
  ------------------------
      6806  cairo 1.0.4 crash progressbar in window


More information about the cairo-commit mailing list