EXA: Track source/mask pixmaps more explicitly for Composite fallback regions.
In particular, make sure pExaScr->src/maskPix are cleared when the corresponding pictures aren't associated with drawables, i.e. solid or gradient pictures. Without this, we would in some cases associate the source/mask region with unrelated pixmaps from previous Composite fallbacks, resulting in random corruption. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47266 Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
		
							parent
							
								
									53830281b4
								
							
						
					
					
						commit
						1ca096d5e0
					
				| 
						 | 
				
			
			@ -208,6 +208,7 @@ typedef struct {
 | 
			
		|||
    RegionRec srcReg;
 | 
			
		||||
    RegionRec maskReg;
 | 
			
		||||
    PixmapPtr srcPix;
 | 
			
		||||
    PixmapPtr maskPix;
 | 
			
		||||
 | 
			
		||||
    DevPrivateKeyRec pixmapPrivateKeyRec;
 | 
			
		||||
    DevPrivateKeyRec gcPrivateKeyRec;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -442,6 +442,13 @@ ExaSrcValidate(DrawablePtr pDrawable,
 | 
			
		|||
    RegionPtr dst;
 | 
			
		||||
    int xoff, yoff;
 | 
			
		||||
 | 
			
		||||
    if (pExaScr->srcPix == pPix)
 | 
			
		||||
        dst = &pExaScr->srcReg;
 | 
			
		||||
    else if (pExaScr->maskPix == pPix)
 | 
			
		||||
        dst = &pExaScr->maskReg;
 | 
			
		||||
    else
 | 
			
		||||
        return;
 | 
			
		||||
 | 
			
		||||
    exaGetDrawableDeltas(pDrawable, pPix, &xoff, &yoff);
 | 
			
		||||
 | 
			
		||||
    box.x1 = x + xoff;
 | 
			
		||||
| 
						 | 
				
			
			@ -449,8 +456,6 @@ ExaSrcValidate(DrawablePtr pDrawable,
 | 
			
		|||
    box.x2 = box.x1 + width;
 | 
			
		||||
    box.y2 = box.y1 + height;
 | 
			
		||||
 | 
			
		||||
    dst = (pExaScr->srcPix == pPix) ? &pExaScr->srcReg : &pExaScr->maskReg;
 | 
			
		||||
 | 
			
		||||
    RegionInit(®, &box, 1);
 | 
			
		||||
    RegionUnion(dst, dst, ®);
 | 
			
		||||
    RegionUninit(®);
 | 
			
		||||
| 
						 | 
				
			
			@ -495,16 +500,19 @@ ExaPrepareCompositeReg(ScreenPtr pScreen,
 | 
			
		|||
        if (pSrc != pDst)
 | 
			
		||||
            RegionTranslate(pSrc->pCompositeClip,
 | 
			
		||||
                            -pSrc->pDrawable->x, -pSrc->pDrawable->y);
 | 
			
		||||
    }
 | 
			
		||||
    } else
 | 
			
		||||
        pExaScr->srcPix = NULL;
 | 
			
		||||
 | 
			
		||||
    if (pMask && pMask->pDrawable) {
 | 
			
		||||
        pMaskPix = exaGetDrawablePixmap(pMask->pDrawable);
 | 
			
		||||
        RegionNull(&pExaScr->maskReg);
 | 
			
		||||
        maskReg = &pExaScr->maskReg;
 | 
			
		||||
        pExaScr->maskPix = pMaskPix;
 | 
			
		||||
        if (pMask != pDst && pMask != pSrc)
 | 
			
		||||
            RegionTranslate(pMask->pCompositeClip,
 | 
			
		||||
                            -pMask->pDrawable->x, -pMask->pDrawable->y);
 | 
			
		||||
    }
 | 
			
		||||
    } else
 | 
			
		||||
        pExaScr->maskPix = NULL;
 | 
			
		||||
 | 
			
		||||
    RegionTranslate(pDst->pCompositeClip,
 | 
			
		||||
                    -pDst->pDrawable->x, -pDst->pDrawable->y);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue