Fix minor timestamp lossage in mieq.
Replace miSprite implementation with Damage-based one. Otherwise damage and misprite conflict causing looping. Change pScreen usage around a bit to eliminate warnings
This commit is contained in:
parent
45fde3b041
commit
1e694d2b51
|
@ -123,6 +123,8 @@ mieqEnqueue (e)
|
||||||
miEventQueue.events[oldtail].event.u.keyButtonPointer.time =
|
miEventQueue.events[oldtail].event.u.keyButtonPointer.time =
|
||||||
miEventQueue.lastEventTime;
|
miEventQueue.lastEventTime;
|
||||||
}
|
}
|
||||||
|
miEventQueue.lastEventTime =
|
||||||
|
miEventQueue.events[oldtail].event.u.keyButtonPointer.time;
|
||||||
miEventQueue.events[oldtail].pScreen = miEventQueue.pEnqueueScreen;
|
miEventQueue.events[oldtail].pScreen = miEventQueue.pEnqueueScreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
1744
mi/misprite.c
1744
mi/misprite.c
File diff suppressed because it is too large
Load Diff
|
@ -32,58 +32,68 @@ in this Software without prior written authorization from The Open Group.
|
||||||
*/
|
*/
|
||||||
/* $XFree86: xc/programs/Xserver/mi/mispritest.h,v 1.4 2001/01/17 22:37:07 dawes Exp $ */
|
/* $XFree86: xc/programs/Xserver/mi/mispritest.h,v 1.4 2001/01/17 22:37:07 dawes Exp $ */
|
||||||
|
|
||||||
|
#ifndef _MISPRITEST_H_
|
||||||
|
#define _MISPRITEST_H_
|
||||||
|
|
||||||
# include "misprite.h"
|
# include "misprite.h"
|
||||||
#ifdef RENDER
|
#ifdef RENDER
|
||||||
# include "picturestr.h"
|
# include "picturestr.h"
|
||||||
#endif
|
#endif
|
||||||
|
# include "damage.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* per screen information
|
* per screen information
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
/* screen procedures */
|
||||||
CloseScreenProcPtr CloseScreen;
|
CloseScreenProcPtr CloseScreen;
|
||||||
GetImageProcPtr GetImage;
|
GetImageProcPtr GetImage;
|
||||||
GetSpansProcPtr GetSpans;
|
GetSpansProcPtr GetSpans;
|
||||||
SourceValidateProcPtr SourceValidate;
|
SourceValidateProcPtr SourceValidate;
|
||||||
CreateGCProcPtr CreateGC;
|
|
||||||
ScreenBlockHandlerProcPtr BlockHandler;
|
/* window procedures */
|
||||||
|
CopyWindowProcPtr CopyWindow;
|
||||||
|
|
||||||
|
/* backing store procedures */
|
||||||
|
SaveDoomedAreasProcPtr SaveDoomedAreas;
|
||||||
|
|
||||||
|
/* colormap procedures */
|
||||||
InstallColormapProcPtr InstallColormap;
|
InstallColormapProcPtr InstallColormap;
|
||||||
StoreColorsProcPtr StoreColors;
|
StoreColorsProcPtr StoreColors;
|
||||||
PaintWindowBackgroundProcPtr PaintWindowBackground;
|
|
||||||
PaintWindowBorderProcPtr PaintWindowBorder;
|
/* os layer procedures */
|
||||||
CopyWindowProcPtr CopyWindow;
|
ScreenBlockHandlerProcPtr BlockHandler;
|
||||||
ClearToBackgroundProcPtr ClearToBackground;
|
|
||||||
SaveDoomedAreasProcPtr SaveDoomedAreas;
|
|
||||||
RestoreAreasProcPtr RestoreAreas;
|
|
||||||
#ifdef RENDER
|
|
||||||
CompositeProcPtr Composite;
|
|
||||||
GlyphsProcPtr Glyphs;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
CursorPtr pCursor;
|
CursorPtr pCursor;
|
||||||
int x;
|
int x; /* cursor hotspot */
|
||||||
int y;
|
int y;
|
||||||
BoxRec saved;
|
BoxRec saved; /* saved area from the screen */
|
||||||
Bool isUp;
|
Bool isUp; /* cursor in frame buffer */
|
||||||
Bool shouldBeUp;
|
Bool shouldBeUp; /* cursor should be displayed */
|
||||||
WindowPtr pCacheWin;
|
WindowPtr pCacheWin; /* window the cursor last seen in */
|
||||||
Bool isInCacheWin;
|
Bool isInCacheWin;
|
||||||
Bool checkPixels;
|
Bool checkPixels; /* check colormap collision */
|
||||||
xColorItem colors[2];
|
xColorItem colors[2];
|
||||||
ColormapPtr pInstalledMap;
|
ColormapPtr pInstalledMap;
|
||||||
ColormapPtr pColormap;
|
ColormapPtr pColormap;
|
||||||
VisualPtr pVisual;
|
VisualPtr pVisual;
|
||||||
miSpriteCursorFuncPtr funcs;
|
miSpriteCursorFuncPtr funcs;
|
||||||
|
DamagePtr pDamage; /* damage tracking structure */
|
||||||
} miSpriteScreenRec, *miSpriteScreenPtr;
|
} miSpriteScreenRec, *miSpriteScreenPtr;
|
||||||
|
|
||||||
#define SOURCE_COLOR 0
|
#define SOURCE_COLOR 0
|
||||||
#define MASK_COLOR 1
|
#define MASK_COLOR 1
|
||||||
|
|
||||||
typedef struct {
|
#define miSpriteIsUpTRUE(pScreen, pScreenPriv) if (!pScreenPriv->isUp) { \
|
||||||
GCFuncs *wrapFuncs;
|
pScreenPriv->isUp = TRUE; \
|
||||||
GCOps *wrapOps;
|
DamageRegister (&(*pScreen->GetScreenPixmap) (pScreen)->drawable, pScreenPriv->pDamage); \
|
||||||
} miSpriteGCRec, *miSpriteGCPtr;
|
}
|
||||||
|
|
||||||
|
#define miSpriteIsUpFALSE(pScreen, pScreenPriv) if (pScreenPriv->isUp) { \
|
||||||
|
DamageUnregister (&(*pScreen->GetScreenPixmap) (pScreen)->drawable, pScreenPriv->pDamage); \
|
||||||
|
pScreenPriv->isUp = FALSE; \
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Overlap BoxPtr and Box elements
|
* Overlap BoxPtr and Box elements
|
||||||
|
@ -116,3 +126,5 @@ typedef struct {
|
||||||
|
|
||||||
#define LINE_OVERLAP(pCbox,x1,y1,x2,y2,lw2) \
|
#define LINE_OVERLAP(pCbox,x1,y1,x2,y2,lw2) \
|
||||||
BOX_OVERLAP((pCbox), (x1)-(lw2), (y1)-(lw2), (x2)+(lw2), (y2)+(lw2))
|
BOX_OVERLAP((pCbox), (x1)-(lw2), (y1)-(lw2), (x2)+(lw2), (y2)+(lw2))
|
||||||
|
|
||||||
|
#endif /* _MISPRITEST_H_ */
|
||||||
|
|
|
@ -98,9 +98,9 @@ static void
|
||||||
damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip)
|
damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
damageScrPriv(pDrawable->pScreen);
|
|
||||||
drawableDamage(pDrawable);
|
|
||||||
ScreenPtr pScreen = pDrawable->pScreen;
|
ScreenPtr pScreen = pDrawable->pScreen;
|
||||||
|
damageScrPriv(pScreen);
|
||||||
|
drawableDamage(pDrawable);
|
||||||
DamagePtr pNext;
|
DamagePtr pNext;
|
||||||
RegionPtr pClip;
|
RegionPtr pClip;
|
||||||
RegionRec clippedRec;
|
RegionRec clippedRec;
|
||||||
|
@ -1835,9 +1835,8 @@ DamageSubtract (DamagePtr pDamage,
|
||||||
RegionPtr pClip;
|
RegionPtr pClip;
|
||||||
RegionRec pixmapClip;
|
RegionRec pixmapClip;
|
||||||
DrawablePtr pDrawable = pDamage->pDrawable;
|
DrawablePtr pDrawable = pDamage->pDrawable;
|
||||||
ScreenPtr pScreen = pDrawable->pScreen;
|
|
||||||
|
|
||||||
REGION_SUBTRACT (pScreen, &pDamage->damage, &pDamage->damage, pRegion);
|
REGION_SUBTRACT (pDrawable->pScreen, &pDamage->damage, &pDamage->damage, pRegion);
|
||||||
if (pDrawable)
|
if (pDrawable)
|
||||||
{
|
{
|
||||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
|
@ -1850,14 +1849,14 @@ DamageSubtract (DamagePtr pDamage,
|
||||||
box.y1 = pDrawable->y;
|
box.y1 = pDrawable->y;
|
||||||
box.x2 = pDrawable->x + pDrawable->width;
|
box.x2 = pDrawable->x + pDrawable->width;
|
||||||
box.y2 = pDrawable->y + pDrawable->height;
|
box.y2 = pDrawable->y + pDrawable->height;
|
||||||
REGION_INIT (pScreen, &pixmapClip, &box, 1);
|
REGION_INIT (pDrawable->pScreen, &pixmapClip, &box, 1);
|
||||||
pClip = &pixmapClip;
|
pClip = &pixmapClip;
|
||||||
}
|
}
|
||||||
REGION_TRANSLATE (pScreen, &pDamage->damage, pDrawable->x, pDrawable->y);
|
REGION_TRANSLATE (pDrawable->pScreen, &pDamage->damage, pDrawable->x, pDrawable->y);
|
||||||
REGION_INTERSECT (pScreen, &pDamage->damage, &pDamage->damage, pClip);
|
REGION_INTERSECT (pDrawable->pScreen, &pDamage->damage, &pDamage->damage, pClip);
|
||||||
REGION_TRANSLATE (pScreen, &pDamage->damage, -pDrawable->x, -pDrawable->y);
|
REGION_TRANSLATE (pDrawable->pScreen, &pDamage->damage, -pDrawable->x, -pDrawable->y);
|
||||||
}
|
}
|
||||||
return REGION_NOTEMPTY (pScreen, &pDamage->damage);
|
return REGION_NOTEMPTY (pDrawable->pScreen, &pDamage->damage);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue