Add COMPOSITE change to fbCopyWindow (not needed yet)
Xnest was half-using midispcur and doing a bad job of it. Replace all of that code with mipointer which does a lot of the work. Support DDXen which don't provide GetWindowPixmap, or which return NULL for the root pixmap.
This commit is contained in:
parent
f95293e525
commit
fd439afdfe
|
@ -1,4 +1,4 @@
|
||||||
/* $XdotOrg$ */
|
/* $XdotOrg: xc/programs/Xserver/fb/fbwindow.c,v 1.2 2004/04/23 19:05:14 eich Exp $ */
|
||||||
/*
|
/*
|
||||||
* Id: fbwindow.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
|
* Id: fbwindow.c,v 1.1 1999/11/02 03:54:45 keithp Exp $
|
||||||
*
|
*
|
||||||
|
@ -123,6 +123,9 @@ fbCopyWindow(WindowPtr pWin,
|
||||||
RegionRec rgnDst;
|
RegionRec rgnDst;
|
||||||
int dx, dy;
|
int dx, dy;
|
||||||
WindowPtr pwinRoot;
|
WindowPtr pwinRoot;
|
||||||
|
#ifdef COMPOSITE
|
||||||
|
PixmapPtr pPixmap = fbGetWindowPixmap (pWin);
|
||||||
|
#endif
|
||||||
|
|
||||||
pwinRoot = WindowTable[pWin->drawable.pScreen->myNum];
|
pwinRoot = WindowTable[pWin->drawable.pScreen->myNum];
|
||||||
|
|
||||||
|
@ -134,6 +137,12 @@ fbCopyWindow(WindowPtr pWin,
|
||||||
|
|
||||||
REGION_INTERSECT(pWin->drawable.pScreen, &rgnDst, &pWin->borderClip, prgnSrc);
|
REGION_INTERSECT(pWin->drawable.pScreen, &rgnDst, &pWin->borderClip, prgnSrc);
|
||||||
|
|
||||||
|
#ifdef COMPOSITE
|
||||||
|
if (pPixmap->screen_x || pPixmap->screen_y)
|
||||||
|
REGION_TRANSLATE (pWin->drawable.pScreen, &rgnDst,
|
||||||
|
-pPixmap->screen_x, -pPixmap->screen_y);
|
||||||
|
#endif
|
||||||
|
|
||||||
fbCopyRegion ((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot,
|
fbCopyRegion ((DrawablePtr)pwinRoot, (DrawablePtr)pwinRoot,
|
||||||
0,
|
0,
|
||||||
&rgnDst, dx, dy, fbCopyWindowProc, 0, 0);
|
&rgnDst, dx, dy, fbCopyWindowProc, 0, 0);
|
||||||
|
|
|
@ -33,59 +33,6 @@ is" without express or implied warranty.
|
||||||
#include "Keyboard.h"
|
#include "Keyboard.h"
|
||||||
#include "Args.h"
|
#include "Args.h"
|
||||||
|
|
||||||
void
|
|
||||||
xnestConstrainCursor(ScreenPtr pScreen, BoxPtr pBox)
|
|
||||||
{
|
|
||||||
#ifdef _XSERVER64
|
|
||||||
Window64 wroot;
|
|
||||||
#else
|
|
||||||
Window wroot;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int wx, wy;
|
|
||||||
unsigned int wwidth, wheight;
|
|
||||||
unsigned int wborderwidth;
|
|
||||||
unsigned int wdepth;
|
|
||||||
|
|
||||||
XGetGeometry(xnestDisplay, xnestDefaultWindows[pScreen->myNum], &wroot,
|
|
||||||
&wx, &wy, &wwidth, &wheight, &wborderwidth, &wdepth);
|
|
||||||
|
|
||||||
if (pBox->x1 <= 0 && pBox->y1 <= 0 &&
|
|
||||||
pBox->x2 >= wwidth && pBox->y2 >= wheight)
|
|
||||||
XUngrabPointer(xnestDisplay, CurrentTime);
|
|
||||||
else {
|
|
||||||
XReparentWindow(xnestDisplay, xnestConfineWindow,
|
|
||||||
xnestDefaultWindows[pScreen->myNum],
|
|
||||||
pBox->x1, pBox->y1);
|
|
||||||
XResizeWindow(xnestDisplay, xnestConfineWindow,
|
|
||||||
pBox->x2 - pBox->x1, pBox->y2 - pBox->y1);
|
|
||||||
|
|
||||||
XGrabPointer(xnestDisplay,
|
|
||||||
xnestDefaultWindows[pScreen->myNum],
|
|
||||||
True,
|
|
||||||
xnestEventMask & (~XNEST_KEYBOARD_EVENT_MASK|KeymapStateMask),
|
|
||||||
GrabModeAsync, GrabModeAsync,
|
|
||||||
xnestConfineWindow,
|
|
||||||
None, CurrentTime);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
xnestCursorLimits(ScreenPtr pScreen, CursorPtr pCursor, BoxPtr pHotBox,
|
|
||||||
BoxPtr pTopLeftBox)
|
|
||||||
{
|
|
||||||
*pTopLeftBox = *pHotBox;
|
|
||||||
}
|
|
||||||
|
|
||||||
Bool
|
|
||||||
xnestDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor)
|
|
||||||
{
|
|
||||||
XDefineCursor(xnestDisplay,
|
|
||||||
xnestDefaultWindows[pScreen->myNum],
|
|
||||||
xnestCursor(pCursor, pScreen));
|
|
||||||
return True;
|
|
||||||
}
|
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
xnestRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
|
xnestRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
|
||||||
{
|
{
|
||||||
|
@ -192,15 +139,17 @@ xnestRecolorCursor(ScreenPtr pScreen, CursorPtr pCursor, Bool displayed)
|
||||||
&fg_color, &bg_color);
|
&fg_color, &bg_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
Bool
|
void xnestSetCursor (ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
|
||||||
xnestSetCursorPosition(ScreenPtr pScreen, int x, int y, Bool generateEvent)
|
|
||||||
{
|
{
|
||||||
int i;
|
if (pCursor)
|
||||||
|
{
|
||||||
for (i = 0; i < xnestNumScreens; i++)
|
XDefineCursor(xnestDisplay,
|
||||||
XWarpPointer(xnestDisplay, xnestDefaultWindows[i],
|
|
||||||
xnestDefaultWindows[pScreen->myNum],
|
xnestDefaultWindows[pScreen->myNum],
|
||||||
0, 0, 0, 0, x, y);
|
xnestCursor(pCursor, pScreen));
|
||||||
|
}
|
||||||
return True;
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
xnestMoveCursor (ScreenPtr pScreen, int x, int y)
|
||||||
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,7 @@ is" without express or implied warranty.
|
||||||
#include "Screen.h"
|
#include "Screen.h"
|
||||||
#include "XNWindow.h"
|
#include "XNWindow.h"
|
||||||
#include "Events.h"
|
#include "Events.h"
|
||||||
|
#include "mipointer.h"
|
||||||
|
|
||||||
CARD32 lastEventTime = 0;
|
CARD32 lastEventTime = 0;
|
||||||
|
|
||||||
|
@ -41,6 +42,7 @@ void
|
||||||
ProcessInputEvents()
|
ProcessInputEvents()
|
||||||
{
|
{
|
||||||
mieqProcessInputEvents();
|
mieqProcessInputEvents();
|
||||||
|
miPointerUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -131,11 +133,15 @@ xnestCollectEvents()
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MotionNotify:
|
case MotionNotify:
|
||||||
|
#if 0
|
||||||
x.u.u.type = MotionNotify;
|
x.u.u.type = MotionNotify;
|
||||||
x.u.keyButtonPointer.rootX = X.xmotion.x;
|
x.u.keyButtonPointer.rootX = X.xmotion.x;
|
||||||
x.u.keyButtonPointer.rootY = X.xmotion.y;
|
x.u.keyButtonPointer.rootY = X.xmotion.y;
|
||||||
x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis();
|
x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis();
|
||||||
mieqEnqueue(&x);
|
mieqEnqueue(&x);
|
||||||
|
#endif
|
||||||
|
miPointerAbsoluteCursor (X.xmotion.x, X.xmotion.y,
|
||||||
|
lastEventTime = GetTimeInMillis());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FocusIn:
|
case FocusIn:
|
||||||
|
@ -162,11 +168,15 @@ xnestCollectEvents()
|
||||||
pScreen = xnestScreen(X.xcrossing.window);
|
pScreen = xnestScreen(X.xcrossing.window);
|
||||||
if (pScreen) {
|
if (pScreen) {
|
||||||
NewCurrentScreen(pScreen, X.xcrossing.x, X.xcrossing.y);
|
NewCurrentScreen(pScreen, X.xcrossing.x, X.xcrossing.y);
|
||||||
|
#if 0
|
||||||
x.u.u.type = MotionNotify;
|
x.u.u.type = MotionNotify;
|
||||||
x.u.keyButtonPointer.rootX = X.xcrossing.x;
|
x.u.keyButtonPointer.rootX = X.xcrossing.x;
|
||||||
x.u.keyButtonPointer.rootY = X.xcrossing.y;
|
x.u.keyButtonPointer.rootY = X.xcrossing.y;
|
||||||
x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis();
|
x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis();
|
||||||
mieqEnqueue(&x);
|
mieqEnqueue(&x);
|
||||||
|
#endif
|
||||||
|
miPointerAbsoluteCursor (X.xcrossing.x, X.xcrossing.y,
|
||||||
|
lastEventTime = GetTimeInMillis());
|
||||||
xnestDirectInstallColormaps(pScreen);
|
xnestDirectInstallColormaps(pScreen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -310,5 +310,16 @@ void
|
||||||
xnestPushPixels(GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDst,
|
xnestPushPixels(GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDst,
|
||||||
int width, int height, int x, int y)
|
int width, int height, int x, int y)
|
||||||
{
|
{
|
||||||
|
/* only works for solid bitmaps */
|
||||||
|
if (pGC->fillStyle == FillSolid)
|
||||||
|
{
|
||||||
|
XSetStipple (xnestDisplay, xnestGC(pGC), xnestPixmap(pBitmap));
|
||||||
|
XSetTSOrigin (xnestDisplay, xnestGC(pGC), x, y);
|
||||||
|
XSetFillStyle (xnestDisplay, xnestGC(pGC), FillStippled);
|
||||||
|
XFillRectangle (xnestDisplay, xnestDrawable(pDst),
|
||||||
|
xnestGC(pGC), x, y, width, height);
|
||||||
|
XSetFillStyle (xnestDisplay, xnestGC(pGC), FillSolid);
|
||||||
|
}
|
||||||
|
else
|
||||||
ErrorF("xnest warning: function xnestPushPixels not implemented\n");
|
ErrorF("xnest warning: function xnestPushPixels not implemented\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,6 +124,14 @@ static miPointerScreenFuncRec xnestPointerCursorFuncs =
|
||||||
miPointerWarpCursor
|
miPointerWarpCursor
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static miPointerSpriteFuncRec xnestPointerSpriteFuncs =
|
||||||
|
{
|
||||||
|
xnestRealizeCursor,
|
||||||
|
xnestUnrealizeCursor,
|
||||||
|
xnestSetCursor,
|
||||||
|
xnestMoveCursor,
|
||||||
|
};
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[])
|
xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
@ -241,27 +249,6 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[])
|
||||||
xnestHeight = gattributes.height;
|
xnestHeight = gattributes.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* myNum */
|
|
||||||
/* id */
|
|
||||||
miScreenInit(pScreen, NULL, xnestWidth, xnestHeight, 1, 1, xnestWidth,
|
|
||||||
rootDepth,
|
|
||||||
numDepths, depths,
|
|
||||||
defaultVisual, /* root visual */
|
|
||||||
numVisuals, visuals);
|
|
||||||
|
|
||||||
miInitializeBackingStore(pScreen);
|
|
||||||
|
|
||||||
miDCInitialize(pScreen, &xnestPointerCursorFuncs);
|
|
||||||
|
|
||||||
pScreen->mmWidth = xnestWidth * DisplayWidthMM(xnestDisplay,
|
|
||||||
DefaultScreen(xnestDisplay)) /
|
|
||||||
DisplayWidth(xnestDisplay,
|
|
||||||
DefaultScreen(xnestDisplay));
|
|
||||||
pScreen->mmHeight = xnestHeight * DisplayHeightMM(xnestDisplay,
|
|
||||||
DefaultScreen(xnestDisplay)) /
|
|
||||||
DisplayHeight(xnestDisplay,
|
|
||||||
DefaultScreen(xnestDisplay));
|
|
||||||
|
|
||||||
pScreen->defColormap = (Colormap) FakeClientID(0);
|
pScreen->defColormap = (Colormap) FakeClientID(0);
|
||||||
pScreen->minInstalledCmaps = MINCMAPS;
|
pScreen->minInstalledCmaps = MINCMAPS;
|
||||||
pScreen->maxInstalledCmaps = MAXCMAPS;
|
pScreen->maxInstalledCmaps = MAXCMAPS;
|
||||||
|
@ -282,7 +269,6 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[])
|
||||||
|
|
||||||
/* Random screen procedures */
|
/* Random screen procedures */
|
||||||
|
|
||||||
pScreen->CloseScreen = xnestCloseScreen;
|
|
||||||
pScreen->QueryBestSize = xnestQueryBestSize;
|
pScreen->QueryBestSize = xnestQueryBestSize;
|
||||||
pScreen->SaveScreen = xnestSaveScreen;
|
pScreen->SaveScreen = xnestSaveScreen;
|
||||||
pScreen->GetImage = xnestGetImage;
|
pScreen->GetImage = xnestGetImage;
|
||||||
|
@ -324,16 +310,6 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[])
|
||||||
pScreen->RealizeFont = xnestRealizeFont;
|
pScreen->RealizeFont = xnestRealizeFont;
|
||||||
pScreen->UnrealizeFont = xnestUnrealizeFont;
|
pScreen->UnrealizeFont = xnestUnrealizeFont;
|
||||||
|
|
||||||
/* Cursor Procedures */
|
|
||||||
|
|
||||||
pScreen->ConstrainCursor = xnestConstrainCursor;
|
|
||||||
pScreen->CursorLimits = xnestCursorLimits;
|
|
||||||
pScreen->DisplayCursor = xnestDisplayCursor;
|
|
||||||
pScreen->RealizeCursor = xnestRealizeCursor;
|
|
||||||
pScreen->UnrealizeCursor = xnestUnrealizeCursor;
|
|
||||||
pScreen->RecolorCursor = xnestRecolorCursor;
|
|
||||||
pScreen->SetCursorPosition = xnestSetCursorPosition;
|
|
||||||
|
|
||||||
/* GC procedures */
|
/* GC procedures */
|
||||||
|
|
||||||
pScreen->CreateGC = xnestCreateGC;
|
pScreen->CreateGC = xnestCreateGC;
|
||||||
|
@ -356,6 +332,31 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[])
|
||||||
pScreen->WakeupHandler = (ScreenWakeupHandlerProcPtr)NoopDDA;
|
pScreen->WakeupHandler = (ScreenWakeupHandlerProcPtr)NoopDDA;
|
||||||
pScreen->blockData = NULL;
|
pScreen->blockData = NULL;
|
||||||
pScreen->wakeupData = NULL;
|
pScreen->wakeupData = NULL;
|
||||||
|
/* myNum */
|
||||||
|
/* id */
|
||||||
|
miScreenInit(pScreen, NULL, xnestWidth, xnestHeight, 1, 1, xnestWidth,
|
||||||
|
rootDepth,
|
||||||
|
numDepths, depths,
|
||||||
|
defaultVisual, /* root visual */
|
||||||
|
numVisuals, visuals);
|
||||||
|
|
||||||
|
/* miInitializeBackingStore(pScreen); */
|
||||||
|
|
||||||
|
miPointerInitialize (pScreen, &xnestPointerSpriteFuncs,
|
||||||
|
&xnestPointerCursorFuncs, True);
|
||||||
|
|
||||||
|
pScreen->mmWidth = xnestWidth * DisplayWidthMM(xnestDisplay,
|
||||||
|
DefaultScreen(xnestDisplay)) /
|
||||||
|
DisplayWidth(xnestDisplay,
|
||||||
|
DefaultScreen(xnestDisplay));
|
||||||
|
pScreen->mmHeight = xnestHeight * DisplayHeightMM(xnestDisplay,
|
||||||
|
DefaultScreen(xnestDisplay)) /
|
||||||
|
DisplayHeight(xnestDisplay,
|
||||||
|
DefaultScreen(xnestDisplay));
|
||||||
|
|
||||||
|
/* overwrite miCloseScreen with our own */
|
||||||
|
pScreen->CloseScreen = xnestCloseScreen;
|
||||||
|
|
||||||
if (!miScreenDevPrivateInit(pScreen, xnestWidth, NULL))
|
if (!miScreenDevPrivateInit(pScreen, xnestWidth, NULL))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
|
|
@ -27,14 +27,9 @@ typedef struct {
|
||||||
#define xnestCursor(pCursor, pScreen) \
|
#define xnestCursor(pCursor, pScreen) \
|
||||||
(xnestCursorPriv(pCursor, pScreen)->cursor)
|
(xnestCursorPriv(pCursor, pScreen)->cursor)
|
||||||
|
|
||||||
void xnestConstrainCursor(ScreenPtr pScreen, BoxPtr pBox);
|
|
||||||
void xnestCursorLimits(ScreenPtr pScreen, CursorPtr pCursor, BoxPtr pHotBox,
|
|
||||||
BoxPtr pTopLeftBox);
|
|
||||||
Bool xnestDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor);
|
|
||||||
Bool xnestRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
|
Bool xnestRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
|
||||||
Bool xnestUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
|
Bool xnestUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
|
||||||
void xnestRecolorCursor(ScreenPtr pScreen, CursorPtr pCursor, Bool displayed);
|
void xnestSetCursor (ScreenPtr pScreen, CursorPtr pCursor, int x, int y);
|
||||||
Bool xnestSetCursorPosition(ScreenPtr pScreen, int x, int y,
|
void xnestMoveCursor (ScreenPtr pScreen, int x, int y);
|
||||||
Bool generateEvent);
|
|
||||||
|
|
||||||
#endif /* XNESTCURSOR_H */
|
#endif /* XNESTCURSOR_H */
|
||||||
|
|
|
@ -61,30 +61,44 @@
|
||||||
#define DAMAGE_DEBUG(x)
|
#define DAMAGE_DEBUG(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static PixmapPtr
|
#define getPixmapDamageRef(pPixmap) \
|
||||||
GetDrawablePixmap (DrawablePtr pDrawable)
|
((DamagePtr *) &(pPixmap->devPrivates[damagePixPrivateIndex].ptr))
|
||||||
|
|
||||||
|
#define pixmapDamage(pPixmap) damagePixPriv(pPixmap)
|
||||||
|
|
||||||
|
static DamagePtr *
|
||||||
|
getDrawableDamageRef (DrawablePtr pDrawable)
|
||||||
{
|
{
|
||||||
ScreenPtr pScreen = pDrawable->pScreen;
|
|
||||||
PixmapPtr pPixmap;
|
PixmapPtr pPixmap;
|
||||||
|
|
||||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
{
|
{
|
||||||
pPixmap = (*pScreen->GetWindowPixmap) ((WindowPtr) pDrawable);
|
ScreenPtr pScreen = pDrawable->pScreen;
|
||||||
|
|
||||||
|
pPixmap = 0;
|
||||||
|
if (pScreen->GetWindowPixmap)
|
||||||
|
pPixmap = (*pScreen->GetWindowPixmap) ((WindowPtr)pDrawable);
|
||||||
|
|
||||||
if (!pPixmap)
|
if (!pPixmap)
|
||||||
pPixmap = (*pScreen->GetScreenPixmap) (pDrawable->pScreen);
|
{
|
||||||
|
damageScrPriv(pScreen);
|
||||||
|
|
||||||
|
return &pScrPriv->pScreenDamage;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
pPixmap = (PixmapPtr) pDrawable;
|
pPixmap = (PixmapPtr) pDrawable;
|
||||||
return pPixmap;
|
return getPixmapDamageRef (pPixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define pixmapDamage(pPixmap) damagePixPriv(pPixmap)
|
#define getDrawableDamage(pDrawable) (*getDrawableDamageRef (pDrawable))
|
||||||
#define drawableDamage(pDrawable) damagePixPriv(GetDrawablePixmap(pDrawable))
|
|
||||||
#define windowDamage(pWin) drawableDamage(&(pWin)->drawable)
|
|
||||||
#define getDrawableDamage(pDrawable) damageGetPixPriv(GetDrawablePixmap(pDrawable))
|
|
||||||
#define getWindowDamage(pWin) getDrawableDamage(&(pWin)->drawable)
|
#define getWindowDamage(pWin) getDrawableDamage(&(pWin)->drawable)
|
||||||
#define pixDamageRef(pPixmap) \
|
|
||||||
DamagePtr *pPrev = (DamagePtr *) \
|
#define drawableDamage(pDrawable) \
|
||||||
&(pPixmap->devPrivates[damagePixPrivateIndex].ptr)
|
DamagePtr pDamage = getDrawableDamage(pDrawable)
|
||||||
|
|
||||||
|
#define windowDamage(pWin) drawableDamage(&(pWin)->drawable)
|
||||||
|
|
||||||
#define winDamageRef(pWindow) \
|
#define winDamageRef(pWindow) \
|
||||||
DamagePtr *pPrev = (DamagePtr *) \
|
DamagePtr *pPrev = (DamagePtr *) \
|
||||||
&(pWindow->devPrivates[damageWinPrivateIndex].ptr)
|
&(pWindow->devPrivates[damageWinPrivateIndex].ptr)
|
||||||
|
@ -299,6 +313,7 @@ damageCreateGC(GCPtr pGC)
|
||||||
damageGCPriv(pGC);
|
damageGCPriv(pGC);
|
||||||
Bool ret;
|
Bool ret;
|
||||||
|
|
||||||
|
pGC->pCompositeClip = 0;
|
||||||
unwrap (pScrPriv, pScreen, CreateGC);
|
unwrap (pScrPriv, pScreen, CreateGC);
|
||||||
if((ret = (*pScreen->CreateGC) (pGC))) {
|
if((ret = (*pScreen->CreateGC) (pGC))) {
|
||||||
pGCPriv->ops = NULL;
|
pGCPriv->ops = NULL;
|
||||||
|
@ -416,7 +431,7 @@ damageDestroyClip(GCPtr pGC)
|
||||||
DAMAGE_GC_FUNC_EPILOGUE (pGC);
|
DAMAGE_GC_FUNC_EPILOGUE (pGC);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define TRIM_BOX(box, pGC) { \
|
#define TRIM_BOX(box, pGC) if (pGC->pCompositeClip) { \
|
||||||
BoxPtr extents = &pGC->pCompositeClip->extents;\
|
BoxPtr extents = &pGC->pCompositeClip->extents;\
|
||||||
if(box.x1 < extents->x1) box.x1 = extents->x1; \
|
if(box.x1 < extents->x1) box.x1 = extents->x1; \
|
||||||
if(box.x2 > extents->x2) box.x2 = extents->x2; \
|
if(box.x2 > extents->x2) box.x2 = extents->x2; \
|
||||||
|
@ -440,7 +455,9 @@ damageDestroyClip(GCPtr pGC)
|
||||||
(((box.x2 - box.x1) > 0) && ((box.y2 - box.y1) > 0))
|
(((box.x2 - box.x1) > 0) && ((box.y2 - box.y1) > 0))
|
||||||
|
|
||||||
#define checkGCDamage(d,g) (getDrawableDamage(d) && \
|
#define checkGCDamage(d,g) (getDrawableDamage(d) && \
|
||||||
REGION_NOTEMPTY(d->pScreen, g->pCompositeClip))
|
(!g->pCompositeClip ||\
|
||||||
|
REGION_NOTEMPTY(d->pScreen, \
|
||||||
|
g->pCompositeClip)))
|
||||||
|
|
||||||
#ifdef RENDER
|
#ifdef RENDER
|
||||||
|
|
||||||
|
@ -1442,10 +1459,8 @@ damagePushPixels(GCPtr pGC,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
damageRemoveDamage (PixmapPtr pPixmap, DamagePtr pDamage)
|
damageRemoveDamage (DamagePtr *pPrev, DamagePtr pDamage)
|
||||||
{
|
{
|
||||||
pixDamageRef (pPixmap);
|
|
||||||
|
|
||||||
while (*pPrev)
|
while (*pPrev)
|
||||||
{
|
{
|
||||||
if (*pPrev == pDamage)
|
if (*pPrev == pDamage)
|
||||||
|
@ -1462,10 +1477,8 @@ damageRemoveDamage (PixmapPtr pPixmap, DamagePtr pDamage)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
damageInsertDamage (PixmapPtr pPixmap, DamagePtr pDamage)
|
damageInsertDamage (DamagePtr *pPrev, DamagePtr pDamage)
|
||||||
{
|
{
|
||||||
pixDamageRef (pPixmap);
|
|
||||||
|
|
||||||
#if DAMAGE_VALIDATE_ENABLE
|
#if DAMAGE_VALIDATE_ENABLE
|
||||||
DamagePtr pOld;
|
DamagePtr pOld;
|
||||||
|
|
||||||
|
@ -1484,13 +1497,15 @@ damageDestroyPixmap (PixmapPtr pPixmap)
|
||||||
{
|
{
|
||||||
ScreenPtr pScreen = pPixmap->drawable.pScreen;
|
ScreenPtr pScreen = pPixmap->drawable.pScreen;
|
||||||
damageScrPriv(pScreen);
|
damageScrPriv(pScreen);
|
||||||
DamagePtr pDamage;
|
|
||||||
|
|
||||||
if (pPixmap->refcnt == 1)
|
if (pPixmap->refcnt == 1)
|
||||||
{
|
{
|
||||||
while ((pDamage = damageGetPixPriv(pPixmap)))
|
DamagePtr *pPrev = getPixmapDamageRef (pPixmap);
|
||||||
|
DamagePtr pDamage;
|
||||||
|
|
||||||
|
while ((pDamage = *pPrev))
|
||||||
{
|
{
|
||||||
damageRemoveDamage (pPixmap, pDamage);
|
damageRemoveDamage (pPrev, pDamage);
|
||||||
if (!pDamage->isWindow)
|
if (!pDamage->isWindow)
|
||||||
DamageDestroy (pDamage);
|
DamageDestroy (pDamage);
|
||||||
}
|
}
|
||||||
|
@ -1599,9 +1614,11 @@ damageSetWindowPixmap (WindowPtr pWindow, PixmapPtr pPixmap)
|
||||||
if ((pDamage = damageGetWinPriv(pWindow)))
|
if ((pDamage = damageGetWinPriv(pWindow)))
|
||||||
{
|
{
|
||||||
PixmapPtr pOldPixmap = (*pScreen->GetWindowPixmap) (pWindow);
|
PixmapPtr pOldPixmap = (*pScreen->GetWindowPixmap) (pWindow);
|
||||||
|
DamagePtr *pPrev = getPixmapDamageRef(pOldPixmap);
|
||||||
|
|
||||||
while (pDamage)
|
while (pDamage)
|
||||||
{
|
{
|
||||||
damageRemoveDamage (pOldPixmap, pDamage);
|
damageRemoveDamage (pPrev, pDamage);
|
||||||
pDamage = pDamage->pNextWin;
|
pDamage = pDamage->pNextWin;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1610,9 +1627,11 @@ damageSetWindowPixmap (WindowPtr pWindow, PixmapPtr pPixmap)
|
||||||
wrap (pScrPriv, pScreen, SetWindowPixmap, damageSetWindowPixmap);
|
wrap (pScrPriv, pScreen, SetWindowPixmap, damageSetWindowPixmap);
|
||||||
if ((pDamage = damageGetWinPriv(pWindow)))
|
if ((pDamage = damageGetWinPriv(pWindow)))
|
||||||
{
|
{
|
||||||
|
DamagePtr *pPrev = getPixmapDamageRef(pPixmap);
|
||||||
|
|
||||||
while (pDamage)
|
while (pDamage)
|
||||||
{
|
{
|
||||||
damageInsertDamage (pPixmap, pDamage);
|
damageInsertDamage (pPrev, pDamage);
|
||||||
pDamage = pDamage->pNextWin;
|
pDamage = pDamage->pNextWin;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1698,6 +1717,7 @@ DamageSetup (ScreenPtr pScreen)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
pScrPriv->internalLevel = 0;
|
pScrPriv->internalLevel = 0;
|
||||||
|
pScrPriv->pScreenDamage = 0;
|
||||||
|
|
||||||
wrap (pScrPriv, pScreen, DestroyPixmap, damageDestroyPixmap);
|
wrap (pScrPriv, pScreen, DestroyPixmap, damageDestroyPixmap);
|
||||||
wrap (pScrPriv, pScreen, CreateGC, damageCreateGC);
|
wrap (pScrPriv, pScreen, CreateGC, damageCreateGC);
|
||||||
|
@ -1773,7 +1793,7 @@ DamageRegister (DrawablePtr pDrawable,
|
||||||
else
|
else
|
||||||
pDamage->isWindow = FALSE;
|
pDamage->isWindow = FALSE;
|
||||||
pDamage->pDrawable = pDrawable;
|
pDamage->pDrawable = pDrawable;
|
||||||
damageInsertDamage (GetDrawablePixmap (pDrawable), pDamage);
|
damageInsertDamage (getDrawableDamageRef (pDrawable), pDamage);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1816,7 +1836,7 @@ DamageUnregister (DrawablePtr pDrawable,
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
pDamage->pDrawable = 0;
|
pDamage->pDrawable = 0;
|
||||||
damageRemoveDamage (GetDrawablePixmap (pDrawable), pDamage);
|
damageRemoveDamage (getDrawableDamageRef (pDrawable), pDamage);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -46,6 +46,12 @@ typedef struct _damage {
|
||||||
typedef struct _damageScrPriv {
|
typedef struct _damageScrPriv {
|
||||||
int internalLevel;
|
int internalLevel;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* For DDXen which don't provide GetScreenPixmap, this provides
|
||||||
|
* a place to hook damage for windows on the screen
|
||||||
|
*/
|
||||||
|
DamagePtr pScreenDamage;
|
||||||
|
|
||||||
PaintWindowBackgroundProcPtr PaintWindowBackground;
|
PaintWindowBackgroundProcPtr PaintWindowBackground;
|
||||||
PaintWindowBorderProcPtr PaintWindowBorder;
|
PaintWindowBorderProcPtr PaintWindowBorder;
|
||||||
CopyWindowProcPtr CopyWindow;
|
CopyWindowProcPtr CopyWindow;
|
||||||
|
|
Loading…
Reference in New Issue