diff options
author | Keith Packard <keithp@keithp.com> | 2014-04-01 15:28:28 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2014-06-15 22:49:12 +0100 |
commit | 79441c28d4788c828e4fe225391b4151853fc64f (patch) | |
tree | ab94b0fb456cef59de795a18f6737bef9be558e2 | |
parent | 6bda27b398a66efb1dd2fee424ef71970ca57e51 (diff) |
uxa: Use glamor text when available
Newer glamor offers core text routes as well as glyphblt ones. Use the text
functions when available.
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | src/uxa/uxa-accel.c | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/src/uxa/uxa-accel.c b/src/uxa/uxa-accel.c index 757b2761..1142dd2c 100644 --- a/src/uxa/uxa-accel.c +++ b/src/uxa/uxa-accel.c @@ -1037,6 +1037,68 @@ fallback: uxa_check_push_pixels(pGC, pBitmap, pDrawable, w, h, x, y); } +#if HAS_GLAMOR_TEXT +static int +uxa_poly_text8(DrawablePtr drawable, GCPtr gc, + int x, int y, int count, char *chars) +{ + ScreenPtr screen = drawable->pScreen; + uxa_screen_t *uxa_screen = uxa_get_screen(screen); + + if (uxa_screen->info->flags & UXA_USE_GLAMOR) { + int final_pos; + + if (glamor_poly_text8_nf(drawable, gc, x, y, count, chars, &final_pos)) + return final_pos; + } + return miPolyText8(drawable, gc, x, y, count, chars); +} + +static int +uxa_poly_text16(DrawablePtr drawable, GCPtr gc, + int x, int y, int count, unsigned short *chars) +{ + ScreenPtr screen = drawable->pScreen; + uxa_screen_t *uxa_screen = uxa_get_screen(screen); + + if (uxa_screen->info->flags & UXA_USE_GLAMOR) { + int final_pos; + + if (glamor_poly_text16_nf(drawable, gc, x, y, count, chars, &final_pos)) + return final_pos; + } + return miPolyText16(drawable, gc, x, y, count, chars); +} + +static void +uxa_image_text8(DrawablePtr drawable, GCPtr gc, + int x, int y, int count, char *chars) +{ + ScreenPtr screen = drawable->pScreen; + uxa_screen_t *uxa_screen = uxa_get_screen(screen); + + if (uxa_screen->info->flags & UXA_USE_GLAMOR) { + if (glamor_image_text8_nf(drawable, gc, x, y, count, chars)) + return; + } + miImageText8(drawable, gc, x, y, count, chars); +} + +static void +uxa_image_text16(DrawablePtr drawable, GCPtr gc, + int x, int y, int count, unsigned short *chars) +{ + ScreenPtr screen = drawable->pScreen; + uxa_screen_t *uxa_screen = uxa_get_screen(screen); + + if (uxa_screen->info->flags & UXA_USE_GLAMOR) { + if (glamor_image_text16_nf(drawable, gc, x, y, count, chars)) + return; + } + miImageText16(drawable, gc, x, y, count, chars); +} +#endif + const GCOps uxa_ops = { uxa_fill_spans, uxa_set_spans, @@ -1051,10 +1113,17 @@ const GCOps uxa_ops = { miFillPolygon, uxa_poly_fill_rect, miPolyFillArc, +#if HAS_GLAMOR_TEXT + uxa_poly_text8, + uxa_poly_text16, + uxa_image_text8, + uxa_image_text16, +#else miPolyText8, miPolyText16, miImageText8, miImageText16, +#endif uxa_image_glyph_blt, uxa_poly_glyph_blt, uxa_push_pixels, |