]> Git Repo - qemu.git/blobdiff - ui/qemu-pixman.c
sdl: shorten the GUI refresh interval when mouse or keyboard is active
[qemu.git] / ui / qemu-pixman.c
index 1f6fea535bd7665e293856118c84fb38e28002e5..4116e1507b68d5e9e5a04e3020bce6bfb3502b8f 100644 (file)
@@ -84,7 +84,7 @@ pixman_format_code_t qemu_default_pixman_format(int bpp, bool native_endian)
         break;
         }
     }
-    g_assert_not_reached();
+    return 0;
 }
 
 int qemu_pixman_get_type(int rshift, int gshift, int bshift)
@@ -125,6 +125,33 @@ pixman_format_code_t qemu_pixman_get_format(PixelFormat *pf)
     return format;
 }
 
+/*
+ * Return true for known-good pixman conversions.
+ *
+ * UIs using pixman for format conversion can hook this into
+ * DisplayChangeListenerOps->dpy_gfx_check_format
+ */
+bool qemu_pixman_check_format(DisplayChangeListener *dcl,
+                              pixman_format_code_t format)
+{
+    switch (format) {
+    /* 32 bpp */
+    case PIXMAN_x8r8g8b8:
+    case PIXMAN_a8r8g8b8:
+    case PIXMAN_b8g8r8x8:
+    case PIXMAN_b8g8r8a8:
+    /* 24 bpp */
+    case PIXMAN_r8g8b8:
+    case PIXMAN_b8g8r8:
+    /* 16 bpp */
+    case PIXMAN_x1r5g5b5:
+    case PIXMAN_r5g6b5:
+        return true;
+    default:
+        return false;
+    }
+}
+
 pixman_image_t *qemu_pixman_linebuf_create(pixman_format_code_t format,
                                            int width)
 {
This page took 0.023829 seconds and 4 git commands to generate.