From 87966c5d2889873cea6cbc16b7e4399490dfaec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Wed, 20 Jun 2007 18:42:00 +0200 Subject: [PATCH] exaGetImage: Don't migrate or try to accelerate for 1x1. This is mainly to avoid wasting effort for XSync(), but just reading a single pixel directly is probably faster than DownloadFromScreen anyway. Though in light of the latter, even larger thresholds might be useful. Also move the swappedOut check before the migration checks because migration can't actually occur when swapped out. --- exa/exa_accel.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exa/exa_accel.c b/exa/exa_accel.c index bf63f2c4f..8d03dd5e8 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -1329,6 +1329,9 @@ exaGetImage (DrawablePtr pDrawable, int x, int y, int w, int h, int xoff, yoff; Bool ok; + if (pExaScr->swappedOut || (w == 1 && h == 1)) + goto fallback; + if (pExaScr->info->DownloadFromScreen == NULL) goto migrate_and_fallback; @@ -1342,9 +1345,6 @@ exaGetImage (DrawablePtr pDrawable, int x, int y, int w, int h, if (pDrawable->bitsPerPixel < 8) goto migrate_and_fallback; - if (pExaScr->swappedOut) - goto fallback; - pPix = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff); if (pPix == NULL) goto fallback;