st/vega: Make path_render and path_stroke take a matrix.

This commit is contained in:
Chia-I Wu
2010-11-24 15:42:48 +08:00
parent d873f1f5b6
commit 165cb19abc
4 changed files with 10 additions and 10 deletions
+2 -1
View File
@@ -479,6 +479,7 @@ void vegaDrawPath(VGPath path, VGbitfield paintModes)
if (path_is_empty((struct path*)path))
return;
path_render((struct path*)path, paintModes);
path_render((struct path*)path, paintModes,
&ctx->state.vg.path_user_to_surface_matrix);
}
+2 -2
View File
@@ -424,6 +424,7 @@ static void mask_layer_render_to(struct vg_mask_layer *layer,
struct vg_context *ctx = vg_current_context();
const VGfloat fill_color[4] = {1.f, 1.f, 1.f, 1.f};
struct pipe_screen *screen = ctx->pipe->screen;
struct matrix *mat = &ctx->state.vg.path_user_to_surface_matrix;
struct pipe_surface *surface;
surface = screen->get_tex_surface(screen, layer->sampler_view->texture, 0, 0, 0,
@@ -437,12 +438,11 @@ static void mask_layer_render_to(struct vg_mask_layer *layer,
setup_mask_framebuffer(surface, layer->width, layer->height);
if (paint_modes & VG_FILL_PATH) {
struct matrix *mat = &ctx->state.vg.path_user_to_surface_matrix;
path_fill(path, mat);
}
if (paint_modes & VG_STROKE_PATH){
path_stroke(path);
path_stroke(path, mat);
}
+4 -5
View File
@@ -1528,10 +1528,10 @@ struct path * path_create_stroke(struct path *p,
return stroker.base.path;
}
void path_render(struct path *p, VGbitfield paintModes)
void path_render(struct path *p, VGbitfield paintModes,
struct matrix *mat)
{
struct vg_context *ctx = vg_current_context();
struct matrix *mat = &ctx->state.vg.path_user_to_surface_matrix;
vg_validate_state(ctx);
@@ -1557,7 +1557,7 @@ void path_render(struct path *p, VGbitfield paintModes)
return;
shader_set_paint(ctx->shader, ctx->state.vg.stroke_paint);
shader_bind(ctx->shader);
path_stroke(p);
path_stroke(p, mat);
}
}
@@ -1575,10 +1575,9 @@ void path_fill(struct path *p, struct matrix *mat)
}
}
void path_stroke(struct path *p)
void path_stroke(struct path *p, struct matrix *mat)
{
struct vg_context *ctx = vg_current_context();
struct matrix *mat = &ctx->state.vg.path_user_to_surface_matrix;
VGFillRule old_fill = ctx->state.vg.fill_rule;
struct matrix identity;
struct path *stroke;
+2 -2
View File
@@ -104,9 +104,9 @@ VGboolean path_interpolate(struct path *dst,
VGfloat amount);
void path_clear(struct path *p, VGbitfield capabilities);
void path_render(struct path *p, VGbitfield paintModes);
void path_render(struct path *p, VGbitfield paintModes, struct matrix *mat);
void path_fill(struct path *p, struct matrix *mat);
void path_stroke(struct path *p);
void path_stroke(struct path *p, struct matrix *mat);
void path_move_to(struct path *p, float x, float y);
void path_line_to(struct path *p, float x, float y);