[Spice-devel] [PATCH v2] server: move LZ_IMAGE_TYPE_* enum to dcc

Fabiano Fidêncio fidencio at redhat.com
Thu Nov 26 05:07:13 PST 2015


From: Marc-André Lureau <marcandre.lureau at gmail.com>

Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
---
 server/dcc.c        | 18 ++++++++++++++++--
 server/red_common.h | 14 --------------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/server/dcc.c b/server/dcc.c
index 6c089da..ffe5b34 100644
--- a/server/dcc.c
+++ b/server/dcc.c
@@ -616,6 +616,20 @@ static GlzDrawableInstanceItem *add_glz_drawable_instance(RedGlzDrawable *glz_dr
     return ret;
 }
 
+static const LzImageType bitmap_fmt_to_lz_image_type[] = {
+    LZ_IMAGE_TYPE_INVALID,
+    LZ_IMAGE_TYPE_PLT1_LE,
+    LZ_IMAGE_TYPE_PLT1_BE,
+    LZ_IMAGE_TYPE_PLT4_LE,
+    LZ_IMAGE_TYPE_PLT4_BE,
+    LZ_IMAGE_TYPE_PLT8,
+    LZ_IMAGE_TYPE_RGB16,
+    LZ_IMAGE_TYPE_RGB24,
+    LZ_IMAGE_TYPE_RGB32,
+    LZ_IMAGE_TYPE_RGBA,
+    LZ_IMAGE_TYPE_A8
+};
+
 #define MIN_GLZ_SIZE_FOR_ZLIB 100
 
 int dcc_compress_image_glz(DisplayChannelClient *dcc,
@@ -629,7 +643,7 @@ int dcc_compress_image_glz(DisplayChannelClient *dcc,
     spice_assert(bitmap_fmt_is_rgb(src->format));
     GlzData *glz_data = &dcc->glz_data;
     ZlibData *zlib_data;
-    LzImageType type = MAP_BITMAP_FMT_TO_LZ_IMAGE_TYPE[src->format];
+    LzImageType type = bitmap_fmt_to_lz_image_type[src->format];
     RedGlzDrawable *glz_drawable;
     GlzDrawableInstanceItem *glz_drawable_instance;
     int glz_size;
@@ -710,7 +724,7 @@ int dcc_compress_image_lz(DisplayChannelClient *dcc,
 {
     LzData *lz_data = &dcc->lz_data;
     LzContext *lz = dcc->lz;
-    LzImageType type = MAP_BITMAP_FMT_TO_LZ_IMAGE_TYPE[src->format];
+    LzImageType type = bitmap_fmt_to_lz_image_type[src->format];
     int size;            // size of the compressed data
 
 #ifdef COMPRESS_STAT
diff --git a/server/red_common.h b/server/red_common.h
index 04d4c02..7f1677e 100644
--- a/server/red_common.h
+++ b/server/red_common.h
@@ -30,18 +30,4 @@
 
 #define SPICE_GNUC_VISIBLE __attribute__ ((visibility ("default")))
 
-static const LzImageType MAP_BITMAP_FMT_TO_LZ_IMAGE_TYPE[] = {
-    LZ_IMAGE_TYPE_INVALID,
-    LZ_IMAGE_TYPE_PLT1_LE,
-    LZ_IMAGE_TYPE_PLT1_BE,
-    LZ_IMAGE_TYPE_PLT4_LE,
-    LZ_IMAGE_TYPE_PLT4_BE,
-    LZ_IMAGE_TYPE_PLT8,
-    LZ_IMAGE_TYPE_RGB16,
-    LZ_IMAGE_TYPE_RGB24,
-    LZ_IMAGE_TYPE_RGB32,
-    LZ_IMAGE_TYPE_RGBA,
-    LZ_IMAGE_TYPE_A8
-};
-
 #endif
-- 
2.5.0



More information about the Spice-devel mailing list