diff options
author | Pavel Grunt <pgrunt@redhat.com> | 2015-06-19 14:03:51 +0200 |
---|---|---|
committer | Pavel Grunt <pgrunt@redhat.com> | 2015-07-13 11:52:09 +0200 |
commit | 071647780dbda4fabf31e6b09940c14b62313913 (patch) | |
tree | b729882ec9f4f53d47986da5d1deba8805ad65cf | |
parent | c914e96fb4de3ba8b2df174d7c7af8ff76af1081 (diff) |
Use desired image compression for the first image
red_marshall_image() allows to use other than QUIC compression only
when auto_lz or auto_glz image compression is set. Other images don't
have the problem because they are compressed using red_compress_image()
-rw-r--r-- | server/red_worker.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/server/red_worker.c b/server/red_worker.c index 10717167..74c585a5 100644 --- a/server/red_worker.c +++ b/server/red_worker.c @@ -8812,9 +8812,9 @@ static void red_marshall_image(RedChannelClient *rcc, SpiceMarshaller *m, ImageI SpiceBitmap bitmap; SpiceChunks *chunks; QRegion *surface_lossy_region; - int comp_succeeded; + int comp_succeeded = FALSE; int lossy_comp = FALSE; - int lz_comp = FALSE; + int quic_comp = FALSE; SpiceImageCompress comp_mode; SpiceMsgDisplayDrawCopy copy; SpiceMarshaller *src_bitmap_out, *mask_bitmap_out; @@ -8883,12 +8883,11 @@ static void red_marshall_image(RedChannelClient *rcc, SpiceMarshaller *m, ImageI if (grad_level == BITMAP_GRADUAL_HIGH) { // if we use lz for alpha, the stride can't be extra lossy_comp = display_channel->enable_jpeg && item->can_lossy; - } else { - lz_comp = TRUE; + quic_comp = TRUE; } - } else { - lz_comp = TRUE; } + } else if (comp_mode == SPICE_IMAGE_COMPRESS_QUIC) { + quic_comp = TRUE; } if (lossy_comp) { @@ -8896,7 +8895,7 @@ static void red_marshall_image(RedChannelClient *rcc, SpiceMarshaller *m, ImageI &bitmap, &comp_send_data, worker->mem_slots.internal_groupslot_id); } else { - if (!lz_comp) { + if (quic_comp) { comp_succeeded = red_quic_compress_image(dcc, &red_image, &bitmap, &comp_send_data, worker->mem_slots.internal_groupslot_id); @@ -8911,6 +8910,7 @@ static void red_marshall_image(RedChannelClient *rcc, SpiceMarshaller *m, ImageI worker->mem_slots.internal_groupslot_id); } else #endif + if (comp_mode != SPICE_IMAGE_COMPRESS_OFF) comp_succeeded = red_lz_compress_image(dcc, &red_image, &bitmap, &comp_send_data, worker->mem_slots.internal_groupslot_id); |