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 all commits
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
37 changes: 0 additions & 37 deletions nx-X11/programs/Xserver/fb/fb.h
Original file line number Diff line number Diff line change
Expand Up @@ -1291,18 +1291,6 @@ fbInitVisuals (VisualPtr *visualp,
* fbcopy.c
*/

typedef void (*fbCopyProc) (DrawablePtr pSrcDrawable,
DrawablePtr pDstDrawable,
GCPtr pGC,
BoxPtr pDstBox,
int nbox,
int dx,
int dy,
Bool reverse,
Bool upsidedown,
Pixel bitplane,
void *closure);

void
fbCopyNtoN (DrawablePtr pSrcDrawable,
DrawablePtr pDstDrawable,
Expand Down Expand Up @@ -1342,31 +1330,6 @@ fbCopyNto1 (DrawablePtr pSrcDrawable,
Pixel bitplane,
void *closure);

void
fbCopyRegion (DrawablePtr pSrcDrawable,
DrawablePtr pDstDrawable,
GCPtr pGC,
RegionPtr pDstRegion,
int dx,
int dy,
fbCopyProc copyProc,
Pixel bitPlane,
void *closure);

RegionPtr
fbDoCopy (DrawablePtr pSrcDrawable,
DrawablePtr pDstDrawable,
GCPtr pGC,
int xIn,
int yIn,
int widthSrc,
int heightSrc,
int xOut,
int yOut,
fbCopyProc copyProc,
Pixel bitplane,
void *closure);

RegionPtr
fbCopyArea (DrawablePtr pSrcDrawable,
DrawablePtr pDstDrawable,
Expand Down
Loading