diff options
Diffstat (limited to 'xorg-server/mi')
-rw-r--r-- | xorg-server/mi/makefile | 39 | ||||
-rw-r--r-- | xorg-server/mi/miarc.c | 4 | ||||
-rw-r--r-- | xorg-server/mi/micmap.c | 17 | ||||
-rw-r--r-- | xorg-server/mi/micoord.h | 8 | ||||
-rw-r--r-- | xorg-server/mi/mieq.c | 2 | ||||
-rw-r--r-- | xorg-server/mi/miinitext.c | 3 | ||||
-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 | 14 | ||||
-rw-r--r-- | xorg-server/mi/miwideline.c | 4 | ||||
-rw-r--r-- | xorg-server/mi/miwindow.c | 2 |
11 files changed, 92 insertions, 18 deletions
diff --git a/xorg-server/mi/makefile b/xorg-server/mi/makefile new file mode 100644 index 000000000..7067c62e8 --- /dev/null +++ b/xorg-server/mi/makefile @@ -0,0 +1,39 @@ +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 + + diff --git a/xorg-server/mi/miarc.c b/xorg-server/mi/miarc.c index cd870fa39..9fc8f478c 100644 --- a/xorg-server/mi/miarc.c +++ b/xorg-server/mi/miarc.c @@ -64,6 +64,10 @@ SOFTWARE. #include "mifillarc.h" #include <X11/Xfuncproto.h> +#ifdef _MSC_VER +#define hypot _hypot +#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 7448ef8fd..3746cad7f 100644 --- a/xorg-server/mi/micmap.c +++ b/xorg-server/mi/micmap.c @@ -126,18 +126,29 @@ 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) { diff --git a/xorg-server/mi/micoord.h b/xorg-server/mi/micoord.h index e6d814fc8..fe4adac56 100644 --- a/xorg-server/mi/micoord.h +++ b/xorg-server/mi/micoord.h @@ -55,14 +55,14 @@ #endif #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 093dba20f..3d51a567b 100644 --- a/xorg-server/mi/mieq.c +++ b/xorg-server/mi/mieq.c @@ -490,7 +490,7 @@ mieqProcessDeviceEvent(DeviceIntPtr dev, case ET_KeyRelease: case ET_ButtonPress: case ET_ButtonRelease: - if (dev && screen && screen != DequeueScreen(dev) && !handler) { + if (dev && screen && dev->spriteInfo->sprite && screen != DequeueScreen(dev) && !handler) { DequeueScreen(dev) = screen; x = event->device_event.root_x; y = event->device_event.root_y; diff --git a/xorg-server/mi/miinitext.c b/xorg-server/mi/miinitext.c index 4499f377c..29903973f 100644 --- a/xorg-server/mi/miinitext.c +++ b/xorg-server/mi/miinitext.c @@ -467,7 +467,10 @@ InitExtensions(int argc, char *argv[]) #ifdef GLXEXT if (serverGeneration == 1) + { GlxPushProvider(&__glXDRISWRastProvider); + glxWinPushNativeProvider(); + } if (!noGlxExtension) GlxExtensionInit(); #endif } diff --git a/xorg-server/mi/mioverlay.c b/xorg-server/mi/mioverlay.c index 76484c275..78f5d787b 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 1025c5a6f..f0c008143 100644 --- a/xorg-server/mi/misprite.c +++ b/xorg-server/mi/misprite.c @@ -506,7 +506,7 @@ miSpriteSourceValidate (DrawablePtr pDrawable, int x, int y, int width, 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)) { @@ -541,7 +541,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")); @@ -628,9 +628,12 @@ miSpriteInstallColormap (ColormapPtr pMap) 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 e1d47c06f..f1de5bfd7 100644 --- a/xorg-server/mi/mivaltree.c +++ b/xorg-server/mi/mivaltree.c @@ -295,6 +295,9 @@ miComputeClips ( ((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; @@ -777,9 +780,11 @@ miValidateTree ( 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 @@ -794,7 +799,8 @@ miValidateTree ( * exposures and obscures as per miComputeClips and reset the parent's * clipList. */ - RegionSubtract(&pParent->valdata->after.exposed, + if (pParent->valdata && pParent->valdata!=UnmapValData) + RegionSubtract(&pParent->valdata->after.exposed, &totalClip, &pParent->clipList); /* fall through */ case VTMap: diff --git a/xorg-server/mi/miwideline.c b/xorg-server/mi/miwideline.c index 057339dbe..122566f38 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 55a86dd13..87d474ff2 100644 --- a/xorg-server/mi/miwindow.c +++ b/xorg-server/mi/miwindow.c @@ -228,7 +228,7 @@ miHandleValidateExposures(WindowPtr 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);
|