Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
c3a7e9b5
Commit
c3a7e9b5
authored
Oct 22, 2019
by
Ulrich Sibiller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GC.c: reformat comments
save some lines
parent
e0e602cf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
53 deletions
+39
-53
GC.c
nx-X11/programs/Xserver/hw/nxagent/GC.c
+39
-53
No files found.
nx-X11/programs/Xserver/hw/nxagent/GC.c
View file @
c3a7e9b5
...
@@ -161,11 +161,9 @@ Bool nxagentCreateGC(GCPtr pGC)
...
@@ -161,11 +161,9 @@ Bool nxagentCreateGC(GCPtr pGC)
}
}
/*
/*
* We create the GC based on the default
* We create the GC based on the default drawables. The proxy knows
* drawables. The proxy knows this and
* this and optimizes the encoding of the create GC message to
* optimizes the encoding of the create
* include the id of the drawable in the checksum.
* GC message to include the id of the
* drawable in the checksum.
*/
*/
nxagentGCPriv
(
pGC
)
->
gc
=
XCreateGC
(
nxagentDisplay
,
nxagentGCPriv
(
pGC
)
->
gc
=
XCreateGC
(
nxagentDisplay
,
...
@@ -247,8 +245,8 @@ void nxagentValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
...
@@ -247,8 +245,8 @@ void nxagentValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
if
(
pVirtual
->
bitsPerPixel
==
0
)
if
(
pVirtual
->
bitsPerPixel
==
0
)
{
{
/*
/*
* Don't enter fbValidateGC() with 0 bpp
* Don't enter fbValidateGC() with 0 bpp
or agent will block in a
*
or agent will block in a
endless loop.
* endless loop.
*/
*/
#ifdef WARNING
#ifdef WARNING
...
@@ -327,13 +325,11 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask)
...
@@ -327,13 +325,11 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask)
nxagentGCTrap
==
0
)
nxagentGCTrap
==
0
)
{
{
/*
/*
* If the tile is corrupted and is not too
* If the tile is corrupted and is not too much large, it can
* much large, it can be synchronized imme-
* be synchronized imme- diately. In the other cases, the tile
* diately. In the other cases, the tile is
* is cleared with a solid color to become usable. This
* cleared with a solid color to become usa-
* approach should solve the high delay on slow links waiting
* ble. This approach should solve the high
* for a background tile to be synchronized.
* delay on slow links waiting for a back-
* ground tile to be synchronized.
*/
*/
if
(
nxagentOption
(
DeferLevel
)
>=
2
&&
if
(
nxagentOption
(
DeferLevel
)
>=
2
&&
...
@@ -481,8 +477,8 @@ void nxagentCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst)
...
@@ -481,8 +477,8 @@ void nxagentCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst)
XCopyGC
(
nxagentDisplay
,
nxagentGC
(
pGCSrc
),
mask
,
nxagentGC
(
pGCDst
));
XCopyGC
(
nxagentDisplay
,
nxagentGC
(
pGCSrc
),
mask
,
nxagentGC
(
pGCDst
));
/*
/*
* Copy the private foreground field
* Copy the private foreground field
of the GC if GCForeground is
*
of the GC if GCForeground is
set.
* set.
*/
*/
nxagentCopyGCPriv
(
GCForeground
,
foreground
,
pGCSrc
,
mask
,
pGCDst
);
nxagentCopyGCPriv
(
GCForeground
,
foreground
,
pGCSrc
,
mask
,
pGCDst
);
...
@@ -663,9 +659,8 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
...
@@ -663,9 +659,8 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
case
CT_YXBANDED
:
case
CT_YXBANDED
:
{
{
/*
/*
* Other parts of the server can only
* Other parts of the server can only deal with CT_NONE,
* deal with CT_NONE, CT_PIXMAP and
* CT_PIXMAP and CT_REGION client clips.
* CT_REGION client clips.
*/
*/
pGC
->
clientClip
=
(
void
*
)
RegionFromRects
(
nRects
,
pGC
->
clientClip
=
(
void
*
)
RegionFromRects
(
nRects
,
...
@@ -1028,9 +1023,8 @@ Bool nxagentReconnectAllGCs(void *p0)
...
@@ -1028,9 +1023,8 @@ Bool nxagentReconnectAllGCs(void *p0)
#endif
#endif
/*
/*
* The resource type RT_NX_GC is created on the
* The resource type RT_NX_GC is created on the server client only,
* server client only, so we can avoid to loop
* so we can avoid to loop through all the clients.
* through all the clients.
*/
*/
FindClientResourcesByType
(
clients
[
serverClient
->
index
],
RT_NX_GC
,
nxagentReconnectGC
,
&
GCSuccess
);
FindClientResourcesByType
(
clients
[
serverClient
->
index
],
RT_NX_GC
,
nxagentReconnectGC
,
&
GCSuccess
);
...
@@ -1088,9 +1082,8 @@ Bool nxagentDisconnectAllGCs(void)
...
@@ -1088,9 +1082,8 @@ Bool nxagentDisconnectAllGCs(void)
#endif
#endif
/*
/*
* The resource type RT_NX_GC is created on the
* The resource type RT_NX_GC is created on the server client only,
* server client only, so we can avoid to loop
* so we can avoid to loop through all the clients.
* through all the clients.
*/
*/
FindClientResourcesByType
(
clients
[
serverClient
->
index
],
RT_NX_GC
,
FindClientResourcesByType
(
clients
[
serverClient
->
index
],
RT_NX_GC
,
...
@@ -1155,10 +1148,9 @@ static void nxagentReconnectClip(GCPtr pGC, int type, void * pValue, int nRects)
...
@@ -1155,10 +1148,9 @@ static void nxagentReconnectClip(GCPtr pGC, int type, void * pValue, int nRects)
}
}
/*
/*
* Originally, the clip origin area were 0,0
* Originally, the clip origin area were 0,0 but it didn't
* but it didn't work with kedit and family,
* work with kedit and family, because it got the clip mask of
* because it got the clip mask of the pixmap
* the pixmap all traslated.
* all traslated.
*/
*/
XSetClipRectangles
(
nxagentDisplay
,
nxagentGC
(
pGC
),
pGC
->
clipOrg
.
x
,
pGC
->
clipOrg
.
y
,
XSetClipRectangles
(
nxagentDisplay
,
nxagentGC
(
pGC
),
pGC
->
clipOrg
.
x
,
pGC
->
clipOrg
.
y
,
...
@@ -1228,8 +1220,8 @@ static void nxagentReconnectClip(GCPtr pGC, int type, void * pValue, int nRects)
...
@@ -1228,8 +1220,8 @@ static void nxagentReconnectClip(GCPtr pGC, int type, void * pValue, int nRects)
case
CT_YXBANDED
:
case
CT_YXBANDED
:
/*
/*
* other parts of server can only deal with CT_NONE,
* other parts of server can only deal with CT_NONE,
CT_PIXMAP
*
CT_PIXMAP
and CT_REGION client clips.
* and CT_REGION client clips.
*/
*/
pGC
->
clientClip
=
(
void
*
)
RegionFromRects
(
nRects
,
pGC
->
clientClip
=
(
void
*
)
RegionFromRects
(
nRects
,
...
@@ -1290,18 +1282,15 @@ static int nxagentCompareRegions(RegionPtr r1, RegionPtr r2)
...
@@ -1290,18 +1282,15 @@ static int nxagentCompareRegions(RegionPtr r1, RegionPtr r2)
}
}
/*
/*
* This function have to be called in the place
* This function have to be called in the place of GetScratchGC if the
* of GetScratchGC if the GC will be used to per-
* GC will be used to perform operations also on the remote X Server.
* form operations also on the remote X Server.
* This is why we call the XChangeGC at the end of the function.
* This is why we call the XChangeGC at the end of
* the function.
*/
*/
GCPtr
nxagentGetScratchGC
(
unsigned
depth
,
ScreenPtr
pScreen
)
GCPtr
nxagentGetScratchGC
(
unsigned
depth
,
ScreenPtr
pScreen
)
{
{
/*
/*
* The GC trap is temporarily disabled in
* The GC trap is temporarily disabled in order to allow the remote
* order to allow the remote clipmask reset
* clipmask reset requested by GetScratchGC().
* requested by GetScratchGC().
*/
*/
int
nxagentSaveGCTrap
=
nxagentGCTrap
;
int
nxagentSaveGCTrap
=
nxagentGCTrap
;
...
@@ -1353,8 +1342,7 @@ GCPtr nxagentGetScratchGC(unsigned depth, ScreenPtr pScreen)
...
@@ -1353,8 +1342,7 @@ GCPtr nxagentGetScratchGC(unsigned depth, ScreenPtr pScreen)
}
}
/*
/*
* This function is only a wrapper for
* This function is only a wrapper for FreeScratchGC.
* FreeScratchGC.
*/
*/
void
nxagentFreeScratchGC
(
GCPtr
pGC
)
void
nxagentFreeScratchGC
(
GCPtr
pGC
)
{
{
...
@@ -1371,10 +1359,9 @@ void nxagentFreeScratchGC(GCPtr pGC)
...
@@ -1371,10 +1359,9 @@ void nxagentFreeScratchGC(GCPtr pGC)
}
}
/*
/*
* The GCs belonging to this list are used
* The GCs belonging to this list are used only in the synchronization
* only in the synchronization put images,
* put images, to be sure they preserve the default values and to
* to be sure they preserve the default va-
* avoid XChangeGC() requests.
* lues and to avoid XChangeGC() requests.
*/
*/
GCPtr
nxagentGetGraphicContext
(
DrawablePtr
pDrawable
)
GCPtr
nxagentGetGraphicContext
(
DrawablePtr
pDrawable
)
...
@@ -1424,8 +1411,8 @@ GCPtr nxagentGetGraphicContext(DrawablePtr pDrawable)
...
@@ -1424,8 +1411,8 @@ GCPtr nxagentGetGraphicContext(DrawablePtr pDrawable)
GCPtr
nxagentCreateGraphicContext
(
int
depth
)
GCPtr
nxagentCreateGraphicContext
(
int
depth
)
{
{
/*
/*
* We have not found a GC, so we have
* We have not found a GC, so we have
to spread the list and add a
*
to spread the list and add a
new GC.
* new GC.
*/
*/
nxagentGraphicContextsPtr
nxagentGCs
=
realloc
(
nxagentGraphicContexts
,
(
nxagentGraphicContextsSize
+
1
)
*
sizeof
(
nxagentGraphicContextsRec
));
nxagentGraphicContextsPtr
nxagentGCs
=
realloc
(
nxagentGraphicContexts
,
(
nxagentGraphicContextsSize
+
1
)
*
sizeof
(
nxagentGraphicContextsRec
));
...
@@ -1467,9 +1454,8 @@ GCPtr nxagentCreateGraphicContext(int depth)
...
@@ -1467,9 +1454,8 @@ GCPtr nxagentCreateGraphicContext(int depth)
}
}
/*
/*
* The IncludeInferiors property is useful to
* The IncludeInferiors property is useful to solve problems when
* solve problems when synchronizing windows
* synchronizing windows covered by an invisible child.
* covered by an invisible child.
*/
*/
attributes
[
1
]
=
IncludeInferiors
;
attributes
[
1
]
=
IncludeInferiors
;
...
@@ -1491,9 +1477,9 @@ GCPtr nxagentCreateGraphicContext(int depth)
...
@@ -1491,9 +1477,9 @@ GCPtr nxagentCreateGraphicContext(int depth)
}
}
/*
/*
* This initialization is called in the InitOutput()
* This initialization is called in the InitOutput()
function
*
function immediately after opening the screen,
*
immediately after opening the screen, which is used to create the
*
which is used to create the GCs.
*
GCs.
*/
*/
void
nxagentAllocateGraphicContexts
(
void
)
void
nxagentAllocateGraphicContexts
(
void
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment