diff options
Diffstat (limited to 'xorg-server/mi')
-rw-r--r-- | xorg-server/mi/makefile | 40 | ||||
-rwxr-xr-x[-rw-r--r--] | xorg-server/mi/mi.h | 0 | ||||
-rw-r--r-- | xorg-server/mi/miarc.c | 5 | ||||
-rw-r--r-- | xorg-server/mi/micmap.c | 15 | ||||
-rw-r--r-- | xorg-server/mi/micoord.h | 8 | ||||
-rw-r--r-- | xorg-server/mi/mieq.c | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | xorg-server/mi/miexpose.c | 0 | ||||
-rw-r--r-- | xorg-server/mi/mioverlay.c | 4 | ||||
-rw-r--r-- | xorg-server/mi/misprite.c | 13 | ||||
-rw-r--r-- | xorg-server/mi/mivaltree.c | 16 | ||||
-rw-r--r-- | xorg-server/mi/miwideline.c | 4 | ||||
-rw-r--r-- | xorg-server/mi/miwindow.c | 2 |
12 files changed, 91 insertions, 20 deletions
diff --git a/xorg-server/mi/makefile b/xorg-server/mi/makefile new file mode 100644 index 000000000..fc6d57393 --- /dev/null +++ b/xorg-server/mi/makefile @@ -0,0 +1,40 @@ +CSRCS=miarc.c \ + mibitblt.c \ + micmap.c \ + micopy.c \ + micursor.c \ + midash.c \ + midispcur.c \ + mieq.c \ + miexpose.c \ + mifillarc.c \ + mifillrct.c \ + mifpolycon.c \ + migc.c \ + miglblt.c \ + mioverlay.c \ + mipointer.c \ + mipoly.c \ + mipolycon.c \ + mipolygen.c \ + mipolypnt.c \ + mipolyrect.c \ + mipolyseg.c \ + mipolytext.c \ + mipolyutil.c \ + mipushpxl.c \ + miscrinit.c \ + mispans.c \ + misprite.c \ + mivaltree.c \ + miwideline.c \ + miwindow.c \ + mizerarc.c \ + mizerclip.c \ + mizerline.c \ + miinitext.c + +LIBRARY=libmi + +INCLUDES+=../composite + diff --git a/xorg-server/mi/mi.h b/xorg-server/mi/mi.h index 5a455c910..5a455c910 100644..100755 --- a/xorg-server/mi/mi.h +++ b/xorg-server/mi/mi.h diff --git a/xorg-server/mi/miarc.c b/xorg-server/mi/miarc.c index e55108a44..e0f09d243 100644 --- a/xorg-server/mi/miarc.c +++ b/xorg-server/mi/miarc.c @@ -63,6 +63,11 @@ SOFTWARE. #include "mifillarc.h" #include <X11/Xfuncproto.h> +#ifdef _MSC_VER +#define hypot _hypot +#define HAVE_CBRT +#endif + static double miDsin(double a); static double miDcos(double a); static double miDasin(double v); diff --git a/xorg-server/mi/micmap.c b/xorg-server/mi/micmap.c index 1aeb359ba..ff8a0322e 100644 --- a/xorg-server/mi/micmap.c +++ b/xorg-server/mi/micmap.c @@ -118,17 +118,26 @@ miInitializeColormap(ColormapPtr pmap) unsigned limr, limg, limb; limr = pVisual->redMask >> pVisual->offsetRed; - limg = pVisual->greenMask >> pVisual->offsetGreen; - limb = pVisual->blueMask >> pVisual->offsetBlue; - for (i = 0; i <= maxent; i++) { + for(i = 0; i <= min(limr,maxent); i++) { /* rescale to [0..65535] then rgb bits */ pmap->red[i].co.local.red = ((((i * 65535) / limr) >> shift) * 65535) / lim; + } + for(; i <= maxent; i++) pmap->red[i].co.local.red = 65535; + limg = pVisual->greenMask >> pVisual->offsetGreen; + for(i = 0; i <= min(limg,maxent); i++) { + /* rescale to [0..65535] then rgb bits */ pmap->green[i].co.local.green = ((((i * 65535) / limg) >> shift) * 65535) / lim; + } + for(; i <= maxent; i++) pmap->green[i].co.local.green = 65535; + limb = pVisual->blueMask >> pVisual->offsetBlue; + for(i = 0; i <= min(limb,maxent); i++) { + /* rescale to [0..65535] then rgb bits */ pmap->blue[i].co.local.blue = ((((i * 65535) / limb) >> shift) * 65535) / lim; } + for(; i <= maxent; i++) pmap->blue[i].co.local.blue = 65535; } else if (pVisual->class == StaticColor) { unsigned limr, limg, limb; diff --git a/xorg-server/mi/micoord.h b/xorg-server/mi/micoord.h index c83bffd90..71587c033 100644 --- a/xorg-server/mi/micoord.h +++ b/xorg-server/mi/micoord.h @@ -35,14 +35,14 @@ #define GetHighWord(x) (((int) (x)) >> 16) #if IMAGE_BYTE_ORDER == MSBFirst -#define intToCoord(i,x,y) (((x) = GetHighWord(i)), ((y) = (int) ((short) (i)))) +#define intToCoord(i,x,y) (((x) = GetHighWord(i)), ((y) = (int) ((short) ((i)&0xffff)))) #define coordToInt(x,y) (((x) << 16) | ((y) & 0xffff)) #define intToX(i) (GetHighWord(i)) -#define intToY(i) ((int) ((short) i)) +#define intToY(i) ((int) ((short) ((i)&0xffff))) #else -#define intToCoord(i,x,y) (((x) = (int) ((short) (i))), ((y) = GetHighWord(i))) +#define intToCoord(i,x,y) (((x) = (int) ((short) ((i)&0xffff))), ((y) = GetHighWord(i))) #define coordToInt(x,y) (((y) << 16) | ((x) & 0xffff)) -#define intToX(i) ((int) ((short) (i))) +#define intToX(i) ((int) ((short) ((i)&0xffff))) #define intToY(i) (GetHighWord(i)) #endif diff --git a/xorg-server/mi/mieq.c b/xorg-server/mi/mieq.c index 8907a6ea1..9a732302d 100644 --- a/xorg-server/mi/mieq.c +++ b/xorg-server/mi/mieq.c @@ -60,7 +60,7 @@ in this Software without prior written authorization from The Open Group. #endif /* Maximum size should be initial size multiplied by a power of 2 */ -#define QUEUE_INITIAL_SIZE 512 +#define QUEUE_INITIAL_SIZE 1024 #define QUEUE_RESERVED_SIZE 64 #define QUEUE_MAXIMUM_SIZE 4096 #define QUEUE_DROP_BACKTRACE_FREQUENCY 100 @@ -576,7 +576,7 @@ mieqProcessInputEvents(void) { EventRec *e = NULL; ScreenPtr screen; - static InternalEvent event; + InternalEvent event; DeviceIntPtr dev = NULL, master = NULL; size_t n_enqueued; diff --git a/xorg-server/mi/miexpose.c b/xorg-server/mi/miexpose.c index de8ee6c2a..de8ee6c2a 100644..100755 --- a/xorg-server/mi/miexpose.c +++ b/xorg-server/mi/miexpose.c diff --git a/xorg-server/mi/mioverlay.c b/xorg-server/mi/mioverlay.c index eb8dda133..9df98185b 100644 --- a/xorg-server/mi/mioverlay.c +++ b/xorg-server/mi/mioverlay.c @@ -3,6 +3,10 @@ #include <dix-config.h> #endif +#ifdef CreateWindow +#undef CreateWindow +#endif + #include <X11/X.h> #include "scrnintstr.h" #include <X11/extensions/shapeproto.h> diff --git a/xorg-server/mi/misprite.c b/xorg-server/mi/misprite.c index 68a49be1e..f8ef795fd 100644 --- a/xorg-server/mi/misprite.c +++ b/xorg-server/mi/misprite.c @@ -466,7 +466,7 @@ miSpriteSourceValidate(DrawablePtr pDrawable, int x, int y, int width, for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { if (DevHasCursor(pDev)) { pCursorInfo = MISPRITE(pDev); - if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen && + if (pCursorInfo && pCursorInfo->isUp && pCursorInfo->pScreen == pScreen && ORG_OVERLAP(&pCursorInfo->saved, pDrawable->x, pDrawable->y, x, y, width, height)) { SPRITE_DEBUG(("SourceValidate remove\n")); @@ -499,7 +499,7 @@ miSpriteCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc) /* * Damage will take care of destination check */ - if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen && + if (pCursorInfo && pCursorInfo->isUp && pCursorInfo->pScreen == pScreen && RegionContainsRect(prgnSrc, &pCursorInfo->saved) != rgnOUT) { SPRITE_DEBUG(("CopyWindow remove\n")); miSpriteRemoveCursor(pDev, pScreen); @@ -574,9 +574,12 @@ miSpriteInstallColormap(ColormapPtr pMap) for (pDev = inputInfo.devices; pDev; pDev = pDev->next) { if (DevHasCursor(pDev)) { pCursorInfo = MISPRITE(pDev); - pCursorInfo->checkPixels = TRUE; - if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen) - miSpriteRemoveCursor(pDev, pScreen); + if (pCursorInfo) + { + pCursorInfo->checkPixels = TRUE; + if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen) + miSpriteRemoveCursor(pDev, pScreen); + } } } diff --git a/xorg-server/mi/mivaltree.c b/xorg-server/mi/mivaltree.c index 8e4e9a9e0..c49560e0b 100644 --- a/xorg-server/mi/mivaltree.c +++ b/xorg-server/mi/mivaltree.c @@ -275,6 +275,9 @@ miComputeClips(WindowPtr pParent, eventMask | wOtherEventMasks(pParent)) & VisibilityChangeMask)) SendVisibilityNotify(pParent); + if (pParent->valdata==UnmapValData) + return; // return if no valid valdata + dx = pParent->drawable.x - pParent->valdata->before.oldAbsCorner.x; dy = pParent->drawable.y - pParent->valdata->before.oldAbsCorner.y; @@ -704,9 +707,11 @@ miValidateTree(WindowPtr pParent, /* Parent to validate */ RegionUninit(&childUnion); } - RegionNull(&pParent->valdata->after.exposed); - RegionNull(&pParent->valdata->after.borderExposed); - + if (pParent->valdata && pParent->valdata!=UnmapValData) + { + RegionNull(&pParent->valdata->after.exposed); + RegionNull(&pParent->valdata->after.borderExposed); + } /* * each case below is responsible for updating the * clipList and serial number for the parent window @@ -721,8 +726,9 @@ miValidateTree(WindowPtr pParent, /* Parent to validate */ * exposures and obscures as per miComputeClips and reset the parent's * clipList. */ - RegionSubtract(&pParent->valdata->after.exposed, - &totalClip, &pParent->clipList); + if (pParent->valdata && pParent->valdata!=UnmapValData) + RegionSubtract(&pParent->valdata->after.exposed, + &totalClip, &pParent->clipList); /* fall through */ case VTMap: RegionCopy(&pParent->clipList, &totalClip); diff --git a/xorg-server/mi/miwideline.c b/xorg-server/mi/miwideline.c index 29ba12c69..333b8cd3f 100644 --- a/xorg-server/mi/miwideline.c +++ b/xorg-server/mi/miwideline.c @@ -45,6 +45,10 @@ from The Open Group. #include <math.h> #undef _XOPEN_SOURCE #endif +#ifdef _MSC_VER +#define hypot _hypot +#endif + #include <X11/X.h> #include "windowstr.h" #include "gcstruct.h" diff --git a/xorg-server/mi/miwindow.c b/xorg-server/mi/miwindow.c index 0cf50465a..d5690b616 100644 --- a/xorg-server/mi/miwindow.c +++ b/xorg-server/mi/miwindow.c @@ -217,7 +217,7 @@ miHandleValidateExposures(WindowPtr pWin) pChild = pWin; WindowExposures = pChild->drawable.pScreen->WindowExposures; while (1) { - if ((val = pChild->valdata)) { + if ( (val = pChild->valdata) && val!=UnmapValData) { if (RegionNotEmpty(&val->after.borderExposed)) miPaintWindow(pChild, &val->after.borderExposed, PW_BORDER); RegionUninit(&val->after.borderExposed); |