diff options
author | Søren Sandmann <ssp@redhat.com> | 2012-08-07 16:39:00 -0400 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@redhat.com> | 2012-08-23 17:34:32 -0400 |
commit | 3eb597d7cd5e7904313a3f851c53b23fe0dc4c2c (patch) | |
tree | c60836e389e9d048607dda145e17eb8c6198031d | |
parent | fc8180d2fe9c5f9a8b4702442891378d3b15b9b9 (diff) |
Two bug fixes:
First is that composite requests need QXL_EFFECT_BLEND so that earlier
commands touching the area in question are not optimized out.
Second is that images need a stride that is a multiple of 4. I don't
know exactly where this is causing a problem, but it is.
-rw-r--r-- | src/qxl_image.c | 4 | ||||
-rw-r--r-- | src/qxl_surface.c | 44 | ||||
-rw-r--r-- | src/uxa/uxa-render.c | 8 |
3 files changed, 45 insertions, 11 deletions
diff --git a/src/qxl_image.c b/src/qxl_image.c index 0927f0e..3c45bf2 100644 --- a/src/qxl_image.c +++ b/src/qxl_image.c @@ -138,7 +138,7 @@ qxl_image_create (qxl_screen_t *qxl, const uint8_t *data, struct QXLImage *image; struct QXLDataChunk *head; struct QXLDataChunk *tail; - int dest_stride = width * Bpp; + int dest_stride = (width * Bpp + 3) & (~3); int h; data += y * stride + x * Bpp; @@ -216,7 +216,7 @@ qxl_image_create (qxl_screen_t *qxl, const uint8_t *data, image->bitmap.flags = SPICE_BITMAP_FLAGS_TOP_DOWN; image->bitmap.x = width; image->bitmap.y = height; - image->bitmap.stride = width * Bpp; + image->bitmap.stride = dest_stride; image->bitmap.palette = 0; image->bitmap.data = physical_address (qxl, head, qxl->main_mem_slot); diff --git a/src/qxl_surface.c b/src/qxl_surface.c index 4f29ad3..1bf63d5 100644 --- a/src/qxl_surface.c +++ b/src/qxl_surface.c @@ -748,8 +748,6 @@ qxl_surface_create (surface_cache_t * cache, if (!(surface = surface_send_create (cache, width, height, bpp))) return NULL; - ErrorF ("Got Surface: %d - %d\n", surface->id, surface->bpp); - surface->next = cache->live_surfaces; surface->prev = NULL; if (cache->live_surfaces) @@ -794,8 +792,6 @@ surface_destroy (qxl_surface_t *surface) { struct QXLSurfaceCmd *cmd; - ErrorF ("Send destroy for %d\n", surface->id); - if (surface->dev_image) pixman_image_unref (surface->dev_image); if (surface->host_image) @@ -1393,6 +1389,13 @@ 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; @@ -1475,6 +1478,19 @@ qxl_surface_composite (qxl_surface_t *dest, QXLRect rect; QXLImage *img; QXLTransform *trans; + int n_deps = 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->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_x, dest_y, width, height, + dest->id + ); rect.left = dest_x; rect.right = dest_x + width; @@ -1497,9 +1513,11 @@ qxl_surface_composite (qxl_surface_t *dest, composite->src_transform = trans? physical_address (qxl, trans, qxl->main_mem_slot) : 0x00000000; - drawable->surfaces_dest[0] = qsrc->id; - drawable->surfaces_rects[0] = full_rect (qsrc); + drawable->surfaces_dest[n_deps] = qsrc->id; + drawable->surfaces_rects[n_deps] = full_rect (qsrc); + n_deps++; + if (mask) { img = image_from_picture (qxl, mask, qmask); @@ -1509,9 +1527,10 @@ qxl_surface_composite (qxl_surface_t *dest, composite->flags |= (mask->repeat << 16); composite->flags |= (mask->componentAlpha << 18); - drawable->surfaces_dest[1] = qmask->id; - drawable->surfaces_rects[1] = full_rect (qmask); - + drawable->surfaces_dest[n_deps] = qmask->id; + drawable->surfaces_rects[n_deps] = full_rect (qmask); + n_deps++; + trans = get_transform (qxl, src->transform); composite->mask_transform = trans? physical_address (qxl, trans, qxl->main_mem_slot) : 0x00000000; @@ -1521,12 +1540,19 @@ qxl_surface_composite (qxl_surface_t *dest, composite->mask = 0x00000000; composite->mask_transform = 0x00000000; } + + 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; composite->mask_origin.y = mask_y; + drawable->effect = QXL_EFFECT_BLEND; + push_drawable (qxl, drawable); } diff --git a/src/uxa/uxa-render.c b/src/uxa/uxa-render.c index ac80c45..494bffb 100644 --- a/src/uxa/uxa-render.c +++ b/src/uxa/uxa-render.c @@ -1254,6 +1254,11 @@ uxa_try_driver_composite(CARD8 op, nbox = REGION_NUM_RECTS(®ion); pbox = REGION_RECTS(®ion); while (nbox--) { + ErrorF ("- uxa box: %d %d %d %d\n", + pbox->x1 + dst_off_x, + pbox->y1 + dst_off_y, + pbox->x2 - pbox->x1, + pbox->y2 - pbox->y1); (*uxa_screen->info->composite) (pDstPix, pbox->x1 + xSrc, pbox->y1 + ySrc, @@ -1506,6 +1511,9 @@ uxa_composite(CARD8 op, RegionRec region; int tx, ty; + ErrorF ("Uxa composite: %d %d %d %d %d %d %d %d\n", + xSrc, ySrc, xMask, yMask, xDst, yDst, width, height); + if (uxa_screen->swappedOut || uxa_screen->force_fallback) goto fallback; |