mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-24 20:40:04 +01:00
midispcur: Construct Picture objects lazily in case Render is disabled.
Reverts part of the effects of518f3b189b, "mi: don't thrash resources when displaying the software cursor across screens". The per-screen cache is preserved, and the GCs are still allocated eagerly, but now it doesn't construct pRootPicture until somebody attempts to draw an ARGB cursor. I noticed crashes in Xnest, which doesn't support the RENDER extension, but I suspect other DDXes that support disabling that extension would have had issues as well. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com> (cherry picked from commitbf78e11839)
This commit is contained in:
parent
3ad3592820
commit
b1e338df92
1 changed files with 6 additions and 7 deletions
|
|
@ -179,6 +179,7 @@ miDCRealizeCursor (ScreenPtr pScreen, CursorPtr pCursor)
|
|||
}
|
||||
|
||||
#ifdef ARGB_CURSOR
|
||||
#define EnsurePicture(picture,draw,win) (picture || miDCMakePicture(&picture,draw,win))
|
||||
|
||||
static VisualPtr
|
||||
miDCGetWindowVisual (WindowPtr pWin)
|
||||
|
|
@ -451,6 +452,8 @@ miDCPutUpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor,
|
|||
#ifdef ARGB_CURSOR
|
||||
if (pPriv->pPicture)
|
||||
{
|
||||
if (!EnsurePicture(pBuffer->pRootPicture, &pWin->drawable, pWin))
|
||||
return FALSE;
|
||||
CompositePicture (PictOpOver,
|
||||
pPriv->pPicture,
|
||||
NULL,
|
||||
|
|
@ -733,9 +736,8 @@ miDCMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor,
|
|||
#ifdef ARGB_CURSOR
|
||||
if (pPriv->pPicture)
|
||||
{
|
||||
if (!pBuffer->pTempPicture)
|
||||
miDCMakePicture(&pBuffer->pTempPicture, &pTemp->drawable, pWin);
|
||||
|
||||
if (!EnsurePicture(pBuffer->pTempPicture, &pTemp->drawable, pWin))
|
||||
return FALSE;
|
||||
CompositePicture (PictOpOver,
|
||||
pPriv->pPicture,
|
||||
NULL,
|
||||
|
|
@ -819,10 +821,7 @@ miDCDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
|
|||
goto failure;
|
||||
|
||||
#ifdef ARGB_CURSOR
|
||||
miDCMakePicture(&pBuffer->pRootPicture, &pWin->drawable, pWin);
|
||||
if (!pBuffer->pRootPicture)
|
||||
goto failure;
|
||||
|
||||
pBuffer->pRootPicture = NULL;
|
||||
pBuffer->pTempPicture = NULL;
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue