summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2010-11-24 15:42:48 +0800
committerChia-I Wu <[email protected]>2010-12-01 11:23:51 +0800
commit165cb19abc4279839b0f5f53eb2feac60c2f415e (patch)
tree9b0b6e7a897d8194ccbff81b3941c0c547fe195d /src/gallium
parentd873f1f5b63e7243c20751e92389e4189d39fd42 (diff)
st/vega: Make path_render and path_stroke take a matrix.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/state_trackers/vega/api_path.c3
-rw-r--r--src/gallium/state_trackers/vega/mask.c4
-rw-r--r--src/gallium/state_trackers/vega/path.c9
-rw-r--r--src/gallium/state_trackers/vega/path.h4
4 files changed, 10 insertions, 10 deletions
diff --git a/src/gallium/state_trackers/vega/api_path.c b/src/gallium/state_trackers/vega/api_path.c
index f76adddb584..fe57b7671d9 100644
--- a/src/gallium/state_trackers/vega/api_path.c
+++ b/src/gallium/state_trackers/vega/api_path.c
@@ -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);
}
diff --git a/src/gallium/state_trackers/vega/mask.c b/src/gallium/state_trackers/vega/mask.c
index ce81280dd08..e8a017d9c43 100644
--- a/src/gallium/state_trackers/vega/mask.c
+++ b/src/gallium/state_trackers/vega/mask.c
@@ -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);
}
diff --git a/src/gallium/state_trackers/vega/path.c b/src/gallium/state_trackers/vega/path.c
index 31c718e1c99..62eb62418d3 100644
--- a/src/gallium/state_trackers/vega/path.c
+++ b/src/gallium/state_trackers/vega/path.c
@@ -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;
diff --git a/src/gallium/state_trackers/vega/path.h b/src/gallium/state_trackers/vega/path.h
index e34538b7368..772ab2a0a53 100644
--- a/src/gallium/state_trackers/vega/path.h
+++ b/src/gallium/state_trackers/vega/path.h
@@ -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);