summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann <ssp@redhat.com>2012-07-29 13:44:10 -0400
committerSøren Sandmann Pedersen <ssp@redhat.com>2012-08-23 17:34:32 -0400
commitfc8180d2fe9c5f9a8b4702442891378d3b15b9b9 (patch)
tree6be409e26c46997ff06d45820aed29078da22dba
parent8081f21a6d9057c81d835511101ecc6664668861 (diff)
track dependencies, reject gradients
-rw-r--r--src/qxl_driver.c10
-rw-r--r--src/qxl_surface.c37
2 files changed, 45 insertions, 2 deletions
diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index 0474ffc..1f7a234 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -1403,6 +1403,16 @@ qxl_prepare_composite (int op,
PixmapPtr pMask,
PixmapPtr pDst)
{
+ if (!pSrc)
+ {
+ ErrorF ("No src\n");
+ return FALSE;
+ }
+ if (!pDst)
+ {
+ ErrorF ("No dst\n");
+ return FALSE;
+ }
return qxl_surface_prepare_composite (
op, pSrcPicture, pMaskPicture, pDstPicture,
get_surface (pSrc),
diff --git a/src/qxl_surface.c b/src/qxl_surface.c
index 58b4914..4f29ad3 100644
--- a/src/qxl_surface.c
+++ b/src/qxl_surface.c
@@ -313,7 +313,7 @@ get_formats (int bpp, SpiceBitmapFmt *format, pixman_format_code_t *pformat)
break;
}
}
-
+
static qxl_surface_t *
surface_get_from_cache (surface_cache_t *cache, int width, int height, int bpp)
{
@@ -685,7 +685,8 @@ retry:
push_surface_cmd (cache, cmd);
- dev_addr = (uint32_t *)((uint8_t *)surface->address + stride * (height - 1));
+ dev_addr
+ = (uint32_t *)((uint8_t *)surface->address + stride * (height - 1));
surface->dev_image = pixman_image_create_bits (
pformat, width, height, dev_addr, - stride);
@@ -746,6 +747,8 @@ qxl_surface_create (surface_cache_t * cache,
if (!(surface = surface_get_from_cache (cache, width, height, bpp)))
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;
@@ -791,6 +794,8 @@ 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)
@@ -1404,6 +1409,8 @@ image_from_picture (qxl_screen_t *qxl, PicturePtr picture, qxl_surface_t *surfac
{
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;
@@ -1435,6 +1442,21 @@ get_transform (qxl_screen_t *qxl, PictTransform *transform)
}
}
+static QXLRect
+full_rect (qxl_surface_t *surface)
+{
+ QXLRect r;
+ int w = pixman_image_get_width (surface->host_image);
+ int h = pixman_image_get_height (surface->host_image);
+
+
+ r.left = r.top = 0;
+ r.right = w;
+ r.bottom = h;
+
+ return r;
+}
+
void
qxl_surface_composite (qxl_surface_t *dest,
int src_x, int src_y,
@@ -1475,6 +1497,9 @@ 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);
+
if (mask)
{
img = image_from_picture (qxl, mask, qmask);
@@ -1484,10 +1509,18 @@ 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);
+
trans = get_transform (qxl, src->transform);
composite->mask_transform = trans?
physical_address (qxl, trans, qxl->main_mem_slot) : 0x00000000;
}
+ else
+ {
+ composite->mask = 0x00000000;
+ composite->mask_transform = 0x00000000;
+ }
composite->src_origin.x = src_x;
composite->src_origin.y = src_y;