LZ4: Add support for 24bit pixman surfaces

This commit is contained in:
Javier Celaya 2015-01-28 11:49:48 +01:00 committed by Christophe Fergeau
parent d167e2ead8
commit 9287e53b6c
2 changed files with 11 additions and 0 deletions

View File

@ -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;

View File

@ -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);