Commit b9a4dea5 authored by Ulrich Sibiller's avatar Ulrich Sibiller

GCOps.c: reformat comments

save some lines
parent 7860401b
...@@ -192,9 +192,8 @@ RegionPtr nxagentBitBlitHelper(GC *pGC) ...@@ -192,9 +192,8 @@ RegionPtr nxagentBitBlitHelper(GC *pGC)
#endif #endif
/* /*
* Force NullRegion. We consider enough the graphics * Force NullRegion. We consider enough the graphics expose events
* expose events generated internally by the nxagent * generated internally by the nxagent server.
* server.
*/ */
#ifdef TEST #ifdef TEST
...@@ -205,13 +204,12 @@ RegionPtr nxagentBitBlitHelper(GC *pGC) ...@@ -205,13 +204,12 @@ RegionPtr nxagentBitBlitHelper(GC *pGC)
} }
/* /*
* The deferring of X_RenderCompositeTrapezoids caused * The deferring of X_RenderCompositeTrapezoids caused an ugly effect
* an ugly effect on pulldown menu: as the background * on pulldown menu: as the background may be not synchronized, the
* may be not synchronized, the text floats in an invi- * text floats in an invisible window. To avoid such effects, we use a
* sible window. To avoid such effects, we use a system * system to guess if the destination target of a copy area is a
* to guess if the destination target of a copy area * popup, by assuming that those kind of windows use the override
* is a popup, by assuming that those kind of windows * redirect property.
* use the override redirect property.
*/ */
int nxagentWindowIsPopup(DrawablePtr pDrawable) int nxagentWindowIsPopup(DrawablePtr pDrawable)
...@@ -232,10 +230,8 @@ int nxagentWindowIsPopup(DrawablePtr pDrawable) ...@@ -232,10 +230,8 @@ int nxagentWindowIsPopup(DrawablePtr pDrawable)
WindowPtr parent = ((WindowPtr) pDrawable) -> parent; WindowPtr parent = ((WindowPtr) pDrawable) -> parent;
/* /*
* Go up on the tree until a parent * Go up on the tree until a parent exists or 4 windows has been
* exists or 4 windows has been che- * checked. This seems a good limit to up children's popup.
* cked. This seems a good limit to
* up children's popup.
*/ */
int level = 0; int level = 0;
...@@ -266,8 +262,7 @@ int nxagentWindowIsPopup(DrawablePtr pDrawable) ...@@ -266,8 +262,7 @@ int nxagentWindowIsPopup(DrawablePtr pDrawable)
} }
/* /*
* This function returns 1 if the * This function returns 1 if the XCopyArea request must be skipped.
* XCopyArea request must be skipped.
*/ */
int nxagentDeferCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, int nxagentDeferCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
...@@ -275,20 +270,17 @@ int nxagentDeferCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -275,20 +270,17 @@ int nxagentDeferCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
int height, int dstx, int dsty) int height, int dstx, int dsty)
{ {
/* /*
* If the destination drawable is a popup * If the destination drawable is a popup window, we try to
* window, we try to synchronize the source * synchronize the source drawable to show a nice menu. Anyway if
* drawable to show a nice menu. Anyway if * this synchronization breaks, the copy area is handled in the
* this synchronization breaks, the copy area * normal way.
* is handled in the normal way.
*/ */
/* /*
FIXME: The popup could be synchronized with one FIXME: The popup could be synchronized with one single put image,
single put image, clipped to the corrup- clipped to the corrupted region. As an intermediate step, the
ted region. As an intermediate step, the pixmap to synchronize could be copied on a cleared scratch
pixmap to synchronize could be copied on pixmap, in order to have a solid color in the clipped regions.
a cleared scratch pixmap, in order to
have a solid color in the clipped regions.
*/ */
if (nxagentOption(DeferLevel) >= 2 && if (nxagentOption(DeferLevel) >= 2 &&
...@@ -332,10 +324,9 @@ FIXME: The popup could be synchronized with one ...@@ -332,10 +324,9 @@ FIXME: The popup could be synchronized with one
} }
/* /*
* We are going to decide if the source drawable * We are going to decide if the source drawable must be
* must be synchronized before using it, or if * synchronized before using it, or if the copy will be clipped to
* the copy will be clipped to the synchronized * the synchronized source region.
* source region.
*/ */
if ((pDstDrawable -> type == DRAWABLE_PIXMAP && if ((pDstDrawable -> type == DRAWABLE_PIXMAP &&
...@@ -345,11 +336,9 @@ FIXME: The popup could be synchronized with one ...@@ -345,11 +336,9 @@ FIXME: The popup could be synchronized with one
width, height); width, height);
/* /*
* We called this variable pCorruptedRegion * We called this variable pCorruptedRegion because in the worst
* because in the worst case the corrupted * case the corrupted region will be equal to the destination
* region will be equal to the destination * region. The GC's clip mask is used to narrow the destination.
* region. The GC's clip mask is used to
* narrow the destination.
*/ */
RegionPtr pCorruptedRegion = nxagentCreateRegion(pDstDrawable, pGC, dstx, dsty, RegionPtr pCorruptedRegion = nxagentCreateRegion(pDstDrawable, pGC, dstx, dsty,
...@@ -413,9 +402,8 @@ FIXME: The popup could be synchronized with one ...@@ -413,9 +402,8 @@ FIXME: The popup could be synchronized with one
} }
/* /*
* The corrupted region on the destination * The corrupted region on the destination drawable is composed by
* drawable is composed by the areas of the * the areas of the destination that we are not going to copy.
* destination that we are not going to copy.
*/ */
RegionSubtract(pCorruptedRegion, pCorruptedRegion, pClipRegion); RegionSubtract(pCorruptedRegion, pCorruptedRegion, pClipRegion);
...@@ -433,8 +421,8 @@ FIXME: The popup could be synchronized with one ...@@ -433,8 +421,8 @@ FIXME: The popup could be synchronized with one
#endif #endif
/* /*
* The destination drawable inherits both the * The destination drawable inherits both the synchronized and the
* synchronized and the corrupted region. * corrupted region.
*/ */
if (RegionNil(pClipRegion) == 0) if (RegionNil(pClipRegion) == 0)
...@@ -452,9 +440,8 @@ FIXME: The popup could be synchronized with one ...@@ -452,9 +440,8 @@ FIXME: The popup could be synchronized with one
Bool pClipRegionFree = True; Bool pClipRegionFree = True;
/* /*
* As we want to copy only the synchronized * As we want to copy only the synchronized areas of the source
* areas of the source drawable, we create * drawable, we create a new GC copying the original one and
* a new GC copying the original one and
* setting a new clip mask. * setting a new clip mask.
*/ */
...@@ -488,10 +475,9 @@ FIXME: The popup could be synchronized with one ...@@ -488,10 +475,9 @@ FIXME: The popup could be synchronized with one
CARD32 targetAttributes[2]; CARD32 targetAttributes[2];
/* /*
* Setting the clip mask origin. This * Setting the clip mask origin. This operation must precede
* operation must precede the clip chan- * the clip change, because the origin information is used in
* ge, because the origin information is * the XSetClipRectangles().
* used in the XSetClipRectangles().
*/ */
targetAttributes[0] = 0; targetAttributes[0] = 0;
...@@ -506,8 +492,8 @@ FIXME: The popup could be synchronized with one ...@@ -506,8 +492,8 @@ FIXME: The popup could be synchronized with one
nxagentChangeClip(targetGC, CT_REGION, pClipRegion, 0); nxagentChangeClip(targetGC, CT_REGION, pClipRegion, 0);
/* /*
* Next call to nxagentChangeClip() will destroy * Next call to nxagentChangeClip() will destroy pClipRegion,
* pClipRegion, so it has not to be freed. * so it has not to be freed.
*/ */
pClipRegionFree = False; pClipRegionFree = False;
...@@ -541,9 +527,8 @@ FIXME: The popup could be synchronized with one ...@@ -541,9 +527,8 @@ FIXME: The popup could be synchronized with one
#endif #endif
/* /*
* The pClipRegion is destroyed calling nxagentChangeClip(), * The pClipRegion is destroyed calling nxagentChangeClip(), so
* so we deallocate it explicitly only if we don't change * we deallocate it explicitly only if we don't change the clip.
* the clip.
*/ */
nxagentFreeRegion(pSrcDrawable, pClipRegion); nxagentFreeRegion(pSrcDrawable, pClipRegion);
...@@ -602,9 +587,9 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -602,9 +587,9 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
#endif #endif
/* /*
* Here, before using fbDoCopy() called by fbCopyArea(), * Here, before using fbDoCopy() called by fbCopyArea(), it should be
* it should be provided that the cast in fbDoCopy() from * provided that the cast in fbDoCopy() from int to short int would
* int to short int would not cut off significative bits. * not cut off significative bits.
*/ */
if (dstx + pDstDrawable->x + width > 32767) if (dstx + pDstDrawable->x + width > 32767)
...@@ -713,9 +698,9 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -713,9 +698,9 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
} }
/* /*
* Try to detect if the copy area is to a window * Try to detect if the copy area is to a window that is unmapped or
* that is unmapped or fully covered. Similarly * fully covered. Similarly to the check in Image.c, this is of
* to the check in Image.c, this is of little use. * little use.
*/ */
if (nxagentOption(IgnoreVisibility) == 0 && pDstDrawable -> type == DRAWABLE_WINDOW && if (nxagentOption(IgnoreVisibility) == 0 && pDstDrawable -> type == DRAWABLE_WINDOW &&
...@@ -731,11 +716,9 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -731,11 +716,9 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
} }
/* /*
* If the pixmap is on shared memory, we can't * If the pixmap is on shared memory, we can't know if the pixmap
* know if the pixmap content is changed and * content is changed and so have to translate the operation in a
* so have to translate the operation in a put * put image operation. This can seriously affect the performance.
* image operation. This can seriously affect
* the performance.
*/ */
if (pSrcDrawable -> type == DRAWABLE_PIXMAP && if (pSrcDrawable -> type == DRAWABLE_PIXMAP &&
...@@ -765,8 +748,8 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -765,8 +748,8 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
fbGetImage(nxagentVirtualDrawable(pSrcDrawable), srcx, srcy, width, height, format, planeMask, data); fbGetImage(nxagentVirtualDrawable(pSrcDrawable), srcx, srcy, width, height, format, planeMask, data);
/* /*
* If the source is a shared memory pixmap, * If the source is a shared memory pixmap, put the image directly
* put the image directly to the destination. * to the destination.
*/ */
nxagentPutImage(pDstDrawable, pGC, depth, dstx, dsty, nxagentPutImage(pDstDrawable, pGC, depth, dstx, dsty,
...@@ -781,10 +764,9 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -781,10 +764,9 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
SAFE_free(data); SAFE_free(data);
/* /*
* If the source is a shared memory pixmap, the * If the source is a shared memory pixmap, the content of the
* content of the framebuffer has been placed * framebuffer has been placed directly on the destination so we
* directly on the destination so we can skip * can skip the copy area operation.
* the copy area operation.
*/ */
skip = 1; skip = 1;
...@@ -816,8 +798,8 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -816,8 +798,8 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
nxagentGC(pGC), srcx, srcy, width, height, dstx, dsty); nxagentGC(pGC), srcx, srcy, width, height, dstx, dsty);
/* /*
* The copy area restored the synchroni- * The copy area restored the synchronization status of
* zation status of destination drawable. * destination drawable.
*/ */
if (nxagentDrawableStatus(pDstDrawable) == NotSynchronized) if (nxagentDrawableStatus(pDstDrawable) == NotSynchronized)
...@@ -867,8 +849,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -867,8 +849,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
else if (pDstDrawable -> type == DRAWABLE_PIXMAP) else if (pDstDrawable -> type == DRAWABLE_PIXMAP)
{ {
/* /*
* If we are here the source drawable * If we are here the source drawable must be a window.
* must be a window.
*/ */
if (((WindowPtr) pSrcDrawable) -> viewable) if (((WindowPtr) pSrcDrawable) -> viewable)
...@@ -885,8 +866,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -885,8 +866,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
else else
{ {
/* /*
* If we are here the source drawable * If we are here the source drawable must be a window.
* must be a window.
*/ */
if (((WindowPtr) pSrcDrawable) -> viewable) if (((WindowPtr) pSrcDrawable) -> viewable)
...@@ -947,11 +927,9 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -947,11 +927,9 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
} }
/* /*
* If the pixmap is on shared memory, we can't * If the pixmap is on shared memory, we can't know if the pixmap
* know if the pixmap content is changed and * content is changed and so have to translate the operation in a
* so have to translate the operation in a put * put image operation. This can seriously affect the performance.
* image operation. This can seriously affect
* the performance.
*/ */
if (pSrcDrawable -> type == DRAWABLE_PIXMAP && if (pSrcDrawable -> type == DRAWABLE_PIXMAP &&
...@@ -981,8 +959,8 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -981,8 +959,8 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
fbGetImage(nxagentVirtualDrawable(pSrcDrawable), srcx, srcy, width, height, format, planeMask, data); fbGetImage(nxagentVirtualDrawable(pSrcDrawable), srcx, srcy, width, height, format, planeMask, data);
/* /*
* If the source is a shared memory pixmap, * If the source is a shared memory pixmap, put the image directly
* put the image directly to the destination. * to the destination.
*/ */
nxagentPutImage(pDstDrawable, pGC, depth, dstx, dsty, nxagentPutImage(pDstDrawable, pGC, depth, dstx, dsty,
...@@ -997,10 +975,9 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -997,10 +975,9 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
SAFE_free(data); SAFE_free(data);
/* /*
* If the source is a shared memory pixmap, the * If the source is a shared memory pixmap, the content of the
* content of the framebuffer has been placed * framebuffer has been placed directly on the destination so we
* directly on the destination so we can skip * can skip the copy plane operation.
* the copy plane operation.
*/ */
skip = 1; skip = 1;
...@@ -1453,9 +1430,9 @@ void nxagentFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape, ...@@ -1453,9 +1430,9 @@ void nxagentFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape,
} }
/* /*
* The coordinate-mode must be CoordModePrevious * The coordinate-mode must be CoordModePrevious to make better use
* to make better use of differential encoding of * of differential encoding of X_FillPoly request by the side of
* X_FillPoly request by the side of proxy. * proxy.
*/ */
if (mode == CoordModeOrigin) if (mode == CoordModeOrigin)
...@@ -1465,17 +1442,15 @@ void nxagentFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape, ...@@ -1465,17 +1442,15 @@ void nxagentFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape,
newPoints = malloc(nPoints * sizeof(xPoint)); newPoints = malloc(nPoints * sizeof(xPoint));
/* /*
* The first point is always relative * The first point is always relative to the drawable's origin.
* to the drawable's origin.
*/ */
newPoints[0].x = pPoints[0].x; newPoints[0].x = pPoints[0].x;
newPoints[0].y = pPoints[0].y; newPoints[0].y = pPoints[0].y;
/* /*
* If coordinate-mode is CoordModePrevious, * If coordinate-mode is CoordModePrevious, the points following
* the points following the first are rela- * the first are relative to the previous point.
* tive to the previous point.
*/ */
for (int i = 1; i < nPoints; i++) for (int i = 1; i < nPoints; i++)
...@@ -1569,12 +1544,11 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, ...@@ -1569,12 +1544,11 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC,
} }
/* /*
* The PolyFillRect acts in two ways: if the GC * The PolyFillRect acts in two ways: if the GC has a corrupted
* has a corrupted tile, the operation propagates * tile, the operation propagates the corrupted region on the
* the corrupted region on the destination. In * destination. In other cases, because the PolyFillRect will cover
* other cases, because the PolyFillRect will * the destination, any corrupted region intersecting the target
* cover the destination, any corrupted region * will be cleared.
* intersecting the target will be cleared.
*/ */
int inheritCorruptedRegion = 0; int inheritCorruptedRegion = 0;
...@@ -1622,10 +1596,9 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, ...@@ -1622,10 +1596,9 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC,
if (inheritCorruptedRegion == 1) if (inheritCorruptedRegion == 1)
{ {
/* /*
* The fill style should affect the cor- * The fill style should affect the corrupted region
* rupted region propagation: if the tile * propagation: if the tile is not completely corrupted the
* is not completely corrupted the region * region should be 'tiled' over the destination.
* should be 'tiled' over the destination.
*/ */
nxagentMarkCorruptedRegion(pDrawable, rectRegion); nxagentMarkCorruptedRegion(pDrawable, rectRegion);
...@@ -1639,11 +1612,10 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, ...@@ -1639,11 +1612,10 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC,
else else
{ {
/* /*
* The stipple mask computation could cause * The stipple mask computation could cause an high
* an high fragmentation of the destination * fragmentation of the destination region. An analysis should
* region. An analysis should be done to exa- * be done to examine the better solution (e.g.rdesktop uses
* mine the better solution (e.g.rdesktop * stipples to draw texts).
* uses stipples to draw texts).
*/ */
#ifdef TEST #ifdef TEST
...@@ -1768,8 +1740,7 @@ int nxagentPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x, ...@@ -1768,8 +1740,7 @@ int nxagentPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x,
int y, int count, char *string) int y, int count, char *string)
{ {
/* /*
* While the session is suspended * While the session is suspended the font structure is NULL.
* the font structure is NULL.
*/ */
if (nxagentFontStruct(pGC -> font) == NULL) if (nxagentFontStruct(pGC -> font) == NULL)
...@@ -1839,8 +1810,7 @@ int nxagentPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, ...@@ -1839,8 +1810,7 @@ int nxagentPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x,
int y, int count, unsigned short *string) int y, int count, unsigned short *string)
{ {
/* /*
* While the session is suspended * While the session is suspended the font structure is NULL.
* the font structure is NULL.
*/ */
if (nxagentFontStruct(pGC -> font) == NULL) if (nxagentFontStruct(pGC -> font) == NULL)
......
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