[PATCH xserver 3/5] exa: Remove some nonsense code from ValidateGC

Adam Jackson ajax at redhat.com
Wed Dec 7 20:08:41 UTC 2016


The "tile depth != drawable depth" conditional can't be true, the
protocol requires a match.

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 exa/exa.c | 22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

diff --git a/exa/exa.c b/exa/exa.c
index 7266b71..af0185f 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -507,27 +507,13 @@ exaValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
     PixmapPtr pTile = NULL;
     Bool finish_current_tile = FALSE;
 
-    /* Either of these conditions is enough to trigger access to a tile pixmap. */
-    /* With pGC->tileIsPixel == 1, you run the risk of dereferencing an invalid tile pixmap pointer. */
+    /* Either of these conditions is enough to trigger access to a tile pixmap.
+     * With pGC->tileIsPixel == 1, you run the risk of dereferencing an invalid
+     * tile pixmap pointer.
+     */
     if (pGC->fillStyle == FillTiled ||
         ((changes & GCTile) && !pGC->tileIsPixel)) {
         pTile = pGC->tile.pixmap;
-
-        /* Sometimes tile pixmaps are swapped, you need access to:
-         * - The current tile if it depth matches.
-         * - Or the rotated tile if that one matches depth and !(changes & GCTile).
-         * - Or the current tile pixmap and a newly created one.
-         */
-        if (pTile && pTile->drawable.depth != pDrawable->depth &&
-            !(changes & GCTile)) {
-            PixmapPtr pRotatedTile = fbGetRotatedPixmap(pGC);
-
-            if (pRotatedTile &&
-                pRotatedTile->drawable.depth == pDrawable->depth)
-                pTile = pRotatedTile;
-            else
-                finish_current_tile = TRUE;     /* CreatePixmap will be called. */
-        }
     }
 
     if (pGC->stipple)
-- 
2.9.3



More information about the xorg-devel mailing list