(!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
							
								
									2c5a51e7ef
								
							
						
					
					
						commit
						cd81554aa5
					
				|  | @ -1485,14 +1485,8 @@ damageInsertDamage(DamagePtr * pPrev, DamagePtr pDamage) | ||||||
|     *pPrev = pDamage; |     *pPrev = pDamage; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static Bool | static void damagePixmapDestroy(CallbackListPtr *pcbl, ScreenPtr pScreen, PixmapPtr pPixmap) | ||||||
| damageDestroyPixmap(PixmapPtr pPixmap) |  | ||||||
| { | { | ||||||
|     ScreenPtr pScreen = pPixmap->drawable.pScreen; |  | ||||||
| 
 |  | ||||||
|     damageScrPriv(pScreen); |  | ||||||
| 
 |  | ||||||
|     if (pPixmap->refcnt == 1) { |  | ||||||
|     DamagePtr *pPrev = getPixmapDamageRef(pPixmap); |     DamagePtr *pPrev = getPixmapDamageRef(pPixmap); | ||||||
|     DamagePtr pDamage; |     DamagePtr pDamage; | ||||||
| 
 | 
 | ||||||
|  | @ -1502,12 +1496,6 @@ damageDestroyPixmap(PixmapPtr pPixmap) | ||||||
|             DamageDestroy(pDamage); |             DamageDestroy(pDamage); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|     unwrap(pScrPriv, pScreen, DestroyPixmap); |  | ||||||
|     if (pScreen->DestroyPixmap) |  | ||||||
|         pScreen->DestroyPixmap(pPixmap); |  | ||||||
|     wrap(pScrPriv, pScreen, DestroyPixmap, damageDestroyPixmap); |  | ||||||
|     return TRUE; |  | ||||||
| } |  | ||||||
| 
 | 
 | ||||||
| static void | static void | ||||||
| damageCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc) | damageCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc) | ||||||
|  | @ -1591,12 +1579,12 @@ static void damageCloseScreen(CallbackListPtr *pcbl, ScreenPtr pScreen, void *un | ||||||
| { | { | ||||||
|     dixScreenUnhookClose(pScreen, damageCloseScreen); |     dixScreenUnhookClose(pScreen, damageCloseScreen); | ||||||
|     dixScreenUnhookWindowDestroy(pScreen, damageWindowDestroy); |     dixScreenUnhookWindowDestroy(pScreen, damageWindowDestroy); | ||||||
|  |     dixScreenUnhookPixmapDestroy(pScreen, damagePixmapDestroy); | ||||||
| 
 | 
 | ||||||
|     damageScrPriv(pScreen); |     damageScrPriv(pScreen); | ||||||
|     if (!pScrPriv) |     if (!pScrPriv) | ||||||
|         return; |         return; | ||||||
| 
 | 
 | ||||||
|     unwrap(pScrPriv, pScreen, DestroyPixmap); |  | ||||||
|     unwrap(pScrPriv, pScreen, CreateGC); |     unwrap(pScrPriv, pScreen, CreateGC); | ||||||
|     unwrap(pScrPriv, pScreen, CopyWindow); |     unwrap(pScrPriv, pScreen, CopyWindow); | ||||||
| 
 | 
 | ||||||
|  | @ -1690,8 +1678,8 @@ DamageSetup(ScreenPtr pScreen) | ||||||
| 
 | 
 | ||||||
|     dixScreenHookClose(pScreen, damageCloseScreen); |     dixScreenHookClose(pScreen, damageCloseScreen); | ||||||
|     dixScreenHookWindowDestroy(pScreen, damageWindowDestroy); |     dixScreenHookWindowDestroy(pScreen, damageWindowDestroy); | ||||||
|  |     dixScreenHookPixmapDestroy(pScreen, damagePixmapDestroy); | ||||||
| 
 | 
 | ||||||
|     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); | ||||||
|  |  | ||||||
|  | @ -62,7 +62,6 @@ typedef struct _damageScrPriv { | ||||||
| 
 | 
 | ||||||
|     CopyWindowProcPtr CopyWindow; |     CopyWindowProcPtr CopyWindow; | ||||||
|     CreateGCProcPtr CreateGC; |     CreateGCProcPtr CreateGC; | ||||||
|     DestroyPixmapProcPtr DestroyPixmap; |  | ||||||
|     SetWindowPixmapProcPtr SetWindowPixmap; |     SetWindowPixmapProcPtr SetWindowPixmap; | ||||||
|     CompositeProcPtr Composite; |     CompositeProcPtr Composite; | ||||||
|     GlyphsProcPtr Glyphs; |     GlyphsProcPtr Glyphs; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue