From 1d24554ff5754e294c03da0a3c5a53af8736ee2b Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Sun, 19 Feb 2017 00:06:54 +0100 Subject: dix: fix incomplete commit The following commit turned out to be incomplete. This commit makes it complete by removing client->lastDrawable/lastGC everywhere thus fixing ArcticaProject/nx-libs#306 and #322 commit e6f2f6427122dc4bc802acebf26f8cec16cd2f62 Author: Mike Gabriel Date: Mon Jun 20 16:45:38 2016 +0200 dix: remove caching of drawables and graphics contexts. The security checks simply bypass the cached values so they are unused. Backported from X.org: commit 9a183d7ba50e31afa133cc03aee7991517a283ea Author: Eamon Walsh Date: Tue Aug 14 11:39:26 2007 -0400 dix: remove caching of drawables and graphics contexts. The security checks simply bypass the cached values so they are unused. Backport to nx-libs: Mike Gabriel --- nx-X11/programs/Xserver/include/dix.h | 38 +++-------------------------------- 1 file changed, 3 insertions(+), 35 deletions(-) (limited to 'nx-X11/programs/Xserver/include/dix.h') diff --git a/nx-X11/programs/Xserver/include/dix.h b/nx-X11/programs/Xserver/include/dix.h index 0b08b46a9..58f6c6eb0 100644 --- a/nx-X11/programs/Xserver/include/dix.h +++ b/nx-X11/programs/Xserver/include/dix.h @@ -91,15 +91,11 @@ SOFTWARE. /* XXX if you are using this macro, you are probably not generating Match * errors where appropriate */ #define LOOKUP_DRAWABLE(did, client)\ - ((client->lastDrawableID == did) ? \ - client->lastDrawable : (DrawablePtr)LookupDrawable(did, client)) + ((DrawablePtr)LookupDrawable(did, client)) #ifdef XCSECURITY #define SECURITY_VERIFY_DRAWABLE(pDraw, did, client, mode)\ - if (client->lastDrawableID == did && !client->trustLevel)\ - pDraw = client->lastDrawable;\ - else \ {\ pDraw = (DrawablePtr) SecurityLookupIDByClass(client, did, \ RC_DRAWABLE, mode);\ @@ -113,9 +109,6 @@ SOFTWARE. } #define SECURITY_VERIFY_GEOMETRABLE(pDraw, did, client, mode)\ - if (client->lastDrawableID == did && !client->trustLevel)\ - pDraw = client->lastDrawable;\ - else \ {\ pDraw = (DrawablePtr) SecurityLookupIDByClass(client, did, \ RC_DRAWABLE, mode);\ @@ -127,10 +120,7 @@ SOFTWARE. } #define SECURITY_VERIFY_GC(pGC, rid, client, mode)\ - if (client->lastGCID == rid && !client->trustLevel)\ - pGC = client->lastGC;\ - else\ - pGC = (GC *) SecurityLookupIDByType(client, rid, RT_GC, mode);\ + pGC = (GC *) SecurityLookupIDByType(client, rid, RT_GC, mode);\ if (!pGC)\ {\ client->errorValue = rid;\ @@ -149,9 +139,6 @@ SOFTWARE. #else /* not XCSECURITY */ #define VERIFY_DRAWABLE(pDraw, did, client)\ - if (client->lastDrawableID == did)\ - pDraw = client->lastDrawable;\ - else \ {\ pDraw = (DrawablePtr) LookupIDByClass(did, RC_DRAWABLE);\ if (!pDraw) \ @@ -164,9 +151,6 @@ SOFTWARE. } #define VERIFY_GEOMETRABLE(pDraw, did, client)\ - if (client->lastDrawableID == did)\ - pDraw = client->lastDrawable;\ - else \ {\ pDraw = (DrawablePtr) LookupIDByClass(did, RC_DRAWABLE);\ if (!pDraw) \ @@ -177,10 +161,7 @@ SOFTWARE. } #define VERIFY_GC(pGC, rid, client)\ - if (client->lastGCID == rid)\ - pGC = client->lastGC;\ - else\ - pGC = (GC *)LookupIDByType(rid, RT_GC);\ + pGC = (GC *)LookupIDByType(rid, RT_GC);\ if (!pGC)\ {\ client->errorValue = rid;\ @@ -252,23 +233,12 @@ SOFTWARE. #endif /* NEED_DBE_BUF_BITS */ #define VALIDATE_DRAWABLE_AND_GC(drawID, pDraw, pGC, client)\ - if ((stuff->gc == INVALID) || (client->lastGCID != stuff->gc) ||\ - (client->lastDrawableID != drawID))\ {\ SECURITY_VERIFY_GEOMETRABLE(pDraw, drawID, client, DixWriteAccess);\ SECURITY_VERIFY_GC(pGC, stuff->gc, client, DixReadAccess);\ if ((pGC->depth != pDraw->depth) ||\ (pGC->pScreen != pDraw->pScreen))\ return (BadMatch);\ - client->lastDrawable = pDraw;\ - client->lastDrawableID = drawID;\ - client->lastGC = pGC;\ - client->lastGCID = stuff->gc;\ - }\ - else\ - {\ - pGC = client->lastGC;\ - pDraw = client->lastDrawable;\ }\ SET_DBE_DSTBUF(pDraw, drawID);\ if (pGC->serialNumber != pDraw->serialNumber)\ @@ -325,8 +295,6 @@ extern void UpdateCurrentTimeIf(void); extern void InitSelections(void); -extern void FlushClientCaches(XID /*id*/); - extern int dixDestroyPixmap( void * /*value*/, XID /*pid*/); -- cgit v1.2.3