summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-12-12 09:40:51 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2014-12-12 09:40:51 +0000
commit343299c78bfc1044da0b965e99de9ad312b05cca (patch)
treef429e203abcd1db71a172e8982cfbfa30e836b9d /src
parent60ebac591596ccb768b684b1909064570dd1cf47 (diff)
sna/trapezoids: Check the pixmap is wrapped before deferencing it
When we AddTraps to a low resolution bitmap, we need to fallback as we don't wrap it with a GPU pixmap. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/sna_trapezoids.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/sna/sna_trapezoids.c b/src/sna/sna_trapezoids.c
index 8131cb2a..711446cd 100644
--- a/src/sna/sna_trapezoids.c
+++ b/src/sna/sna_trapezoids.c
@@ -821,14 +821,13 @@ trap_upload(PicturePtr picture,
void
sna_add_traps(PicturePtr picture, INT16 x, INT16 y, int n, xTrap *t)
{
- struct sna *sna;
- PixmapPtr pixmap;
+ PixmapPtr pixmap = get_drawable_pixmap(picture->pDrawable);
+ struct sna *sna = to_sna_from_pixmap(pixmap);
+ struct sna_pixmap *priv = sna_pixmap(pixmap);
DBG(("%s (%d, %d) x %d\n", __FUNCTION__, x, y, n));
- pixmap = get_drawable_pixmap(picture->pDrawable);
- sna = to_sna_from_pixmap(pixmap);
- if (is_gpu_dst(sna_pixmap(pixmap))) {
+ if (priv && is_gpu_dst(priv)) {
if (trap_span_converter(sna, picture, x, y, n, t))
return;
}