Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various backports for Xserver/mi/miexpose (esp. miPaintWindow rewrite) #424

Open
wants to merge 5 commits into
base: 3.6.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions nx-X11/programs/Xserver/Xext/panoramiXprocs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1117,8 +1117,7 @@ int PanoramiXCopyArea(ClientPtr client)
}
}
RegionValidate(&totalReg, &overlap);
(*pScreen->SendGraphicsExpose)(
client, &totalReg, stuff->dstDrawable, X_CopyArea, 0);
SendGraphicsExpose(client, &totalReg, stuff->dstDrawable, X_CopyArea, 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why you haven't formatted this as upstream did here and below?

RegionUninit(&totalReg);
}

Expand Down Expand Up @@ -1224,8 +1223,7 @@ int PanoramiXCopyPlane(ClientPtr client)
}
}
RegionValidate(&totalReg, &overlap);
(*pScreen->SendGraphicsExpose)(
client, &totalReg, stuff->dstDrawable, X_CopyPlane, 0);
SendGraphicsExpose(client, &totalReg, stuff->dstDrawable, X_CopyPlane, 0);
RegionUninit(&totalReg);
}

Expand Down
3 changes: 3 additions & 0 deletions nx-X11/programs/Xserver/dix/Imakefile
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ VENDORRELEASE = XVendorRelease

SITE_DEFINES = $(SITE_FONT_PATH) $(SITE_DISPLAY_CLASS)

XSERVER_ABI_DEFINES = -DXSERVER_OLD_TRYCLIENTEVENTS_ABI

VENDOR_DEFINES = $(VENDOR_STRING) $(VENDOR_RELEASE) $(QUARTZ_DEFINES)

NormalLibraryObjectRule()
Expand All @@ -137,6 +139,7 @@ SpecialCObjectRule(main,$(ICONFIGFILES),$(VENDOR_DEFINES))
SpecialCObjectRule(pixmap,$(ICONFIGFILES),$(_NOOP_))
SpecialCObjectRule(privates,$(ICONFIGFILES),$(_NOOP_))
SpecialCObjectRule(window,$(ICONFIGFILES),$(QUARTZ_DEFINES))
SpecialCObjectRule(dispatch,$(ICONFIGFILES),$(XSERVER_ABI_DEFINES))

NormalLibraryTarget(xpstubs,$(XPOBJ))

Expand Down
57 changes: 53 additions & 4 deletions nx-X11/programs/Xserver/dix/dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -1711,6 +1711,57 @@ ProcClearToBackground(register ClientPtr client)
return(client->noClientException);
}

/* send GraphicsExpose events, or a NoExpose event, based on the region */
void
SendGraphicsExpose(ClientPtr client, RegionPtr pRgn, XID drawable,
int major, int minor)
{
if (pRgn && !RegionNil(pRgn)) {
xEvent *pEvent;
xEvent *pe;
BoxPtr pBox;
int i;
int numRects;

numRects = RegionNumRects(pRgn);
pBox = RegionRects(pRgn);
if (!(pEvent = calloc(numRects, sizeof(xEvent))))
return;
pe = pEvent;

for (i = 1; i <= numRects; i++, pe++, pBox++) {
pe->u.u.type = GraphicsExpose;
pe->u.graphicsExposure.drawable = drawable;
pe->u.graphicsExposure.x = pBox->x1;
pe->u.graphicsExposure.y = pBox->y1;
pe->u.graphicsExposure.width = pBox->x2 - pBox->x1;
pe->u.graphicsExposure.height = pBox->y2 - pBox->y1;
pe->u.graphicsExposure.count = numRects - i;
pe->u.graphicsExposure.majorEvent = major;
pe->u.graphicsExposure.minorEvent = minor;
}
/* GraphicsExpose is a "critical event", which TryClientEvents
* handles specially. */
#ifndef XSERVER_OLD_TRYCLIENTEVENTS_ABI
TryClientEvents(client, NULL, pEvent, numRects,
(Mask) 0, NoEventMask, NullGrab);
#else
TryClientEvents(client, pEvent, numRects,
(Mask) 0, NoEventMask, NullGrab);
#endif /* XSERVER_OLD_TRYCLIENTEVENTS_ABI */
free(pEvent);
}
else {
xEvent event = {
.u.noExposure.drawable = drawable,
.u.noExposure.majorEvent = major,
.u.noExposure.minorEvent = minor
};
event.u.u.type = NoExpose;
WriteEventsToClient(client, 1, &event);
}
}

int
ProcCopyArea(register ClientPtr client)
{
Expand Down Expand Up @@ -1743,8 +1794,7 @@ ProcCopyArea(register ClientPtr client)
stuff->dstX, stuff->dstY);
if (pGC->graphicsExposures)
{
(*pDst->pScreen->SendGraphicsExpose)
(client, pRgn, stuff->dstDrawable, X_CopyArea, 0);
SendGraphicsExpose(client, pRgn, stuff->dstDrawable, X_CopyArea, 0);
if (pRgn)
RegionDestroy(pRgn);
}
Expand Down Expand Up @@ -1791,8 +1841,7 @@ ProcCopyPlane(register ClientPtr client)
stuff->dstX, stuff->dstY, stuff->bitPlane);
if (pGC->graphicsExposures)
{
(*pdstDraw->pScreen->SendGraphicsExpose)
(client, pRgn, stuff->dstDrawable, X_CopyPlane, 0);
SendGraphicsExpose(client, pRgn, stuff->dstDrawable, X_CopyPlane, 0);
if (pRgn)
RegionDestroy(pRgn);
}
Expand Down
1 change: 1 addition & 0 deletions nx-X11/programs/Xserver/hw/nxagent/Imakefile
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ DEFINES = \
-DRANDR_15_INTERFACE=1 \
-DPANORAMIX \
-UDEBUG_TREE \
-DXSERVER_OLD_TRYCLIENTEVENTS_ABI \
$(NULL)

all:: $(OBJS)
Expand Down
6 changes: 6 additions & 0 deletions nx-X11/programs/Xserver/include/dix.h
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,12 @@ extern void ClientWakeup(
extern Bool ClientIsAsleep(
ClientPtr /*client*/);

extern void SendGraphicsExpose(ClientPtr /*client */ ,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could also directly use the current style here as well.

RegionPtr /*pRgn */ ,
XID /*drawable */ ,
int /*major */ ,
int /*minor */);

/* atom.c */

extern Atom MakeAtom(
Expand Down
8 changes: 0 additions & 8 deletions nx-X11/programs/Xserver/include/scrnintstr.h
Original file line number Diff line number Diff line change
Expand Up @@ -427,13 +427,6 @@ typedef RegionPtr (* RectsToRegionProcPtr)(

#endif /* NEED_SCREEN_REGIONS */

typedef void (* SendGraphicsExposeProcPtr)(
ClientPtr /*client*/,
RegionPtr /*pRgn*/,
XID /*drawable*/,
int /*major*/,
int /*minor*/);

typedef void (* ScreenBlockHandlerProcPtr)(
int /*screenNum*/,
void * /*blockData*/,
Expand Down Expand Up @@ -679,7 +672,6 @@ typedef struct _Screen {
#ifdef NEED_SCREEN_REGIONS
RectsToRegionProcPtr RectsToRegion;
#endif /* NEED_SCREEN_REGIONS */
SendGraphicsExposeProcPtr SendGraphicsExpose;

/* os layer procedures */

Expand Down
8 changes: 0 additions & 8 deletions nx-X11/programs/Xserver/mi/mi.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,6 @@ extern RegionPtr miHandleExposures(
unsigned long /*plane*/
);

extern void miSendGraphicsExpose(
ClientPtr /*client*/,
RegionPtr /*pRgn*/,
XID /*drawable*/,
int /*major*/,
int /*minor*/
);

extern void miSendExposures(
WindowPtr /*pWin*/,
RegionPtr /*pRgn*/,
Expand Down
54 changes: 0 additions & 54 deletions nx-X11/programs/Xserver/mi/miexpose.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,60 +375,6 @@ miHandleExposures(pSrcDrawable, pDstDrawable,
}
#endif

/* send GraphicsExpose events, or a NoExpose event, based on the region */

void
miSendGraphicsExpose (client, pRgn, drawable, major, minor)
ClientPtr client;
RegionPtr pRgn;
XID drawable;
int major;
int minor;
{
if (pRgn && !RegionNil(pRgn))
{
xEvent *pEvent;
register xEvent *pe;
register BoxPtr pBox;
register int i;
int numRects;

numRects = RegionNumRects(pRgn);
pBox = RegionRects(pRgn);
if(!(pEvent = (xEvent *)malloc(numRects * sizeof(xEvent))))
return;
pe = pEvent;

for (i=1; i<=numRects; i++, pe++, pBox++)
{
pe->u.u.type = GraphicsExpose;
pe->u.graphicsExposure.drawable = drawable;
pe->u.graphicsExposure.x = pBox->x1;
pe->u.graphicsExposure.y = pBox->y1;
pe->u.graphicsExposure.width = pBox->x2 - pBox->x1;
pe->u.graphicsExposure.height = pBox->y2 - pBox->y1;
pe->u.graphicsExposure.count = numRects - i;
pe->u.graphicsExposure.majorEvent = major;
pe->u.graphicsExposure.minorEvent = minor;
}
TryClientEvents(client, pEvent, numRects,
(Mask)0, NoEventMask, NullGrab);
free(pEvent);
}
else
{
xEvent event;
memset(&event, 0, sizeof(xEvent));
event.u.u.type = NoExpose;
event.u.noExposure.drawable = drawable;
event.u.noExposure.majorEvent = major;
event.u.noExposure.minorEvent = minor;
TryClientEvents(client, &event, 1,
(Mask)0, NoEventMask, NullGrab);
}
}


void
miSendExposures(pWin, pRgn, dx, dy)
WindowPtr pWin;
Expand Down
1 change: 0 additions & 1 deletion nx-X11/programs/Xserver/mi/miscrinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width,
#ifdef NEED_SCREEN_REGIONS
pScreen->RectsToRegion = RegionFromRects;
#endif /* NEED_SCREEN_REGIONS */
pScreen->SendGraphicsExpose = miSendGraphicsExpose;
pScreen->BlockHandler = (ScreenBlockHandlerProcPtr)NoopDDA;
pScreen->WakeupHandler = (ScreenWakeupHandlerProcPtr)NoopDDA;
pScreen->blockData = (void *)0;
Expand Down