rendernode: Check cairo surface status after creation
authorTimm Bäder <mail@baedert.org>
Mon, 19 Mar 2018 07:57:40 +0000 (08:57 +0100)
committerTimm Bäder <mail@baedert.org>
Tue, 20 Mar 2018 08:37:59 +0000 (09:37 +0100)
gdk/gdktexture.c

index 6aeed4152aa255344d560afe210eef5449c85632..c518bac8a4940424794e13fa347f963a4708324b 100644 (file)
@@ -151,9 +151,16 @@ static cairo_surface_t *
 gdk_texture_real_download_surface (GdkTexture *texture)
 {
   cairo_surface_t *surface;
+  cairo_status_t surface_status;
 
   surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
                                         texture->width, texture->height);
+
+  surface_status = cairo_surface_status (surface);
+  if (surface_status != CAIRO_STATUS_SUCCESS)
+    g_warning ("%s: surface error: %s", __FUNCTION__,
+               cairo_status_to_string (surface_status));
+
   gdk_texture_download (texture,
                         cairo_image_surface_get_data (surface),
                         cairo_image_surface_get_stride (surface));