Skip to content

Commit 6de6173

Browse files
nwnksunweaver
authored andcommitted
dix: Drop the third argument from WindowExposuresProcPtr
Backport from X.org: dix: Drop the third argument from WindowExposuresProcPtr A careful read shows that it was always NULL. It hasn't always been; as the DDX spec indicates, it was the "occluded region that has backing store", but since that backing store code is long gone, we can nuke it. mi{,Overlay}WindowExposures get slightly simpler here, and will get even simpler in just a moment. Reviewed-by: Julien Cristau <[email protected]> Signed-off-by: Adam Jackson <[email protected]> Backported to NX by: Mike Gabriel <[email protected]>
1 parent 12eed42 commit 6de6173

File tree

14 files changed

+51
-91
lines changed

14 files changed

+51
-91
lines changed

nx-X11/programs/Xserver/dix/window.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2760,7 +2760,7 @@ MapWindow(register WindowPtr pWin, ClientPtr client)
27602760
(*pScreen->PostValidateTree)(NullWindow, pWin, VTMap);
27612761
RegionNull(&temp);
27622762
RegionCopy(&temp, &pWin->clipList);
2763-
(*pScreen->WindowExposures) (pWin, &temp, NullRegion);
2763+
(*pScreen->WindowExposures) (pWin, &temp);
27642764
RegionUninit(&temp);
27652765
}
27662766

nx-X11/programs/Xserver/fb/fboverlay.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,13 +270,12 @@ fbOverlayCopyWindow(WindowPtr pWin,
270270

271271
void
272272
fbOverlayWindowExposures (WindowPtr pWin,
273-
RegionPtr prgn,
274-
RegionPtr other_exposed)
273+
RegionPtr prgn)
275274
{
276275
fbOverlayUpdateLayerRegion (pWin->drawable.pScreen,
277276
fbOverlayWindowLayer (pWin),
278277
prgn);
279-
miWindowExposures(pWin, prgn, other_exposed);
278+
miWindowExposures(pWin, prgn);
280279
}
281280

282281
void

nx-X11/programs/Xserver/fb/fboverlay.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ fbOverlayCopyWindow(WindowPtr pWin,
8989

9090
void
9191
fbOverlayWindowExposures (WindowPtr pWin,
92-
RegionPtr prgn,
93-
RegionPtr other_exposed);
92+
RegionPtr prgn);
9493

9594
void
9695
fbOverlayPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what);

nx-X11/programs/Xserver/hw/nxagent/Drawable.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3120,7 +3120,7 @@ void nxagentSendBackgroundExpose(WindowPtr pWin, PixmapPtr pBackground, RegionPt
31203120

31213121
RegionTranslate(&expose, pWin -> drawable.x, pWin -> drawable.y);
31223122

3123-
miWindowExposures(pWin, &expose, &expose);
3123+
miWindowExposures(pWin, &expose);
31243124

31253125
nxagentSendBackgroundExposeEnd:
31263126

@@ -3230,7 +3230,7 @@ int nxagentClipAndSendClearExpose(WindowPtr pWin, void * ptr)
32303230

32313231
RegionSubtract(remoteExposeRgn, remoteExposeRgn, exposeRgn);
32323232

3233-
miWindowExposures(pWin, exposeRgn, exposeRgn);
3233+
miWindowExposures(pWin, exposeRgn);
32343234
}
32353235

32363236
RegionDestroy(exposeRgn);

nx-X11/programs/Xserver/hw/nxagent/Events.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2483,7 +2483,7 @@ FIXME: This can be maybe optimized by consuming the
24832483

24842484
if (index == -1)
24852485
{
2486-
miWindowExposures(pWin, &sum, NullRegion);
2486+
miWindowExposures(pWin, &sum);
24872487
}
24882488
else
24892489
{
@@ -2545,6 +2545,10 @@ int nxagentHandleGraphicsExposeEvent(XEvent *X)
25452545

25462546
pWin = nxagentWindowPtr(X -> xgraphicsexpose.drawable);
25472547

2548+
if (pWin == 0) {
2549+
return 1;
2550+
}
2551+
25482552
/*
25492553
* Rectangle affected by GraphicsExpose
25502554
* event.
@@ -2563,6 +2567,14 @@ int nxagentHandleGraphicsExposeEvent(XEvent *X)
25632567
* must be relative to the screen.
25642568
*/
25652569

2570+
// #ifdef TEST
2571+
fprintf(stderr, "nxagentHandleGraphicsExposeEvent: graphics expose event with expose region rectangle "
2572+
"x1 [%d], y1 [%d] and x2 [%d] y2 [%d]. and drawable [%ld] with x [%d] and y[%d].\n",
2573+
rect.x1, rect.y1, rect.x2, rect.y2,
2574+
X -> xgraphicsexpose.drawable,
2575+
pWin -> drawable.x, pWin -> drawable.y);
2576+
// #endif
2577+
25662578
RegionTranslate(exposeRegion, pWin -> drawable.x, pWin -> drawable.y);
25672579

25682580
RegionUnion(nxagentRemoteExposeRegion, nxagentRemoteExposeRegion, exposeRegion);
@@ -4036,7 +4048,7 @@ void nxagentSynchronizeExpose(void)
40364048
RegionNumRects(nxagentExposeQueueHead.remoteRegion));
40374049
#endif
40384050

4039-
miWindowExposures(pWin, nxagentExposeQueueHead.remoteRegion, NullRegion);
4051+
miWindowExposures(pWin, nxagentExposeQueueHead.remoteRegion);
40404052
}
40414053
}
40424054
}
@@ -4271,7 +4283,7 @@ int nxagentClipAndSendExpose(WindowPtr pWin, void * ptr)
42714283

42724284
RegionSubtract(remoteExposeRgn, remoteExposeRgn, exposeRgn);
42734285

4274-
miWindowExposures(pWin, exposeRgn, NullRegion);
4286+
miWindowExposures(pWin, exposeRgn);
42754287
}
42764288

42774289
RegionDestroy(exposeRgn);

nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -353,16 +353,15 @@ miHandleExposures(pSrcDrawable, pDstDrawable,
353353
}
354354

355355
void
356-
miWindowExposures(pWin, prgn, other_exposed)
356+
miWindowExposures(pWin, prgn)
357357
WindowPtr pWin;
358-
register RegionPtr prgn, other_exposed;
358+
register RegionPtr prgn;
359359
{
360360

361361
int total;
362362

363363
RegionPtr exposures = prgn;
364-
if ((prgn && !RegionNil(prgn)) ||
365-
(exposures && !RegionNil(exposures)) || other_exposed)
364+
if ((prgn && !RegionNil(prgn)) || (exposures && !RegionNil(exposures)))
366365
{
367366
RegionRec expRec;
368367
int clientInterested;
@@ -371,18 +370,6 @@ miWindowExposures(pWin, prgn, other_exposed)
371370
* Restore from backing-store FIRST.
372371
*/
373372
clientInterested = (pWin->eventMask|wOtherEventMasks(pWin)) & ExposureMask;
374-
if (other_exposed)
375-
{
376-
if (exposures)
377-
{
378-
RegionUnion(other_exposed,
379-
exposures,
380-
other_exposed);
381-
if (exposures != prgn)
382-
RegionDestroy(exposures);
383-
}
384-
exposures = other_exposed;
385-
}
386373

387374
/*
388375
* If the number of rectangles is greater
@@ -424,7 +411,7 @@ miWindowExposures(pWin, prgn, other_exposed)
424411
{
425412
RegionUninit(exposures);
426413
}
427-
else if (exposures && exposures != prgn && exposures != other_exposed)
414+
else if (exposures && exposures != prgn)
428415
RegionDestroy(exposures);
429416
if (prgn)
430417
RegionEmpty(prgn);

nx-X11/programs/Xserver/hw/nxagent/NXwindow.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ MapWindow(register WindowPtr pWin, ClientPtr client)
929929
(*pScreen->PostValidateTree)(NullWindow, pWin, VTMap);
930930
RegionNull(&temp);
931931
RegionCopy(&temp, &pWin->clipList);
932-
(*pScreen->WindowExposures) (pWin, &temp, NullRegion);
932+
(*pScreen->WindowExposures) (pWin, &temp);
933933
RegionUninit(&temp);
934934
}
935935

nx-X11/programs/Xserver/hw/nxagent/Window.c

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2110,7 +2110,7 @@ void nxagentClipNotify(WindowPtr pWin, int dx, int dy)
21102110
#endif /* NXAGENT_SHAPE */
21112111
}
21122112

2113-
void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_exposed)
2113+
void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn)
21142114
{
21152115
/*
21162116
* The problem: we want to synthetize the expose events internally, so
@@ -2202,11 +2202,6 @@ void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_expo
22022202
RegionUnion(&temp, &temp, pRgn);
22032203
}
22042204

2205-
if (other_exposed != NULL)
2206-
{
2207-
RegionUnion(&temp, &temp, other_exposed);
2208-
}
2209-
22102205
if (RegionNil(&temp) == 0)
22112206
{
22122207
RegionTranslate(&temp,
@@ -2281,12 +2276,11 @@ void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_expo
22812276
fprintf(stderr, "nxagentWindowExposures: WARNING! Reached maximum size of collect exposures vector.\n");
22822277
#endif
22832278

2284-
if ((pRgn != NULL && RegionNotEmpty(pRgn) != 0) ||
2285-
(other_exposed != NULL && RegionNotEmpty(other_exposed) != 0))
2279+
if (pRgn != NULL && RegionNotEmpty(pRgn) != 0)
22862280
{
2287-
nxagentUnmarkExposedRegion(pWin, pRgn, other_exposed);
2281+
nxagentUnmarkExposedRegion(pWin, pRgn, NullRegion);
22882282

2289-
miWindowExposures(pWin, pRgn, other_exposed);
2283+
miWindowExposures(pWin, pRgn);
22902284
}
22912285

22922286
return;
@@ -2296,12 +2290,11 @@ void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_expo
22962290
RegionUninit(&temp);
22972291
}
22982292

2299-
if ((pRgn != NULL && RegionNotEmpty(pRgn) != 0) ||
2300-
(other_exposed != NULL && RegionNotEmpty(other_exposed) != 0))
2293+
if (pRgn != NULL && RegionNotEmpty(pRgn) != 0)
23012294
{
2302-
nxagentUnmarkExposedRegion(pWin, pRgn, other_exposed);
2295+
nxagentUnmarkExposedRegion(pWin, pRgn, NullRegion);
23032296

2304-
miWindowExposures(pWin, pRgn, other_exposed);
2297+
miWindowExposures(pWin, pRgn);
23052298
}
23062299

23072300
return;
@@ -2489,7 +2482,7 @@ static int nxagentForceExposure(WindowPtr pWin, void * ptr)
24892482

24902483
if (exposedRgn != NULL && RegionNotEmpty(exposedRgn) != 0)
24912484
{
2492-
miWindowExposures(pWin, exposedRgn, NullRegion);
2485+
miWindowExposures(pWin, exposedRgn);
24932486
}
24942487

24952488
RegionDestroy(exposedRgn);

nx-X11/programs/Xserver/hw/nxagent/Windows.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ Bool nxagentUnrealizeWindow(WindowPtr pWin);
204204

205205
Bool nxagentCheckIllegalRootMonitoring(WindowPtr pWin, Mask mask);
206206

207-
void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_exposed);
207+
void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn);
208208

209209
void nxagentPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what);
210210

nx-X11/programs/Xserver/include/scrnintstr.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,7 @@ typedef void (* PostValidateTreeProcPtr)(
166166

167167
typedef void (* WindowExposuresProcPtr)(
168168
WindowPtr /*pWindow*/,
169-
RegionPtr /*prgn*/,
170-
RegionPtr /*other_exposed*/);
169+
RegionPtr /*prgn*/);
171170

172171
typedef void (* PaintWindowProcPtr)(
173172
WindowPtr /*pWindow*/,

0 commit comments

Comments
 (0)