summaryrefslogtreecommitdiff
path: root/exa
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2007-04-29 23:48:31 +0200
committerMichel Dänzer <michel@tungstengraphics.com>2007-04-29 23:48:31 +0200
commitd2245386eed200e77a8c84bdda36ab29e39fd593 (patch)
treedcdb3671abddbf811232f8edd60e5580a1f564b8 /exa
parent0880aaac9c83019fec2e3d32871f74c7a407f8b3 (diff)
EXA: GetImage improvements.
Only migrate when appropriate. In particular, don't migrate to offscreen in the no-fallback case as copying from system memory should usually be as fast if not faster than DownloadFromScreen, in particular if the bits need to be uploaded to offscreen first.
Diffstat (limited to 'exa')
-rw-r--r--exa/exa_accel.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index dd02fef63..6a0fbb70f 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -1330,27 +1330,22 @@ exaGetImage (DrawablePtr pDrawable, int x, int y, int w, int h,
int xoff, yoff;
Bool ok;
- if (pExaScr->swappedOut || pExaScr->info->DownloadFromScreen == NULL)
- goto fallback;
+ if (pExaScr->info->DownloadFromScreen == NULL)
+ goto migrate_and_fallback;
/* Only cover the ZPixmap, solid copy case. */
if (format != ZPixmap || !EXA_PM_IS_SOLID(pDrawable, planeMask))
- goto fallback;
+ goto migrate_and_fallback;
/* Only try to handle the 8bpp and up cases, since we don't want to think
* about <8bpp.
*/
if (pDrawable->bitsPerPixel < 8)
+ goto migrate_and_fallback;
+
+ if (pExaScr->swappedOut)
goto fallback;
- /* Migrate, but assume that we could accelerate the download. It is up to
- * the migration scheme to ensure that this case doesn't result in bad
- * moving of pixmaps.
- */
- pixmaps[0].as_dst = FALSE;
- pixmaps[0].as_src = TRUE;
- pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable);
- exaDoMigration (pixmaps, 1, TRUE);
pPix = exaGetOffscreenPixmap (pDrawable, &xoff, &yoff);
if (pPix == NULL)
goto fallback;
@@ -1365,12 +1360,12 @@ exaGetImage (DrawablePtr pDrawable, int x, int y, int w, int h,
return;
}
-fallback:
+migrate_and_fallback:
pixmaps[0].as_dst = FALSE;
pixmaps[0].as_src = TRUE;
pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable);
exaDoMigration (pixmaps, 1, FALSE);
-
+fallback:
ExaCheckGetImage (pDrawable, x, y, w, h, format, planeMask, d);
}