glyphblt/polyops: Use miFunctions by default.
Calling to miFunctions give some opportunities to jump to accelerated path, so we switch to call miFunctions rather than fallback to fbFunctions directly.
This commit is contained in:
		
							parent
							
								
									49e3b44aa8
								
							
						
					
					
						commit
						4dc6d4e84b
					
				| 
						 | 
				
			
			@ -38,17 +38,10 @@ _glamor_image_glyph_blt(DrawablePtr pDrawable, GCPtr pGC,
 | 
			
		|||
	if (!fallback 
 | 
			
		||||
	    && glamor_ddx_fallback_check_pixmap(pDrawable)
 | 
			
		||||
	    && glamor_ddx_fallback_check_gc(pGC))
 | 
			
		||||
		goto fail;
 | 
			
		||||
 | 
			
		||||
	glamor_priv = glamor_get_screen_private(pDrawable->pScreen);
 | 
			
		||||
	glamor_prepare_access(pDrawable, GLAMOR_ACCESS_RW);
 | 
			
		||||
	glamor_prepare_access_gc(pGC);
 | 
			
		||||
	fbImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
 | 
			
		||||
	glamor_finish_access_gc(pGC);
 | 
			
		||||
	glamor_finish_access(pDrawable, GLAMOR_ACCESS_RW);
 | 
			
		||||
	return TRUE;
 | 
			
		||||
 fail:
 | 
			
		||||
		return FALSE;
 | 
			
		||||
 | 
			
		||||
	miImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
 | 
			
		||||
	return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
| 
						 | 
				
			
			@ -79,12 +72,7 @@ _glamor_poly_glyph_blt(DrawablePtr pDrawable, GCPtr pGC,
 | 
			
		|||
	    && glamor_ddx_fallback_check_gc(pGC))
 | 
			
		||||
		return FALSE;
 | 
			
		||||
 | 
			
		||||
	glamor_priv = glamor_get_screen_private(pDrawable->pScreen);
 | 
			
		||||
	glamor_prepare_access(pDrawable, GLAMOR_ACCESS_RW);
 | 
			
		||||
	glamor_prepare_access_gc(pGC);
 | 
			
		||||
	fbPolyGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
 | 
			
		||||
	glamor_finish_access_gc(pGC);
 | 
			
		||||
	glamor_finish_access(pDrawable, GLAMOR_ACCESS_RW);
 | 
			
		||||
	miPolyGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
 | 
			
		||||
	return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -114,13 +102,7 @@ _glamor_push_pixels(GCPtr pGC, PixmapPtr pBitmap,
 | 
			
		|||
	    && glamor_ddx_fallback_check_gc(pGC))
 | 
			
		||||
		return FALSE;
 | 
			
		||||
 | 
			
		||||
	glamor_prepare_access(pDrawable, GLAMOR_ACCESS_RW);
 | 
			
		||||
	glamor_prepare_access(&pBitmap->drawable, GLAMOR_ACCESS_RO);
 | 
			
		||||
	glamor_prepare_access_gc(pGC);
 | 
			
		||||
	fbPushPixels(pGC, pBitmap, pDrawable, w, h, x, y);
 | 
			
		||||
	glamor_finish_access_gc(pGC);
 | 
			
		||||
	glamor_finish_access(&pBitmap->drawable, GLAMOR_ACCESS_RO);
 | 
			
		||||
	glamor_finish_access(pDrawable, GLAMOR_ACCESS_RW);
 | 
			
		||||
	miPushPixels(pGC, pBitmap, pDrawable, w, h, x, y);
 | 
			
		||||
	return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -37,11 +37,8 @@ _glamor_poly_point(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
 | 
			
		|||
	    && glamor_ddx_fallback_check_pixmap(pDrawable))
 | 
			
		||||
		return FALSE;
 | 
			
		||||
 | 
			
		||||
	glamor_prepare_access_gc(pGC);
 | 
			
		||||
	glamor_prepare_access(pDrawable, GLAMOR_ACCESS_RW);
 | 
			
		||||
	fbPolyPoint(pDrawable, pGC, mode, npt, ppt);
 | 
			
		||||
	glamor_finish_access(pDrawable, GLAMOR_ACCESS_RW);
 | 
			
		||||
	glamor_finish_access_gc(pGC);
 | 
			
		||||
	miPolyPoint(pDrawable, pGC, mode, npt, ppt);
 | 
			
		||||
 | 
			
		||||
	return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -68,15 +65,7 @@ _glamor_poly_segment(DrawablePtr pDrawable, GCPtr pGC, int nseg,
 | 
			
		|||
	    && glamor_ddx_fallback_check_pixmap(pDrawable))
 | 
			
		||||
		return FALSE;
 | 
			
		||||
 | 
			
		||||
	/* For lineWidth is not zero, fb calls to mi functions. */
 | 
			
		||||
	if (pGC->lineWidth == 0) {
 | 
			
		||||
		glamor_prepare_access_gc(pGC);
 | 
			
		||||
		glamor_prepare_access(pDrawable, GLAMOR_ACCESS_RW);
 | 
			
		||||
		fbPolySegment(pDrawable, pGC, nseg, pSeg);
 | 
			
		||||
		glamor_finish_access(pDrawable, GLAMOR_ACCESS_RW);
 | 
			
		||||
		glamor_finish_access_gc(pGC);
 | 
			
		||||
	} else
 | 
			
		||||
		fbPolySegment(pDrawable, pGC, nseg, pSeg);
 | 
			
		||||
	miPolySegment(pDrawable, pGC, nseg, pSeg);
 | 
			
		||||
 | 
			
		||||
	return TRUE;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -94,40 +83,3 @@ glamor_poly_segment_nf(DrawablePtr pDrawable, GCPtr pGC, int nseg,
 | 
			
		|||
{
 | 
			
		||||
	return _glamor_poly_segment(pDrawable, pGC, nseg, pSeg, FALSE);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static Bool
 | 
			
		||||
_glamor_poly_line(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
 | 
			
		||||
		  DDXPointPtr ppt, Bool fallback)
 | 
			
		||||
{
 | 
			
		||||
	if (!fallback 
 | 
			
		||||
	    && glamor_ddx_fallback_check_gc(pGC)
 | 
			
		||||
	    && glamor_ddx_fallback_check_pixmap(pDrawable))
 | 
			
		||||
		return FALSE;
 | 
			
		||||
	/* For lineWidth is not zero, fb calls to mi functions. */
 | 
			
		||||
 | 
			
		||||
	if (pGC->lineWidth == 0) {
 | 
			
		||||
		glamor_prepare_access_gc(pGC);
 | 
			
		||||
		glamor_prepare_access(pDrawable, GLAMOR_ACCESS_RW);
 | 
			
		||||
		fbPolyLine(pDrawable, pGC, mode, npt, ppt);
 | 
			
		||||
		glamor_finish_access(pDrawable, GLAMOR_ACCESS_RW);
 | 
			
		||||
		glamor_finish_access_gc(pGC);
 | 
			
		||||
	} else
 | 
			
		||||
		fbPolyLine(pDrawable, pGC, mode, npt, ppt);
 | 
			
		||||
 | 
			
		||||
	return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
glamor_poly_line(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
 | 
			
		||||
		 DDXPointPtr ppt)
 | 
			
		||||
{
 | 
			
		||||
	_glamor_poly_line(pDrawable, pGC, mode, npt, ppt, TRUE);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Bool
 | 
			
		||||
glamor_poly_line_nf(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
 | 
			
		||||
		    DDXPointPtr ppt)
 | 
			
		||||
{
 | 
			
		||||
	return _glamor_poly_line(pDrawable, pGC, mode, npt, ppt, FALSE);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue