summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/sna/sna_blt.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/sna/sna_blt.c b/src/sna/sna_blt.c
index fd97255c..9aa636c2 100644
--- a/src/sna/sna_blt.c
+++ b/src/sna/sna_blt.c
@@ -1715,8 +1715,14 @@ sna_blt_composite(struct sna *sna,
was_clear = sna_drawable_is_clear(dst->pDrawable);
tmp->dst.pixmap = get_drawable_pixmap(dst->pDrawable);
- dst_box.x1 = dst_x; dst_box.x2 = dst_x + width;
- dst_box.y1 = dst_y; dst_box.y2 = dst_y + height;
+ if (width | height) {
+ dst_box.x1 = dst_x;
+ dst_box.x2 = bound(dst_x, width);
+ dst_box.y1 = dst_y;
+ dst_box.y2 = bound(dst_y, height);
+ } else
+ sna_render_picture_extents(dst, &dst_box);
+
bo = sna_drawable_use_bo(dst->pDrawable, PREFER_GPU, &dst_box, &tmp->damage);
if (bo && !kgem_bo_can_blt(&sna->kgem, bo)) {
DBG(("%s: can not blit to dst, tiling? %d, pitch? %d\n",