From db7c9d349b86216ed00888181c64ab707fbe18d4 Mon Sep 17 00:00:00 2001 From: David Reveman Date: Tue, 8 Mar 2005 09:27:09 +0000 Subject: [PATCH] Return early from xglCopy if fall-back is more efficient --- hw/xgl/xglcopy.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/hw/xgl/xglcopy.c b/hw/xgl/xglcopy.c index c34459b5a..a74a78c5e 100644 --- a/hw/xgl/xglcopy.c +++ b/hw/xgl/xglcopy.c @@ -38,9 +38,19 @@ xglCopy (DrawablePtr pSrc, int srcXoff, srcYoff; int dstXoff, dstYoff; + XGL_DRAWABLE_PIXMAP_PRIV (pSrc); + if (!nBox) return TRUE; + /* source is all in software and damaged, fall-back is probably more + efficient */ + if (pPixmapPriv->allBits && + pPixmapPriv->pDamage && + REGION_NOTEMPTY (pDrawable->pScreen, + DamageRegion (pPixmapPriv->pDamage))) + return FALSE; + if (xglPrepareTarget (pDst)) { XGL_SCREEN_PRIV (pDst->pScreen); @@ -52,11 +62,7 @@ xglCopy (DrawablePtr pSrc, /* blit to screen */ if (dst == pScreenPriv->surface) - { - XGL_DRAWABLE_PIXMAP_PRIV (pSrc); - XGL_INCREMENT_PIXMAP_SCORE (pPixmapPriv, 5000); - } } else {