summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJavier Celaya <javier.celaya@flexvm.es>2015-01-28 11:49:48 +0100
committerChristophe Fergeau <cfergeau@redhat.com>2015-02-03 10:46:34 +0100
commit9287e53b6c978a2c8eaf3d7f820276e34a678a92 (patch)
tree5074fa2d4dbf53fa53d4520202d353b3bc254ab4 /common
parentd167e2ead84b62f7af08a153dc95365910796ae5 (diff)
LZ4: Add support for 24bit pixman surfaces
Diffstat (limited to 'common')
-rw-r--r--common/canvas_base.c3
-rw-r--r--common/canvas_utils.c8
2 files changed, 11 insertions, 0 deletions
diff --git a/common/canvas_base.c b/common/canvas_base.c
index 2f22400..7394105 100644
--- a/common/canvas_base.c
+++ b/common/canvas_base.c
@@ -543,6 +543,9 @@ static pixman_image_t *canvas_get_lz4(CanvasBase *canvas, SpiceImage *image)
stride_encoded *= 2;
break;
case SPICE_BITMAP_FMT_24BIT:
+ format = PIXMAN_r8g8b8;
+ stride_encoded *= 3;
+ break;
case SPICE_BITMAP_FMT_32BIT:
format = PIXMAN_x8r8g8b8;
stride_encoded *= 4;
diff --git a/common/canvas_utils.c b/common/canvas_utils.c
index d52292b..0d1591a 100644
--- a/common/canvas_utils.c
+++ b/common/canvas_utils.c
@@ -165,6 +165,10 @@ pixman_image_t * surface_create(pixman_format_code_t format, int width, int heig
bitmap_info.inf.bmiHeader.biBitCount = 32;
nstride = width * 4;
break;
+ case PIXMAN_r8g8b8:
+ bitmap_info.inf.bmiHeader.biBitCount = 24;
+ nstride = SPICE_ALIGN(width * 3, 4);
+ break;
case PIXMAN_x1r5g5b5:
case PIXMAN_r5g6b5:
bitmap_info.inf.bmiHeader.biBitCount = 16;
@@ -233,6 +237,10 @@ pixman_image_t * surface_create(pixman_format_code_t format, int width, int heig
case PIXMAN_x8r8g8b8:
stride = width * 4;
break;
+ case PIXMAN_r8g8b8:
+ // NOTE: LZ4 also decodes to RGB24
+ stride = SPICE_ALIGN(width * 3, 4);
+ break;
case PIXMAN_x1r5g5b5:
case PIXMAN_r5g6b5:
stride = SPICE_ALIGN(width * 2, 4);