summaryrefslogtreecommitdiffstats
path: root/server/spice_bitmap_utils.c
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2013-08-12 15:20:38 +0300
committerAlon Levy <alevy@redhat.com>2013-08-14 12:08:04 +0300
commit7241cc9544de818eb07de7dd99d72f8451ed8038 (patch)
tree0d547db471127bc59a3a49d31075891973c18415 /server/spice_bitmap_utils.c
parent9b8ff0428468b7f081fe6f2b27774af2d0b4dadf (diff)
downloadspice-7241cc9544de818eb07de7dd99d72f8451ed8038.tar.gz
spice-7241cc9544de818eb07de7dd99d72f8451ed8038.tar.xz
spice-7241cc9544de818eb07de7dd99d72f8451ed8038.zip
server: move surface_format_to_image_type to spice_bitmap_utils
Diffstat (limited to 'server/spice_bitmap_utils.c')
-rw-r--r--server/spice_bitmap_utils.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/server/spice_bitmap_utils.c b/server/spice_bitmap_utils.c
index 90446222..ce0a5ed0 100644
--- a/server/spice_bitmap_utils.c
+++ b/server/spice_bitmap_utils.c
@@ -5,6 +5,23 @@
#include "spice_bitmap_utils.h"
+int spice_bitmap_from_surface_type(uint32_t surface_format)
+{
+ switch (surface_format) {
+ case SPICE_SURFACE_FMT_16_555:
+ return SPICE_BITMAP_FMT_16BIT;
+ case SPICE_SURFACE_FMT_32_xRGB:
+ return SPICE_BITMAP_FMT_32BIT;
+ case SPICE_SURFACE_FMT_32_ARGB:
+ return SPICE_BITMAP_FMT_RGBA;
+ case SPICE_SURFACE_FMT_8_A:
+ return SPICE_BITMAP_FMT_8BIT_A;
+ default:
+ spice_critical("Unsupported surface format");
+ }
+ return 0;
+}
+
#define RAM_PATH "/tmp/tmpfs"
static void dump_palette(FILE *f, SpicePalette* plt)