dix: colormap: let AllocColorCells() operate on ClientPtr instead of index
It's only caller already has a pointer to client struct, so no need to let this function look it up again in the global clients array. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
b9df6ed8a2
commit
1c8ef6d44d
|
@ -1485,13 +1485,14 @@ FreeClientPixels(void *value, XID fakeid)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
AllocColorCells(int client, ColormapPtr pmap, int colors, int planes,
|
AllocColorCells(ClientPtr pClient, ColormapPtr pmap, int colors, int planes,
|
||||||
Bool contig, Pixel * ppix, Pixel * masks)
|
Bool contig, Pixel * ppix, Pixel * masks)
|
||||||
{
|
{
|
||||||
Pixel rmask, gmask, bmask, *ppixFirst, r, g, b;
|
Pixel rmask, gmask, bmask, *ppixFirst, r, g, b;
|
||||||
int n, class;
|
int n, class;
|
||||||
int ok;
|
int ok;
|
||||||
int oldcount;
|
int oldcount;
|
||||||
|
const int client = pClient->index;
|
||||||
colorResource *pcr = (colorResource *) NULL;
|
colorResource *pcr = (colorResource *) NULL;
|
||||||
|
|
||||||
class = pmap->class;
|
class = pmap->class;
|
||||||
|
|
|
@ -46,7 +46,7 @@ int QueryColors(ColormapPtr pmap, int count, Pixel *ppixIn,
|
||||||
/* should only be called via resource type's destructor */
|
/* should only be called via resource type's destructor */
|
||||||
int FreeClientPixels(void *pcr, XID fakeid);
|
int FreeClientPixels(void *pcr, XID fakeid);
|
||||||
|
|
||||||
int AllocColorCells(int client, ColormapPtr pmap, int colors, int planes,
|
int AllocColorCells(ClientPtr pClient, ColormapPtr pmap, int colors, int planes,
|
||||||
Bool contig, Pixel *ppix, Pixel *masks);
|
Bool contig, Pixel *ppix, Pixel *masks);
|
||||||
|
|
||||||
int AllocColorPlanes(int client, ColormapPtr pmap, int colors, int r, int g,
|
int AllocColorPlanes(int client, ColormapPtr pmap, int colors, int r, int g,
|
||||||
|
|
|
@ -2707,7 +2707,7 @@ ProcAllocColorCells(ClientPtr client)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
pmasks = ppixels + npixels;
|
pmasks = ppixels + npixels;
|
||||||
|
|
||||||
if ((rc = AllocColorCells(client->index, pcmp, npixels, nmasks,
|
if ((rc = AllocColorCells(client, pcmp, npixels, nmasks,
|
||||||
(Bool) stuff->contiguous, ppixels, pmasks))) {
|
(Bool) stuff->contiguous, ppixels, pmasks))) {
|
||||||
free(ppixels);
|
free(ppixels);
|
||||||
return rc;
|
return rc;
|
||||||
|
|
Loading…
Reference in New Issue