Commit bc42d11f authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

Pixmap.c: reformat comments

plus some minor formatting fixes
parent ec1aac45
...@@ -106,8 +106,8 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height, ...@@ -106,8 +106,8 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height,
#endif #endif
/* /*
* Create the pixmap structure but do * Create the pixmap structure but do not allocate memory for the
* not allocate memory for the data. * data.
*/ */
PixmapPtr pPixmap = AllocatePixmap(pScreen, 0); PixmapPtr pPixmap = AllocatePixmap(pScreen, 0);
...@@ -174,16 +174,13 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height, ...@@ -174,16 +174,13 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height,
pPixmapPriv -> containTrapezoids = 0; pPixmapPriv -> containTrapezoids = 0;
/* /*
* The lazy encoding policy generally does * The lazy encoding policy generally does not send on remote X
* not send on remote X server the off-screen * server the off-screen images, by preferring to synchronize the
* images, by preferring to synchronize the * windows content. Anyway this behaviour may be inadvisable if a
* windows content. Anyway this behaviour may * pixmap is used, for example, for multiple copy areas on screen.
* be inadvisable if a pixmap is used, for * This counter serves the purpose, taking into account the number
* example, for multiple copy areas on screen. * of times the pixmap has been used as source for a deferred
* This counter serves the purpose, taking in- * operation.
* to account the number of times the pixmap
* has been used as source for a deferred
* operation.
*/ */
pPixmapPriv -> usageCounter = 0; pPixmapPriv -> usageCounter = 0;
...@@ -200,11 +197,10 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height, ...@@ -200,11 +197,10 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height,
pPixmapPriv -> isBackingPixmap = 0; pPixmapPriv -> isBackingPixmap = 0;
/* /*
* Create the pixmap based on the default * Create the pixmap based on the default windows. The proxy knows
* windows. The proxy knows this and uses * this and uses this information to optimize encode the create
* this information to optimize encode the * pixmap message by including the id of the drawable in the
* create pixmap message by including the * checksum.
* id of the drawable in the checksum.
*/ */
if (width != 0 && height != 0 && nxagentGCTrap == 0) if (width != 0 && height != 0 && nxagentGCTrap == 0)
...@@ -251,7 +247,7 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height, ...@@ -251,7 +247,7 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height,
} }
#ifdef TEST #ifdef TEST
fprintf(stderr,"nxagentCreatePixmap: Allocated memory for the Virtual %sPixmap %p of real Pixmap %p (%dx%d),", fprintf(stderr, "nxagentCreatePixmap: Allocated memory for the Virtual %sPixmap %p of real Pixmap %p (%dx%d),",
"allocation hint [%d].\n", "allocation hint [%d].\n",
nxagentShmPixmapTrap ? "Shm " : "", (void *) pVirtual, (void *) pPixmap, width, height, usage_hint); nxagentShmPixmapTrap ? "Shm " : "", (void *) pVirtual, (void *) pPixmap, width, height, usage_hint);
#endif #endif
...@@ -259,12 +255,11 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height, ...@@ -259,12 +255,11 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height,
pPixmapPriv -> pVirtualPixmap = pVirtual; pPixmapPriv -> pVirtualPixmap = pVirtual;
/* /*
* Initialize the privates of the virtual picture. We * Initialize the privates of the virtual picture. We could avoid to
* could avoid to use a flag and just check the pointer * use a flag and just check the pointer to the virtual pixmap that,
* to the virtual pixmap that, if the pixmap is actually * if the pixmap is actually virtual, will be NULL. Unfortunately
* virtual, will be NULL. Unfortunately the flag can be * the flag can be changed in nxagentValidateGC(). That code should
* changed in nxagentValidateGC(). That code should be * be removed in future.
* removed in future.
*/ */
nxagentPrivPixmapPtr pVirtualPriv = nxagentPixmapPriv(pVirtual); nxagentPrivPixmapPtr pVirtualPriv = nxagentPixmapPriv(pVirtual);
...@@ -291,19 +286,17 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height, ...@@ -291,19 +286,17 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height,
pVirtualPriv -> splitResource = NULL; pVirtualPriv -> splitResource = NULL;
/* /*
* We might distinguish real and virtual pixmaps by * We might distinguish real and virtual pixmaps by checking the
* checking the pointers to pVirtualPixmap. We should * pointers to pVirtualPixmap. We should also remove the copy of id
* also remove the copy of id and use the one of the * and use the one of the real pixmap.
* real pixmap.
*/ */
pVirtualPriv -> id = pPixmapPriv -> id; pVirtualPriv -> id = pPixmapPriv -> id;
pVirtualPriv -> mid = 0; pVirtualPriv -> mid = 0;
/* /*
* Storing a pointer back to the real pixmap is * Storing a pointer back to the real pixmap is silly. Unfortunately
* silly. Unfortunately this is the way it has * this is the way it has been originally implemented. See also the
* been originally implemented. See also the
* comment in destroy of the pixmap. * comment in destroy of the pixmap.
*/ */
...@@ -345,12 +338,11 @@ Bool nxagentDestroyPixmap(PixmapPtr pPixmap) ...@@ -345,12 +338,11 @@ Bool nxagentDestroyPixmap(PixmapPtr pPixmap)
{ {
/* /*
* For some pixmaps we receive the destroy only for the * For some pixmaps we receive the destroy only for the
* virtual. Infact to draw in the framebuffer we can use * virtual. Infact to draw in the framebuffer we can use the
* the virtual pixmap instead of the pointer to the real * virtual pixmap instead of the pointer to the real one. As the
* one. As the virtual pixmap can collect references, we * virtual pixmap can collect references, we must transfer those
* must transfer those references to the real pixmap so * references to the real pixmap so we can continue as the destroy
* we can continue as the destroy had been requested for * had been requested for it.
* it.
*/ */
pVirtual = pPixmap; pVirtual = pPixmap;
...@@ -396,7 +388,6 @@ Bool nxagentDestroyPixmap(PixmapPtr pPixmap) ...@@ -396,7 +388,6 @@ Bool nxagentDestroyPixmap(PixmapPtr pPixmap)
} }
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentDestroyPixmap: Managing to destroy the pixmap at [%p]\n", fprintf(stderr, "nxagentDestroyPixmap: Managing to destroy the pixmap at [%p]\n",
(void *) pPixmap); (void *) pPixmap);
#endif #endif
...@@ -497,10 +488,9 @@ Bool nxagentModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int dep ...@@ -497,10 +488,9 @@ Bool nxagentModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int dep
int bitsPerPixel, int devKind, void * pPixData) int bitsPerPixel, int devKind, void * pPixData)
{ {
/* /*
* See miModifyPixmapHeader() in miscrinit.c. This * See miModifyPixmapHeader() in miscrinit.c. This function is used
* function is used to recycle the scratch pixmap * to recycle the scratch pixmap for this screen. We let it refer to
* for this screen. We let it refer to the virtual * the virtual pixmap.
* pixmap.
*/ */
if (!pPixmap) if (!pPixmap)
...@@ -666,9 +656,9 @@ Bool nxagentDisconnectAllPixmaps(void) ...@@ -666,9 +656,9 @@ Bool nxagentDisconnectAllPixmaps(void)
#endif #endif
/* /*
* The RT_NX_PIXMAP resource type is allocated * The RT_NX_PIXMAP resource type is allocated only on the server
* only on the server client, so we don't need * client, so we don't need to find it through the other clients
* to find it through the other clients too. * too.
*/ */
FindClientResourcesByType(clients[serverClient -> index], RT_NX_PIXMAP, nxagentDisconnectPixmap, &r); FindClientResourcesByType(clients[serverClient -> index], RT_NX_PIXMAP, nxagentDisconnectPixmap, &r);
...@@ -734,9 +724,8 @@ void nxagentReconnectPixmap(void *p0, XID x1, void *p2) ...@@ -734,9 +724,8 @@ void nxagentReconnectPixmap(void *p0, XID x1, void *p2)
else if (pPixmap == nxagentDefaultScreen -> pScratchPixmap) else if (pPixmap == nxagentDefaultScreen -> pScratchPixmap)
{ {
/* /*
* Every time the scratch pixmap is used its * Every time the scratch pixmap is used its data is changed, so
* data is changed, so we don't need to recon- * we don't need to reconnect it.
* nect it.
*/ */
#ifdef TEST #ifdef TEST
...@@ -831,9 +820,9 @@ Bool nxagentReconnectAllPixmaps(void *p0) ...@@ -831,9 +820,9 @@ Bool nxagentReconnectAllPixmaps(void *p0)
nxagentResetAlphaCache(); nxagentResetAlphaCache();
/* /*
* The RT_NX_PIXMAP resource type is allocated * The RT_NX_PIXMAP resource type is allocated only on the server
* only on the server client, so we don't need * client, so we don't need to find it through the other clients
* to find it through the other clients too. * too.
*/ */
FindClientResourcesByType(clients[serverClient -> index], RT_NX_PIXMAP, nxagentReconnectPixmap, &result); FindClientResourcesByType(clients[serverClient -> index], RT_NX_PIXMAP, nxagentReconnectPixmap, &result);
...@@ -857,11 +846,10 @@ Bool nxagentReconnectAllPixmaps(void *p0) ...@@ -857,11 +846,10 @@ Bool nxagentReconnectAllPixmaps(void *p0)
#endif #endif
/* /*
* Let the pixmap be reconnected as it was an * Let the pixmap be reconnected as it was an image request
* image request issued by the client owning * issued by the client owning the resource. The client index is
* the resource. The client index is used as * used as a subscript by the image routines to cache the data
* a subscript by the image routines to cache * per-client.
* the data per-client.
*/ */
FindClientResourcesByType(clients[i], RT_PIXMAP, nxagentReconnectPixmap, &result); FindClientResourcesByType(clients[i], RT_PIXMAP, nxagentReconnectPixmap, &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