diff options
Diffstat (limited to 'render/picture.c')
-rw-r--r-- | render/picture.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/render/picture.c b/render/picture.c index 04ff75260..eeb89b9d5 100644 --- a/render/picture.c +++ b/render/picture.c @@ -1819,6 +1819,9 @@ PicturePtr DuplicatePicture(DrawablePtr pDraw, PicturePtr pSrc) { PicturePtr pPicture; PrivateRec *devPrivates; + PictureScreenPtr ps = GetPictureScreen(pDraw->pScreen); + int error; + pPicture = dixAllocateObjectWithPrivates(PictureRec, PRIVATE_PICTURE); if (!pPicture) return NULL; @@ -1829,5 +1832,17 @@ PicturePtr DuplicatePicture(DrawablePtr pDraw, PicturePtr pSrc) pPicture->pNext = NULL; pPicture->pDrawable = pDraw; + if (pDraw->type == DRAWABLE_PIXMAP) { + ++((PixmapPtr)pDraw)->refcnt; + pPicture->pNext = 0; + } else { + ErrorF("window picture\n"); + } + + error = (*ps->CreatePicture) (pPicture); + if (error != Success) { + FreePicture (pPicture, (XID) 0); + pPicture = 0; + } return pPicture; } |