[cairo-commit] 3 commits - perf/cairo-perf-graph-files.c perf/cairo-perf-print.c src/cairo-xcb-shm.c src/cairo-xcb-surface.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Nov 18 02:05:54 PST 2011


 perf/cairo-perf-graph-files.c |    2 +-
 perf/cairo-perf-print.c       |    2 +-
 src/cairo-xcb-shm.c           |    2 +-
 src/cairo-xcb-surface.c       |   10 ++++++----
 4 files changed, 9 insertions(+), 7 deletions(-)

New commits:
commit 9ecc3aafca25cdf215ce74fe1edbddfdf18b3e10
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Nov 18 10:04:12 2011 +0000

    perf: Compile fix, add the index to cairo_perf_report_load()
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/perf/cairo-perf-graph-files.c b/perf/cairo-perf-graph-files.c
index 0ac4b7c..1fd99e4 100644
--- a/perf/cairo-perf-graph-files.c
+++ b/perf/cairo-perf-graph-files.c
@@ -576,7 +576,7 @@ main (int   argc,
 
     reports = xmalloc ((argc-1) * sizeof (cairo_perf_report_t));
     for (i = 1; i < argc; i++ )
-	cairo_perf_report_load (&reports[i-1], argv[i], NULL);
+	cairo_perf_report_load (&reports[i-1], argv[i], i, NULL);
 
     cases = test_cases_from_reports (reports, argc-1);
 
diff --git a/perf/cairo-perf-print.c b/perf/cairo-perf-print.c
index 146f79b..16a3ff4 100644
--- a/perf/cairo-perf-print.c
+++ b/perf/cairo-perf-print.c
@@ -65,7 +65,7 @@ main (int	  argc,
     for (i = 1; i < argc; i++ ) {
 	cairo_perf_report_t report;
 
-	cairo_perf_report_load (&report, argv[i], NULL);
+	cairo_perf_report_load (&report, argv[i], i, NULL);
 	report_print (&report);
     }
 
commit 2283ab969801ef6c610ad20a58693a5b55382c8a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Nov 18 10:01:55 2011 +0000

    xcb: Handle SHM exhaustion gracefully
    
    Avoid the assertion failure of creating an error surface for an internal
    status by handling the expected UNSUPPORTED condition.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-xcb-surface.c b/src/cairo-xcb-surface.c
index 75a1f87..cf64949 100644
--- a/src/cairo-xcb-surface.c
+++ b/src/cairo-xcb-surface.c
@@ -240,8 +240,12 @@ _cairo_xcb_surface_create_shm_image (cairo_xcb_connection_t *connection,
 						      stride * height,
 						      might_reuse,
 						      &shm_info);
-    if (unlikely (status))
+    if (unlikely (status)) {
+	if (status == CAIRO_INT_STATUS_UNUSPPORTED)
+	    return NULL;
+
 	return _cairo_surface_create_in_error (status);
+    }
 
     image = _cairo_image_surface_create_with_pixman_format (shm_info->mem,
 							    pixman_format,
@@ -354,9 +358,7 @@ _get_image (cairo_xcb_surface_t		 *surface,
     if (use_shm) {
 	image = _get_shm_image (surface, x, y, width, height);
 	if (image) {
-	    /* XXX This only wants to catch SHM exhaustion,
-	     * not other allocation failures. */
-	    if (image->status != CAIRO_STATUS_NO_MEMORY) {
+	    if (image->status) {
 		_cairo_xcb_connection_release (connection);
 		return image;
 	    }
commit c8dca5dad678258ee1bf7d60f5a6f766060c7fce
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Nov 18 09:59:34 2011 +0000

    Revert "xcb: Fix xcb-huge-image-shm"
    
    This reverts commit 3a94f4c7091ea6262007e7960e4cd915e17b33c0.
    
    We need to fallback to pushing large images over the wire if we exhaust
    the SHM space.

diff --git a/src/cairo-xcb-shm.c b/src/cairo-xcb-shm.c
index 7eee83d..6972720 100644
--- a/src/cairo-xcb-shm.c
+++ b/src/cairo-xcb-shm.c
@@ -577,7 +577,7 @@ _cairo_xcb_connection_allocate_shm_info (cairo_xcb_connection_t *connection,
 	    connection->flags &= ~CAIRO_XCB_HAS_SHM;
 	free (pool);
 	CAIRO_MUTEX_UNLOCK (connection->shm_mutex);
-	return _cairo_error (CAIRO_STATUS_NO_MEMORY);
+	return CAIRO_INT_STATUS_UNSUPPORTED;
     }
 
     pool->base = shmat (pool->shmid, NULL, 0);


More information about the cairo-commit mailing list