Commit 8c7d7bed authored by Mike Gabriel's avatar Mike Gabriel

hw/nxagent/NXresource.c: remove caching of drawables and graphics contexts. The…

hw/nxagent/NXresource.c: remove caching of drawables and graphics contexts. The security checks simply bypass the cached values so they are unused. Required code de-duplication in nxagent. (Will be fixed by ArcticaProject/nx-libs#120 later on).
parent e6f2f642
...@@ -685,8 +685,6 @@ FreeResource(XID id, RESTYPE skipDeleteFuncType) ...@@ -685,8 +685,6 @@ FreeResource(XID id, RESTYPE skipDeleteFuncType)
#ifdef NXAGENT_SERVER #ifdef NXAGENT_SERVER
nxagentResChangedFlag = 1; nxagentResChangedFlag = 1;
#endif #endif
if (rtype & RC_CACHED)
FlushClientCaches(res->id);
if (rtype != skipDeleteFuncType) if (rtype != skipDeleteFuncType)
(*DeleteFuncs[rtype & TypeMask])(res->value, res->id); (*DeleteFuncs[rtype & TypeMask])(res->value, res->id);
xfree(res); xfree(res);
...@@ -697,11 +695,6 @@ FreeResource(XID id, RESTYPE skipDeleteFuncType) ...@@ -697,11 +695,6 @@ FreeResource(XID id, RESTYPE skipDeleteFuncType)
else else
prev = &res->next; prev = &res->next;
} }
if(clients[cid] && (id == clients[cid]->lastDrawableID))
{
clients[cid]->lastDrawable = (DrawablePtr)screenInfo.screens[0]->root;
clients[cid]->lastDrawableID = screenInfo.screens[0]->root->drawable.id;
}
} }
if (!gotOne) if (!gotOne)
ErrorF("Freeing resource id=%lX which isn't there.\n", ErrorF("Freeing resource id=%lX which isn't there.\n",
...@@ -728,8 +721,6 @@ FreeResourceByType(XID id, RESTYPE type, Bool skipFree) ...@@ -728,8 +721,6 @@ FreeResourceByType(XID id, RESTYPE type, Bool skipFree)
#ifdef NXAGENT_SERVER #ifdef NXAGENT_SERVER
nxagentResChangedFlag = 1; nxagentResChangedFlag = 1;
#endif #endif
if (type & RC_CACHED)
FlushClientCaches(res->id);
if (!skipFree) if (!skipFree)
(*DeleteFuncs[type & TypeMask])(res->value, res->id); (*DeleteFuncs[type & TypeMask])(res->value, res->id);
xfree(res); xfree(res);
...@@ -738,11 +729,6 @@ FreeResourceByType(XID id, RESTYPE type, Bool skipFree) ...@@ -738,11 +729,6 @@ FreeResourceByType(XID id, RESTYPE type, Bool skipFree)
else else
prev = &res->next; prev = &res->next;
} }
if(clients[cid] && (id == clients[cid]->lastDrawableID))
{
clients[cid]->lastDrawable = (DrawablePtr)screenInfo.screens[0]->root;
clients[cid]->lastDrawableID = screenInfo.screens[0]->root->drawable.id;
}
} }
} }
...@@ -765,8 +751,6 @@ ChangeResourceValue (XID id, RESTYPE rtype, void * value) ...@@ -765,8 +751,6 @@ ChangeResourceValue (XID id, RESTYPE rtype, void * value)
for (; res; res = res->next) for (; res; res = res->next)
if ((res->id == id) && (res->type == rtype)) if ((res->id == id) && (res->type == rtype))
{ {
if (rtype & RC_CACHED)
FlushClientCaches(res->id);
res->value = value; res->value = value;
return TRUE; return TRUE;
} }
...@@ -1027,8 +1011,6 @@ FreeClientNeverRetainResources(ClientPtr client) ...@@ -1027,8 +1011,6 @@ FreeClientNeverRetainResources(ClientPtr client)
if (rtype & RC_NEVERRETAIN) if (rtype & RC_NEVERRETAIN)
{ {
*prev = this->next; *prev = this->next;
if (rtype & RC_CACHED)
FlushClientCaches(this->id);
(*DeleteFuncs[rtype & TypeMask])(this->value, this->id); (*DeleteFuncs[rtype & TypeMask])(this->value, this->id);
xfree(this); xfree(this);
} }
...@@ -1073,8 +1055,6 @@ FreeClientResources(ClientPtr client) ...@@ -1073,8 +1055,6 @@ FreeClientResources(ClientPtr client)
{ {
RESTYPE rtype = this->type; RESTYPE rtype = this->type;
*head = this->next; *head = this->next;
if (rtype & RC_CACHED)
FlushClientCaches(this->id);
(*DeleteFuncs[rtype & TypeMask])(this->value, this->id); (*DeleteFuncs[rtype & TypeMask])(this->value, this->id);
xfree(this); xfree(this);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment