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.
This commit is contained in:
Michel Dänzer 2007-06-20 18:42:00 +02:00
parent 40f27a2df4
commit 87966c5d28

View File

@ -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;