(!1714) damage: use PixmapDestroy hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so use the new pixmap destroy notify hook instead. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
		
							parent
							
								
									2f7c911730
								
							
						
					
					
						commit
						987f37270b
					
				|  | @ -1484,28 +1484,16 @@ damageInsertDamage(DamagePtr * pPrev, DamagePtr pDamage) | ||||||
|     *pPrev = pDamage; |     *pPrev = pDamage; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static Bool | static void damagePixmapDestroy(ScreenPtr pScreen, PixmapPtr pPixmap, void *arg) | ||||||
| damageDestroyPixmap(PixmapPtr pPixmap) |  | ||||||
| { | { | ||||||
|     ScreenPtr pScreen = pPixmap->drawable.pScreen; |     DamagePtr *pPrev = getPixmapDamageRef(pPixmap); | ||||||
|  |     DamagePtr pDamage; | ||||||
| 
 | 
 | ||||||
|     damageScrPriv(pScreen); |     while ((pDamage = *pPrev)) { | ||||||
| 
 |         damageRemoveDamage(pPrev, pDamage); | ||||||
|     if (pPixmap->refcnt == 1) { |         if (!pDamage->isWindow) | ||||||
|         DamagePtr *pPrev = getPixmapDamageRef(pPixmap); |             DamageDestroy(pDamage); | ||||||
|         DamagePtr pDamage; |  | ||||||
| 
 |  | ||||||
|         while ((pDamage = *pPrev)) { |  | ||||||
|             damageRemoveDamage(pPrev, pDamage); |  | ||||||
|             if (!pDamage->isWindow) |  | ||||||
|                 DamageDestroy(pDamage); |  | ||||||
|         } |  | ||||||
|     } |     } | ||||||
|     unwrap(pScrPriv, pScreen, DestroyPixmap); |  | ||||||
|     if (pScreen->DestroyPixmap) |  | ||||||
|         pScreen->DestroyPixmap(pPixmap); |  | ||||||
|     wrap(pScrPriv, pScreen, DestroyPixmap, damageDestroyPixmap); |  | ||||||
|     return TRUE; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static void | static void | ||||||
|  | @ -1592,8 +1580,8 @@ damageCloseScreen(ScreenPtr pScreen) | ||||||
|     damageScrPriv(pScreen); |     damageScrPriv(pScreen); | ||||||
| 
 | 
 | ||||||
|     dixScreenUnhookWindowDestroy(pScreen, damageWindowDestroy, NULL); |     dixScreenUnhookWindowDestroy(pScreen, damageWindowDestroy, NULL); | ||||||
|  |     dixScreenUnhookPixmapDestroy(pScreen, damagePixmapDestroy, NULL); | ||||||
| 
 | 
 | ||||||
|     unwrap(pScrPriv, pScreen, DestroyPixmap); |  | ||||||
|     unwrap(pScrPriv, pScreen, CreateGC); |     unwrap(pScrPriv, pScreen, CreateGC); | ||||||
|     unwrap(pScrPriv, pScreen, CopyWindow); |     unwrap(pScrPriv, pScreen, CopyWindow); | ||||||
|     unwrap(pScrPriv, pScreen, CloseScreen); |     unwrap(pScrPriv, pScreen, CloseScreen); | ||||||
|  | @ -1686,8 +1674,8 @@ DamageSetup(ScreenPtr pScreen) | ||||||
|     pScrPriv->pScreenDamage = 0; |     pScrPriv->pScreenDamage = 0; | ||||||
| 
 | 
 | ||||||
|     dixScreenHookWindowDestroy(pScreen, damageWindowDestroy, NULL); |     dixScreenHookWindowDestroy(pScreen, damageWindowDestroy, NULL); | ||||||
|  |     dixScreenHookPixmapDestroy(pScreen, damagePixmapDestroy, NULL); | ||||||
| 
 | 
 | ||||||
|     wrap(pScrPriv, pScreen, DestroyPixmap, damageDestroyPixmap); |  | ||||||
|     wrap(pScrPriv, pScreen, CreateGC, damageCreateGC); |     wrap(pScrPriv, pScreen, CreateGC, damageCreateGC); | ||||||
|     wrap(pScrPriv, pScreen, SetWindowPixmap, damageSetWindowPixmap); |     wrap(pScrPriv, pScreen, SetWindowPixmap, damageSetWindowPixmap); | ||||||
|     wrap(pScrPriv, pScreen, CopyWindow, damageCopyWindow); |     wrap(pScrPriv, pScreen, CopyWindow, damageCopyWindow); | ||||||
|  |  | ||||||
|  | @ -63,7 +63,6 @@ typedef struct _damageScrPriv { | ||||||
|     CopyWindowProcPtr CopyWindow; |     CopyWindowProcPtr CopyWindow; | ||||||
|     CloseScreenProcPtr CloseScreen; |     CloseScreenProcPtr CloseScreen; | ||||||
|     CreateGCProcPtr CreateGC; |     CreateGCProcPtr CreateGC; | ||||||
|     DestroyPixmapProcPtr DestroyPixmap; |  | ||||||
|     SetWindowPixmapProcPtr SetWindowPixmap; |     SetWindowPixmapProcPtr SetWindowPixmap; | ||||||
|     CompositeProcPtr Composite; |     CompositeProcPtr Composite; | ||||||
|     GlyphsProcPtr Glyphs; |     GlyphsProcPtr Glyphs; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue