diff options
author | Alexander Larsson <alexl@redhat.com> | 2010-04-30 09:52:42 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2010-04-30 09:54:01 +0200 |
commit | 295c8ed8bc508d69c88ec83b82afc4573500ff12 (patch) | |
tree | d4007b07294e0decd51b64357297eb34ab7ab7fe | |
parent | 7425253cec090e80cefd9390b3d34780b4bca899 (diff) | |
download | spice-295c8ed8bc508d69c88ec83b82afc4573500ff12.tar.gz spice-295c8ed8bc508d69c88ec83b82afc4573500ff12.tar.xz spice-295c8ed8bc508d69c88ec83b82afc4573500ff12.zip |
Don't send alpha bytes for primary surface
The framebuffer is not used as a source for alpha blends, so we never
need to scan it for alpha bytes.
-rw-r--r-- | server/red_worker.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/server/red_worker.c b/server/red_worker.c index 3cd93743..e9b2ade2 100644 --- a/server/red_worker.c +++ b/server/red_worker.c @@ -3653,7 +3653,10 @@ static inline int red_handle_self_bitmap(RedWorker *worker, Drawable *drawable) red_get_area(worker, drawable->surface_id, &drawable->qxl_drawable->self_bitmap_area, dest, dest_stride, TRUE); - if (image->bitmap.format == SPICE_BITMAP_FMT_32BIT && + /* For 32bit non-primary surfaces we need to keep any non-zero + high bytes as the surface may be used as source to an alpha_blend */ + if (!is_primary_surface(worker, drawable->surface_id) && + image->bitmap.format == SPICE_BITMAP_FMT_32BIT && rgb32_data_has_alpha(width, height, dest_stride, dest, &all_set)) { if (all_set) { image->descriptor.flags |= SPICE_IMAGE_FLAGS_HIGH_BITS_SET; @@ -4987,7 +4990,10 @@ static void red_add_surface_image(RedWorker *worker, int surface_id) area.bottom = surface->context.height; canvas->ops->read_bits(canvas, item->data, stride, &area); - if (item->image_format == SPICE_BITMAP_FMT_32BIT && + /* For 32bit non-primary surfaces we need to keep any non-zero + high bytes as the surface may be used as source to an alpha_blend */ + if (!is_primary_surface(worker, surface_id) && + item->image_format == SPICE_BITMAP_FMT_32BIT && rgb32_data_has_alpha(item->width, item->height, item->stride, item->data, &all_set)) { if (all_set) { item->image_flags |= SPICE_IMAGE_FLAGS_HIGH_BITS_SET; |