diff options
Diffstat (limited to 'src/gallium/state_trackers/vega/mask.c')
-rw-r--r-- | src/gallium/state_trackers/vega/mask.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/gallium/state_trackers/vega/mask.c b/src/gallium/state_trackers/vega/mask.c index 3b042cec0e4..e40df063470 100644 --- a/src/gallium/state_trackers/vega/mask.c +++ b/src/gallium/state_trackers/vega/mask.c @@ -399,16 +399,21 @@ void mask_copy(struct vg_mask_layer *layer, VGint dx, VGint dy, VGint width, VGint height) { - struct vg_context *ctx = vg_current_context(); - struct st_framebuffer *fb_buffers = ctx->draw_buffer; - - renderer_copy_texture(ctx->renderer, - layer->sampler_view, - sx, sy, - sx + width, sy + height, - fb_buffers->alpha_mask_view->texture, - dx, dy, - dx + width, dy + height); + struct vg_context *ctx = vg_current_context(); + struct pipe_sampler_view *src = ctx->draw_buffer->alpha_mask_view; + struct pipe_surface *surf; + + /* get the destination surface */ + surf = ctx->pipe->screen->get_tex_surface(ctx->pipe->screen, + layer->sampler_view->texture, 0, 0, 0, PIPE_BIND_RENDER_TARGET); + if (surf && renderer_copy_begin(ctx->renderer, surf, VG_FALSE, src)) { + renderer_copy(ctx->renderer, + dx, dy, width, height, + sx, sy, width, height); + renderer_copy_end(ctx->renderer); + } + + pipe_surface_reference(&surf, NULL); } static void mask_layer_render_to(struct vg_mask_layer *layer, |