diff options
author | Chia-I Wu <[email protected]> | 2010-12-01 02:30:59 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2010-12-01 11:31:00 +0800 |
commit | b06de80843e7d096bed4ae03ddc5e2842f1876af (patch) | |
tree | 37fd7f50f92ed6822282a64a9b47c32648120667 /src/gallium/state_trackers/vega/image.c | |
parent | ca8bc9c05b2126e949425dc967923c27f62ef378 (diff) |
st/vega: Fix paint coordinates transformations.
Depending on whether vgDrawPath(mode), vgDrawImage, or vgDrawGlyph[s] is
called, different paint-to-user and user-to-surface matrices should be
used to derive the sample points for the paint.
This fixes "paint" demo.
Diffstat (limited to 'src/gallium/state_trackers/vega/image.c')
-rw-r--r-- | src/gallium/state_trackers/vega/image.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/vega/image.c b/src/gallium/state_trackers/vega/image.c index b1bda3ff54b..fc87536883a 100644 --- a/src/gallium/state_trackers/vega/image.c +++ b/src/gallium/state_trackers/vega/image.c @@ -523,11 +523,18 @@ void image_copy(struct vg_image *dst, VGint dx, VGint dy, void image_draw(struct vg_image *img, struct matrix *matrix) { struct vg_context *ctx = vg_current_context(); + struct matrix paint_matrix; VGfloat x1, y1; VGfloat x2, y2; VGfloat x3, y3; VGfloat x4, y4; + if (vg_get_paint_matrix(ctx, + &ctx->state.vg.fill_paint_to_user_matrix, + matrix, + &paint_matrix)) + return; + x1 = 0; y1 = 0; x2 = img->width; @@ -544,6 +551,7 @@ void image_draw(struct vg_image *img, struct matrix *matrix) shader_set_drawing_image(ctx->shader, VG_TRUE); shader_set_paint(ctx->shader, ctx->state.vg.fill_paint); + shader_set_paint_matrix(ctx->shader, &paint_matrix); shader_set_image(ctx->shader, img); shader_bind(ctx->shader); |