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 | 13 | ||||
-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/miwideline.c | 4 |
9 files changed, 87 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 c564eb3db..06fc4085b 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 87d4248d0..a92d4fd6d 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 974bec77d..66e2806c7 100644 --- a/xorg-server/mi/mieq.c +++ b/xorg-server/mi/mieq.c @@ -387,7 +387,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;
@@ -445,14 +445,15 @@ mieqProcessInputEvents(void) evlen = e->events->evlen;
if(evlen > event_size)
- {
+ {
event = realloc(event, evlen);
- event_size = evlen;
- }
+ event_size=evlen;
+
+ if (!event)
+ FatalError("[mi] No memory left for event processing.\n");
+ }
- if (!event)
- FatalError("[mi] No memory left for event processing.\n");
memcpy(event, e->events->event, evlen);
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 0dce0a266..0489dd46e 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/miwideline.c b/xorg-server/mi/miwideline.c index 3158e10cb..2d27dd7dc 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"
|