Commit 92589f41 authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

NXshm.c: cleanup nxagent_fbShmCreatePixmap

... to match it as closely as possible to the upstream version.
parent b4b0a1a7
...@@ -389,7 +389,7 @@ ProcShmPutImage(client) ...@@ -389,7 +389,7 @@ ProcShmPutImage(client)
return (client->noClientException); return (client->noClientException);
} }
/* derived from Xext/shm.c */
static PixmapPtr static PixmapPtr
nxagent_fbShmCreatePixmap (pScreen, width, height, depth, addr) nxagent_fbShmCreatePixmap (pScreen, width, height, depth, addr)
ScreenPtr pScreen; ScreenPtr pScreen;
...@@ -400,29 +400,22 @@ nxagent_fbShmCreatePixmap (pScreen, width, height, depth, addr) ...@@ -400,29 +400,22 @@ nxagent_fbShmCreatePixmap (pScreen, width, height, depth, addr)
{ {
register PixmapPtr pPixmap; register PixmapPtr pPixmap;
#ifdef NXAGENT_SERVER
pPixmap = (*pScreen->CreatePixmap)(pScreen, width, height, depth, 0); pPixmap = (*pScreen->CreatePixmap)(pScreen, width, height, depth, 0);
#else
pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScreen->rootDepth, 0);
#endif
if (!pPixmap) if (!pPixmap)
{ {
return NullPixmap; return NullPixmap;
} }
#if defined(NXAGENT_SERVER) && defined(TEST)
fprintf(stderr,"fbShmCreatePixmap: Width [%d] Height [%d] Depth [%d] Hint[%d]\n", width, height, depth, 0);
#endif
if (!(*pScreen->ModifyPixmapHeader)(pPixmap, width, height, depth, if (!(*pScreen->ModifyPixmapHeader)(pPixmap, width, height, depth,
BitsPerPixel(depth), PixmapBytePad(width, depth), (void *)addr)) BitsPerPixel(depth), PixmapBytePad(width, depth), (void *)addr))
{ {
#if defined(NXAGENT_SERVER) && defined(WARNING) (*pScreen->DestroyPixmap)(pPixmap);
fprintf(stderr,"fbShmCreatePixmap: Return Null Pixmap.\n"); return NullPixmap;
#endif
(*pScreen->DestroyPixmap)(pPixmap);
return NullPixmap;
} }
return pPixmap; return pPixmap;
} }
...@@ -434,14 +427,24 @@ fbShmCreatePixmap (pScreen, width, height, depth, addr) ...@@ -434,14 +427,24 @@ fbShmCreatePixmap (pScreen, width, height, depth, addr)
int depth; int depth;
char *addr; char *addr;
{ {
PixmapPtr result; #ifdef TEST
fprintf(stderr, "%s: Width [%d] Height [%d] Depth [%d] Hint[%d]\n", __func__,
width, height, depth, 0);
#endif
nxagentShmPixmapTrap = True; nxagentShmPixmapTrap = True;
result = nxagent_fbShmCreatePixmap(pScreen, width, height, depth, addr); PixmapPtr result = nxagent_fbShmCreatePixmap(pScreen, width, height, depth, addr);
nxagentShmPixmapTrap = False; nxagentShmPixmapTrap = False;
#ifdef WARNING
if (result == NullPixmap)
{
fprintf(stderr, "%s: Return Null Pixmap.\n", __func__);
}
#endif
return result; return result;
} }
......
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