diff options
author | Eric Anholt <eric@anholt.net> | 2007-04-18 14:33:27 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2007-04-18 14:33:27 -0700 |
commit | 999b681cf3973af4191506e49cde06963b11a774 (patch) | |
tree | f950b02db73e122bd5473c75198b59695521913c /mi | |
parent | 28bb34eec63bf3c98f38ba7fc044f6419aaa3307 (diff) |
Suppress software cursor removal during rotated shadow buffer drawing.
Diffstat (limited to 'mi')
-rw-r--r-- | mi/misprite.c | 37 | ||||
-rw-r--r-- | mi/misprite.h | 2 | ||||
-rw-r--r-- | mi/mispritest.h | 1 |
3 files changed, 36 insertions, 4 deletions
diff --git a/mi/misprite.c b/mi/misprite.c index c0560a4bb..71e6ab011 100644 --- a/mi/misprite.c +++ b/mi/misprite.c @@ -288,7 +288,8 @@ miSpriteGetImage (pDrawable, sx, sy, w, h, format, planemask, pdstLine) pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr; - if (pDrawable->type == DRAWABLE_WINDOW && + if (pScreenPriv->internalDraw == 0 && + pDrawable->type == DRAWABLE_WINDOW && pScreenPriv->isUp && ORG_OVERLAP(&pScreenPriv->saved,pDrawable->x,pDrawable->y, sx, sy, w, h)) { @@ -318,7 +319,8 @@ miSpriteGetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart) pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr; - if (pDrawable->type == DRAWABLE_WINDOW && pScreenPriv->isUp) + if (pScreenPriv->internalDraw == 0 && + pDrawable->type == DRAWABLE_WINDOW && pScreenPriv->isUp) { DDXPointPtr pts; int *widths; @@ -360,7 +362,8 @@ miSpriteSourceValidate (pDrawable, x, y, width, height) pScreenPriv = (miSpriteScreenPtr) pScreen->devPrivates[miSpriteScreenIndex].ptr; - if (pDrawable->type == DRAWABLE_WINDOW && pScreenPriv->isUp && + if (pScreenPriv->internalDraw == 0 && + pDrawable->type == DRAWABLE_WINDOW && pScreenPriv->isUp && ORG_OVERLAP(&pScreenPriv->saved, pDrawable->x, pDrawable->y, x, y, width, height)) { @@ -386,7 +389,8 @@ miSpriteCopyWindow (WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc) /* * Damage will take care of destination check */ - if (pScreenPriv->isUp && + if (pScreenPriv->internalDraw == 0 && + pScreenPriv->isUp && RECT_IN_REGION (pScreen, prgnSrc, &pScreenPriv->saved) != rgnOUT) { SPRITE_DEBUG (("CopyWindow remove\n")); @@ -827,3 +831,28 @@ miSpriteComputeSaved (pScreen) pScreenPriv->saved.x2 = pScreenPriv->saved.x1 + w + wpad * 2; pScreenPriv->saved.y2 = pScreenPriv->saved.y1 + h + hpad * 2; } + +/** + * Enables internal drawing support, which disables removal of the + * cursor when the screen pixmap is sourced from. + * + * This can be used to allow software cursors to be read by RandR rotation + * shadow code. + */ +void +miSpriteDrawInternal(ScreenPtr pScreen, Bool enable) +{ + miSpriteScreenPtr pScreenPriv; + + /* Check that miSprite has been set up this generation */ + if (miSpriteGeneration != serverGeneration) + return; + + pScreenPriv = (miSpriteScreenPtr) + pScreen->devPrivates[miSpriteScreenIndex].ptr; + + if (enable) + pScreenPriv->internalDraw++; + else + pScreenPriv->internalDraw--; +} diff --git a/mi/misprite.h b/mi/misprite.h index 5173b7736..0a1bcc1b8 100644 --- a/mi/misprite.h +++ b/mi/misprite.h @@ -92,3 +92,5 @@ extern Bool miSpriteInitialize( miSpriteCursorFuncPtr /*cursorFuncs*/, miPointerScreenFuncPtr /*screenFuncs*/ ); + +void miSpriteDrawInternal(ScreenPtr pScreen, Bool enable); diff --git a/mi/mispritest.h b/mi/mispritest.h index 5075f0580..2deaa45f2 100644 --- a/mi/mispritest.h +++ b/mi/mispritest.h @@ -76,6 +76,7 @@ typedef struct { WindowPtr pCacheWin; /* window the cursor last seen in */ Bool isInCacheWin; Bool checkPixels; /* check colormap collision */ + int internalDraw; xColorItem colors[2]; ColormapPtr pInstalledMap; ColormapPtr pColormap; |