diff options
author | Søren Sandmann <ssp@redhat.com> | 2012-08-12 11:07:06 -0400 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@redhat.com> | 2012-08-23 17:34:33 -0400 |
commit | 0fb7ff57dede226f5f016e80da21355884bffc24 (patch) | |
tree | 3428a04ef6ce1b8c749b7518d0dd3e06909294df | |
parent | 65120be68d95e01bf2a8b17835466c21d20250db (diff) |
Set FORCE_OPAQUE flags for x8r8g8b8 pictures where the underlying surface is argb
-rw-r--r-- | src/qxl_surface.c | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/src/qxl_surface.c b/src/qxl_surface.c index 1bf63d5..512b304 100644 --- a/src/qxl_surface.c +++ b/src/qxl_surface.c @@ -1389,13 +1389,6 @@ qxl_surface_prepare_composite (int op, qxl_surface_t * mask, qxl_surface_t * dest) { -#if 0 - if (src_picture && src_picture->format == PICT_a8) - return FALSE; - if (mask_picture && mask_picture->format == PICT_a8) - return FALSE; -#endif - dest->u.composite.op = op; dest->u.composite.src_picture = src_picture; dest->u.composite.mask_picture = mask_picture; @@ -1408,18 +1401,24 @@ qxl_surface_prepare_composite (int op, } static QXLImage * -image_from_picture (qxl_screen_t *qxl, PicturePtr picture, qxl_surface_t *surface) +image_from_picture (qxl_screen_t *qxl, + PicturePtr picture, + qxl_surface_t *surface, + int *force_opaque) { struct QXLImage *image = qxl_allocnf (qxl, sizeof *image); - ErrorF ("Image from picture surface id: %d\n", surface->id); - image->descriptor.id = 0; image->descriptor.type = SPICE_IMAGE_TYPE_SURFACE; image->descriptor.width = 0; image->descriptor.height = 0; image->surface_image.surface_id = surface->id; + if (picture->format == PICT_x8r8g8b8) + *force_opaque = TRUE; + else + *force_opaque = FALSE; + return image; } @@ -1479,18 +1478,22 @@ qxl_surface_composite (qxl_surface_t *dest, QXLImage *img; QXLTransform *trans; int n_deps = 0; + int force_opaque; +#if 0 ErrorF ("QXL Composite: src: %x (%d %d) id: %d; \n" " mask: id: %d\n" - " dest rect: %d %d %d %d (id: %d)\n", + " dest: %x %d %d %d %d (id: %d)\n", dest->u.composite.src_picture->format, dest->u.composite.src_picture->pDrawable->width, dest->u.composite.src_picture->pDrawable->height, dest->u.composite.src->id, dest->u.composite.mask? dest->u.composite.mask->id : -1, + dest->u.composite.dest_picture->format, dest_x, dest_y, width, height, dest->id ); +#endif rect.left = dest_x; rect.right = dest_x + width; @@ -1503,9 +1506,14 @@ qxl_surface_composite (qxl_surface_t *dest, composite->flags = 0; + if (dest->u.composite.dest_picture->format == PICT_x8r8g8b8) + composite->flags |= SPICE_COMPOSITE_DEST_OPAQUE; + composite->flags |= (op & 0xff); - img = image_from_picture (qxl, src, qsrc); + img = image_from_picture (qxl, src, qsrc, &force_opaque); + if (force_opaque) + composite->flags |= SPICE_COMPOSITE_SOURCE_OPAQUE; composite->src = physical_address (qxl, img, qxl->main_mem_slot); composite->flags |= (src->filter << 8); composite->flags |= (src->repeat << 14); @@ -1520,8 +1528,9 @@ qxl_surface_composite (qxl_surface_t *dest, if (mask) { - img = image_from_picture (qxl, mask, qmask); - + img = image_from_picture (qxl, mask, qmask, &force_opaque); + if (force_opaque) + composite->flags |= SPICE_COMPOSITE_MASK_OPAQUE; composite->mask = physical_address (qxl, img, qxl->main_mem_slot); composite->flags |= (mask->filter << 11); composite->flags |= (mask->repeat << 16); @@ -1544,8 +1553,6 @@ qxl_surface_composite (qxl_surface_t *dest, drawable->surfaces_dest[n_deps] = dest->id; drawable->surfaces_rects[n_deps] = full_rect (dest); - ErrorF ("srcx srcy: %d %d\n", src_x, src_y); - composite->src_origin.x = src_x; composite->src_origin.y = src_y; composite->mask_origin.x = mask_x; |