aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/mi/miexpose.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/mi/miexpose.c')
-rw-r--r--xorg-server/mi/miexpose.c109
1 files changed, 14 insertions, 95 deletions
diff --git a/xorg-server/mi/miexpose.c b/xorg-server/mi/miexpose.c
index 198c4332f..de8ee6c2a 100644
--- a/xorg-server/mi/miexpose.c
+++ b/xorg-server/mi/miexpose.c
@@ -116,18 +116,12 @@ NOTE:
this should generally be called, even if graphicsExposures is false,
because this is where bits get recovered from backing store.
-NOTE:
- added argument 'plane' is used to indicate how exposures from backing
-store should be accomplished. If plane is 0 (i.e. no bit plane), CopyArea
-should be used, else a CopyPlane of the indicated plane will be used. The
-exposing is done by the backing store's GraphicsExpose function, of course.
-
*/
RegionPtr
miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
GCPtr pGC, int srcx, int srcy, int width, int height,
- int dstx, int dsty, unsigned long plane)
+ int dstx, int dsty)
{
RegionPtr prgnSrcClip; /* drawable-relative source clip */
RegionRec rgnSrcRec;
@@ -149,7 +143,7 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
if (!pGC->graphicsExposures &&
(pDstDrawable->type == DRAWABLE_PIXMAP) &&
((pSrcDrawable->type == DRAWABLE_PIXMAP) ||
- (((WindowPtr) pSrcDrawable)->backStorage == NULL)))
+ (((WindowPtr) pSrcDrawable)->backStorage == 0)))
return NULL;
srcBox.x1 = srcx;
@@ -312,53 +306,6 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
}
}
-/* send GraphicsExpose events, or a NoExpose event, based on the region */
-
-void
-miSendGraphicsExpose(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. */
- TryClientEvents(client, NULL, pEvent, numRects,
- (Mask) 0, NoEventMask, NullGrab);
- 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);
- }
-}
-
void
miSendExposures(WindowPtr pWin, RegionPtr pRgn, int dx, int dy)
{
@@ -421,30 +368,15 @@ miSendExposures(WindowPtr pWin, RegionPtr pRgn, int dx, int dy)
}
void
-miWindowExposures(WindowPtr pWin, RegionPtr prgn, RegionPtr other_exposed)
+miWindowExposures(WindowPtr pWin, RegionPtr prgn)
{
RegionPtr exposures = prgn;
- if ((prgn && !RegionNil(prgn)) ||
- (exposures && !RegionNil(exposures)) || other_exposed) {
+ if (prgn && !RegionNil(prgn)) {
RegionRec expRec;
- int clientInterested;
-
- /*
- * Restore from backing-store FIRST.
- */
- clientInterested =
+ int clientInterested =
(pWin->eventMask | wOtherEventMasks(pWin)) & ExposureMask;
- if (other_exposed) {
- if (exposures) {
- RegionUnion(other_exposed, exposures, other_exposed);
- if (exposures != prgn)
- RegionDestroy(exposures);
- }
- exposures = other_exposed;
- }
- if (clientInterested && exposures &&
- (RegionNumRects(exposures) > RECTLIMIT)) {
+ if (clientInterested && (RegionNumRects(prgn) > RECTLIMIT)) {
/*
* If we have LOTS of rectangles, we decide to take the extents
* and force an exposure on that. This should require much less
@@ -453,34 +385,21 @@ miWindowExposures(WindowPtr pWin, RegionPtr prgn, RegionPtr other_exposed)
*/
BoxRec box;
- box = *RegionExtents(exposures);
- if (exposures == prgn) {
- exposures = &expRec;
- RegionInit(exposures, &box, 1);
- RegionReset(prgn, &box);
- }
- else {
- RegionReset(exposures, &box);
- RegionUnion(prgn, prgn, exposures);
- }
+ box = *RegionExtents(prgn);
+ exposures = &expRec;
+ RegionInit(exposures, &box, 1);
+ RegionReset(prgn, &box);
/* miPaintWindow doesn't clip, so we have to */
RegionIntersect(prgn, prgn, &pWin->clipList);
}
- if (prgn && !RegionNil(prgn))
- miPaintWindow(pWin, prgn, PW_BACKGROUND);
- if (clientInterested && exposures && !RegionNil(exposures))
+ miPaintWindow(pWin, prgn, PW_BACKGROUND);
+ if (clientInterested)
miSendExposures(pWin, exposures,
pWin->drawable.x, pWin->drawable.y);
- if (exposures == &expRec) {
+ if (exposures == &expRec)
RegionUninit(exposures);
- }
- else if (exposures && exposures != prgn && exposures != other_exposed)
- RegionDestroy(exposures);
- if (prgn)
- RegionEmpty(prgn);
+ RegionEmpty(prgn);
}
- else if (exposures && exposures != prgn)
- RegionDestroy(exposures);
}
#ifdef ROOTLESS