st/vega: Make path_render and path_stroke take a matrix.
authorChia-I Wu <olv@lunarg.com>
Wed, 24 Nov 2010 07:42:48 +0000 (15:42 +0800)
committerChia-I Wu <olv@lunarg.com>
Wed, 1 Dec 2010 03:23:51 +0000 (11:23 +0800)
src/gallium/state_trackers/vega/api_path.c
src/gallium/state_trackers/vega/mask.c
src/gallium/state_trackers/vega/path.c
src/gallium/state_trackers/vega/path.h

index f76adddb5840dd41072610d7ef5add372c61be4e..fe57b7671d95513b8a664ff24eb535abcefed068 100644 (file)
@@ -479,6 +479,7 @@ void vegaDrawPath(VGPath path, VGbitfield paintModes)
 
    if (path_is_empty((struct path*)path))
       return;
 
    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);
 }
 
 }
 
index ce81280dd089fe25dbd0a4ea866a093c95987c09..e8a017d9c43e80251ac55ebbd41c733bb11e0cda 100644 (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 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,
    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) {
    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_fill(path, mat);
    }
 
    if (paint_modes & VG_STROKE_PATH){
-      path_stroke(path);
+      path_stroke(path, mat);
    }
 
 
    }
 
 
index 31c718e1c99bcc671faa0ce6a2759e886d6764d3..62eb62418d388fe614b139f664d1eb3590da74d9 100644 (file)
@@ -1528,10 +1528,10 @@ struct path * path_create_stroke(struct path *p,
    return stroker.base.path;
 }
 
    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 vg_context *ctx = vg_current_context();
-   struct matrix *mat = &ctx->state.vg.path_user_to_surface_matrix;
 
    vg_validate_state(ctx);
 
 
    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);
          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 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;
    VGFillRule old_fill = ctx->state.vg.fill_rule;
    struct matrix identity;
    struct path *stroke;
index e34538b73681de2835e83ae7ef784dd8935a7653..772ab2a0a53adad48a12dc2228b9604f2cc4f5eb 100644 (file)
@@ -104,9 +104,9 @@ VGboolean path_interpolate(struct path *dst,
                            VGfloat amount);
 
 void path_clear(struct path *p, VGbitfield capabilities);
                            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_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);
 
 void path_move_to(struct path *p, float x, float y);
 void path_line_to(struct path *p, float x, float y);