Commit 4dc6d4e8 authored by Zhigang Gong's avatar Zhigang Gong Committed by Eric Anholt

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.
parent 49e3b44a
......@@ -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 FALSE;
miImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
return TRUE;
fail:
return FALSE;
}
void
......@@ -74,17 +67,12 @@ _glamor_poly_glyph_blt(DrawablePtr pDrawable, GCPtr pGC,
{
glamor_screen_private *glamor_priv;
if (!fallback
if (!fallback
&& glamor_ddx_fallback_check_pixmap(pDrawable)
&& 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;
}
......@@ -108,19 +96,13 @@ static Bool
_glamor_push_pixels(GCPtr pGC, PixmapPtr pBitmap,
DrawablePtr pDrawable, int w, int h, int x, int y, Bool fallback)
{
if (!fallback
if (!fallback
&& glamor_ddx_fallback_check_pixmap(pDrawable)
&& glamor_ddx_fallback_check_pixmap(&pBitmap->drawable)
&& 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);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment