misprite: In SourceValidate, check that it's a Window first

It almost never is.  However, you have _lots_ of input devices now, and
walking them all on every Composite operation is not the cheapest thing
in the world.
This commit is contained in:
Adam Jackson 2009-03-23 15:19:47 -04:00
parent d698e62690
commit 4ab93f0566

View File

@ -422,23 +422,24 @@ miSpriteSourceValidate (DrawablePtr pDrawable, int x, int y, int width,
SCREEN_PROLOGUE (pScreen, SourceValidate); SCREEN_PROLOGUE (pScreen, SourceValidate);
pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates, if (pDrawable->type == DRAWABLE_WINDOW)
miSpriteScreenKey);
for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
{ {
if (DevHasCursor(pDev)) pScreenPriv = dixLookupPrivate(&pScreen->devPrivates,miSpriteScreenKey);
{
pCursorInfo = MISPRITE(pDev); for(pDev = inputInfo.devices; pDev; pDev = pDev->next)
if (pDrawable->type == DRAWABLE_WINDOW && pCursorInfo->isUp && {
pCursorInfo->pScreen == pScreen && if (DevHasCursor(pDev))
ORG_OVERLAP(&pCursorInfo->saved, pDrawable->x, pDrawable->y, {
x, y, width, height)) pCursorInfo = MISPRITE(pDev);
{ if (pCursorInfo->isUp && pCursorInfo->pScreen == pScreen &&
SPRITE_DEBUG (("SourceValidate remove\n")); ORG_OVERLAP(&pCursorInfo->saved, pDrawable->x, pDrawable->y,
miSpriteRemoveCursor (pDev, pScreen); x, y, width, height))
} {
} SPRITE_DEBUG (("SourceValidate remove\n"));
miSpriteRemoveCursor (pDev, pScreen);
}
}
}
} }
if (pScreen->SourceValidate) if (pScreen->SourceValidate)