[PATCH 4/8] mi: Shortcut mi blits based on composite clip, not mappedness (v2)

Adam Jackson ajax at redhat.com
Wed Feb 25 13:03:10 PST 2015


v2: Rather than embed more knowledge about window states, just bail if the
composite clip is empty.

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 mi/mibitblt.c | 5 ++---
 mi/micopy.c   | 7 ++-----
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/mi/mibitblt.c b/mi/mibitblt.c
index 7243963..70a9640 100644
--- a/mi/mibitblt.c
+++ b/mi/mibitblt.c
@@ -96,9 +96,8 @@ miCopyArea(DrawablePtr pSrcDrawable,
     srcx = xIn + pSrcDrawable->x;
     srcy = yIn + pSrcDrawable->y;
 
-    /* If the destination isn't realized, this is easy */
-    if (pDstDrawable->type == DRAWABLE_WINDOW &&
-        !((WindowPtr) pDstDrawable)->realized)
+    /* If the destination isn't paintable, this is easy */
+    if (RegionNil(pGC->pCompositeClip))
         return NULL;
 
     /* clip the source */
diff --git a/mi/micopy.c b/mi/micopy.c
index 2409c78..d9f2e06 100644
--- a/mi/micopy.c
+++ b/mi/micopy.c
@@ -152,12 +152,9 @@ miDoCopy(DrawablePtr pSrcDrawable,
     Bool fastDst = FALSE;       /* for fast clipping with one rect dest */
     Bool fastExpose = FALSE;    /* for fast exposures with pixmap source */
 
-    /* Short cut for unmapped windows */
-
-    if (pDstDrawable->type == DRAWABLE_WINDOW &&
-        !((WindowPtr) pDstDrawable)->realized) {
+    /* Short cut for empty clip list (eg unpaintable window) */
+    if (RegionNil(pGC->pCompositeClip))
         return NULL;
-    }
 
     if (pSrcDrawable->pScreen->SourceValidate) {
         (*pSrcDrawable->pScreen->SourceValidate) (pSrcDrawable, xIn, yIn,
-- 
1.9.3



More information about the xorg-devel mailing list