sna: Clear old cursors when resizing

When changing the stride on a cursor, we have to clear the whole area
and not just the rectangle outside of our overwritten area.

Reported-by: Jan Alexander Steffens <jan.steffens@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82273
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2014-08-08 07:25:03 +01:00
parent fab976cef8
commit 6f69188cb2
1 changed files with 4 additions and 1 deletions

View File

@ -4319,7 +4319,10 @@ static struct sna_cursor *__sna_get_cursor(struct sna *sna, xf86CrtcPtr crtc)
image = cursor->image;
if (image == NULL)
image = sna->cursor.scratch;
if (width < cursor->last_width || height < cursor->last_height || rotation != cursor->rotation)
if (size > cursor->size ||
width < cursor->last_width ||
height < cursor->last_height ||
rotation != cursor->rotation)
memset(image, 0, 4*size*size);
if (rotation == RR_Rotate_0) {
if (argb == NULL) {