diff options
author | Jakob Bornecrantz <wallbraker@gmail.com> | 2010-08-25 03:33:59 +0100 |
---|---|---|
committer | Igor Oliveira <igor.oliveira@openbossa.org> | 2010-08-25 09:59:59 -0400 |
commit | 58c44e9e393fe8b437ac3210f35f510a533c7ead (patch) | |
tree | 2468ea1c52d42eeec63839b35cd7fdf76b9d830c | |
parent | b60db5448ebc192a755cccfe8b1a957e9d004eb3 (diff) |
DRM/Gallium3D: Fix misc warnings
Including:
* Invalid function declrations.
* Unused variables.
* Passing the wrong argument to functions.
-rw-r--r-- | src/drm/cairo-drm-gallium-surface.c | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/src/drm/cairo-drm-gallium-surface.c b/src/drm/cairo-drm-gallium-surface.c index 387ea682..1ca141d0 100644 --- a/src/drm/cairo-drm-gallium-surface.c +++ b/src/drm/cairo-drm-gallium-surface.c @@ -261,6 +261,8 @@ gallium_surface_finish (void *abstract_surface) return _cairo_drm_surface_finish (&surface->drm); } +/* XXX not used */ +#if 0 static cairo_surface_t * gallium_surface_map_to_image (gallium_surface_t *surface) { @@ -300,6 +302,7 @@ gallium_surface_map_to_image (gallium_surface_t *surface) surface->drm.height, surface->map_transfer->stride); } +#endif static gallium_shader_t * shader_create(gallium_device_t *device) @@ -688,6 +691,8 @@ _gallium_blend_mode(gallium_surface_t *surface, case CAIRO_OPERATOR_ADD: case CAIRO_OPERATOR_SATURATE: break; + default: + assert(0); } } @@ -783,7 +788,7 @@ struct _gallium_stroke { }; static gallium_path_t * -_gallium_init_path () +_gallium_init_path (void) { gallium_path_t *path = NULL; path = (gallium_path_t *) malloc(sizeof(gallium_path_t)); @@ -816,7 +821,7 @@ _gallium_finish_path (gallium_path_t *path) } static gallium_stroke_t * -_gallium_init_stroke() +_gallium_init_stroke(void) { gallium_stroke_t *stroker = NULL; stroker = (gallium_stroke_t *) malloc(sizeof(gallium_stroke_t)); @@ -873,7 +878,6 @@ draw_path (gallium_surface_t *surface, struct pipe_context *ctx = device->pipe; struct pipe_vertex_buffer vbuffer; struct pipe_vertex_element velement; - struct pipe_rasterizer_state rasterizer; int vert_size = path->count * sizeof(float); int num_vert = path->count * 0.5; @@ -1016,6 +1020,7 @@ _gallium_curve_to (void *closure, gallium_stroke_t *stroker = closure; cairo_spline_t *spline = (cairo_spline_t *) malloc (sizeof(cairo_spline_t)); gallium_path_t *path = stroker->current_path; + cairo_status_t status; cairo_point_t initial_point; @@ -1034,10 +1039,13 @@ _gallium_curve_to (void *closure, cairo_matrix_transform_point (path->ctm_inverse, p2->x, p2->y); } */ - _cairo_spline_init(spline, - _gallium_line_to, - stroker, - &initial_point, p0, p1, p2); + status = _cairo_spline_init(spline, + _gallium_line_to, + stroker, + &initial_point, p0, p1, p2); + if (status != CAIRO_STATUS_SUCCESS) + return status; + return _cairo_spline_decompose(spline, 0.25); } @@ -1309,7 +1317,7 @@ _gallium_surface_clip (gallium_surface_t *abstract_surface, scissor.maxy = gallium_stroke->current_path->maxy; //_gallium_finish_path(gallium_path); - _gallium_draw_quad(device->pipe, scissor.minx, scissor.miny, scissor.maxx, scissor.maxy); + _gallium_draw_quad(surface, scissor.minx, scissor.miny, scissor.maxx, scissor.maxy); } return CAIRO_STATUS_SUCCESS; @@ -1389,8 +1397,6 @@ gallium_surface_stroke (void *abstract_surface, gallium_shader_t *shader = device->shader; cairo_status_t status; - const cairo_fill_rule_t rule = CAIRO_FILL_RULE_WINDING; - status = _gallium_surface_clip (surface, clip); if (unlikely (status)) return status; @@ -1401,13 +1407,13 @@ gallium_surface_stroke (void *abstract_surface, gallium_stroke = _gallium_init_stroke(); gallium_stroke->gallium_ctm = &surface->gallium_ctm; - _cairo_path_fixed_stroke_to_shaper(path, - style, ctm, ctm_inverse, - tolerance, - add_triangle, - add_triangle_fan, - add_convex_quad, - gallium_stroke); + status = _cairo_path_fixed_stroke_to_shaper(path, + style, ctm, ctm_inverse, + tolerance, + add_triangle, + add_triangle_fan, + add_convex_quad, + gallium_stroke); _gallium_blend_mode(surface, op); @@ -1474,9 +1480,6 @@ gallium_surface_glyphs (void *abstract_surface, cairo_clip_t *clip, int *num_remaining) { - gallium_surface_t *surface = abstract_surface; - gallium_device_t *device = gallium_device(surface); - gallium_shader_t *shader = device->shader; cairo_status_t status = CAIRO_INT_STATUS_UNSUPPORTED; *num_remaining = 0; |