diff options
author | Igor Oliveira <igor.oliveira@openbossa.org> | 2010-08-01 06:52:23 -0400 |
---|---|---|
committer | Igor Oliveira <igor.oliveira@openbossa.org> | 2010-08-01 06:52:23 -0400 |
commit | aae9df6b44a93b707f1720489e8c73cd2810815a (patch) | |
tree | c2994c298f0e53026f4db869a9158fcac90e22c6 | |
parent | 67262f2f88a96cf9d063a27bc6314b218f24c02c (diff) |
DRM/Gallium3D: initial support to fonts
-rw-r--r-- | src/drm/cairo-drm-gallium-surface.c | 58 |
1 files changed, 35 insertions, 23 deletions
diff --git a/src/drm/cairo-drm-gallium-surface.c b/src/drm/cairo-drm-gallium-surface.c index a67edd38..b060ea6e 100644 --- a/src/drm/cairo-drm-gallium-surface.c +++ b/src/drm/cairo-drm-gallium-surface.c @@ -795,6 +795,8 @@ _gallium_init_stroke() stroker->minx = stroker->miny = stroker->maxx = stroker->maxy = 0; + stroker->current_path = NULL; + return stroker; } @@ -918,12 +920,11 @@ _gallium_move_to (void *closure, const cairo_point_t *point) { gallium_stroke_t *stroke = closure; - const double x = _cairo_fixed_to_double(point->x); - const double y = _cairo_fixed_to_double(point->y); + double x = _cairo_fixed_to_double(point->x); + double y = _cairo_fixed_to_double(point->y); //if (path->ctm_inverse) // cairo_matrix_transform_point (path->ctm_inverse, point->x, point->y); - cairo_matrix_transform_point (stroke->gallium_ctm, &x, &y); stroke->current_path = _gallium_init_path(); @@ -946,8 +947,8 @@ _gallium_line_to (void *closure, const cairo_point_t *point) { gallium_stroke_t *stroker = closure; - const double x = _cairo_fixed_to_double(point->x); - const double y = _cairo_fixed_to_double(point->y); + double x = _cairo_fixed_to_double(point->x); + double y = _cairo_fixed_to_double(point->y); //if (path->ctm_inverse) // cairo_matrix_transform_point (path->ctm_inverse, point->x, point->y); @@ -1004,7 +1005,7 @@ _gallium_curve_to (void *closure, */ _cairo_spline_init(spline, _gallium_line_to, - path, + stroker, &initial_point, p0, p1, p2); return _cairo_spline_decompose(spline, 0.25); } @@ -1471,30 +1472,41 @@ gallium_surface_fill (void *abstract_surface, static cairo_int_status_t gallium_surface_glyphs (void *abstract_surface, - cairo_operator_t op, - const cairo_pattern_t *source, - cairo_glyph_t *glyphs, - int num_glyphs, - cairo_scaled_font_t *scaled_font, - cairo_clip_t *clip, - int *num_remaining) + cairo_operator_t op, + const cairo_pattern_t *source, + cairo_glyph_t *glyphs, + int num_glyphs, + cairo_scaled_font_t *scaled_font, + cairo_clip_t *clip, + int *num_remaining) { gallium_surface_t *surface = abstract_surface; + cairo_status_t status = CAIRO_INT_STATUS_UNSUPPORTED; *num_remaining = 0; - if (surface->fallback == NULL) { - /* XXX insert magic */ - surface->fallback = gallium_surface_map_to_image (surface); + if (status == CAIRO_INT_STATUS_UNSUPPORTED) { + cairo_path_fixed_t path; + + _cairo_path_fixed_init(&path); + status = _cairo_scaled_font_glyph_path (scaled_font, + glyphs, num_glyphs, + &path); + + if (unlikely (status)) { + _cairo_path_fixed_fini (&path); + return status; + } + + printf("\n\n\n\n"); + status = gallium_surface_fill (abstract_surface, op, source, + &path, CAIRO_FILL_RULE_WINDING, + 0.25, CAIRO_ANTIALIAS_SUBPIXEL, + clip); + } - return _cairo_surface_show_text_glyphs (surface->fallback, - op, source, - NULL, 0, - glyphs, num_glyphs, - NULL, 0, 0, - scaled_font, - clip); + return status; } static const cairo_surface_backend_t gallium_surface_backend = { |