Skip to content
Snippets Groups Projects
Commit 329bd3c8 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont Committed by Jean-Baptiste Kempf
Browse files

vdpau/display: fix SPU blending offsets

parent 48e390e5
No related branches found
No related tags found
No related merge requests found
...@@ -94,8 +94,8 @@ static void RenderRegion(vout_display_t *vd, VdpOutputSurface target, ...@@ -94,8 +94,8 @@ static void RenderRegion(vout_display_t *vd, VdpOutputSurface target,
/* Create GPU surface for sub-picture */ /* Create GPU surface for sub-picture */
err = vdp_bitmap_surface_create(sys->vdp, sys->device, fmt, err = vdp_bitmap_surface_create(sys->vdp, sys->device, fmt,
reg->fmt.i_visible_width, reg->fmt.i_visible_height, VDP_FALSE, reg->fmt.i_width, reg->fmt.i_height,
&surface); VDP_FALSE, &surface);
if (err != VDP_STATUS_OK) if (err != VDP_STATUS_OK)
{ {
msg_Err(vd, "%s creation failure: %s", "bitmap surface", msg_Err(vd, "%s creation failure: %s", "bitmap surface",
...@@ -118,7 +118,7 @@ static void RenderRegion(vout_display_t *vd, VdpOutputSurface target, ...@@ -118,7 +118,7 @@ static void RenderRegion(vout_display_t *vd, VdpOutputSurface target,
} }
/* Render onto main surface */ /* Render onto main surface */
VdpRect area = { VdpRect dst_area = {
reg->i_x * sys->width reg->i_x * sys->width
/ subpic->i_original_picture_width, / subpic->i_original_picture_width,
reg->i_y * sys->height reg->i_y * sys->height
...@@ -128,6 +128,12 @@ static void RenderRegion(vout_display_t *vd, VdpOutputSurface target, ...@@ -128,6 +128,12 @@ static void RenderRegion(vout_display_t *vd, VdpOutputSurface target,
(reg->i_y + reg->fmt.i_visible_height) * sys->height (reg->i_y + reg->fmt.i_visible_height) * sys->height
/ subpic->i_original_picture_height, / subpic->i_original_picture_height,
}; };
VdpRect src_area = {
reg->fmt.i_x_offset,
reg->fmt.i_y_offset,
reg->fmt.i_x_offset + reg->fmt.i_visible_width,
reg->fmt.i_y_offset + reg->fmt.i_visible_height,
};
VdpColor color = { 1.f, 1.f, 1.f, VdpColor color = { 1.f, 1.f, 1.f,
reg->i_alpha * subpic->i_alpha / 65025.f }; reg->i_alpha * subpic->i_alpha / 65025.f };
VdpOutputSurfaceRenderBlendState state = { VdpOutputSurfaceRenderBlendState state = {
...@@ -145,8 +151,9 @@ static void RenderRegion(vout_display_t *vd, VdpOutputSurface target, ...@@ -145,8 +151,9 @@ static void RenderRegion(vout_display_t *vd, VdpOutputSurface target,
.blend_constant = { 0.f, 0.f, 0.f, 0.f }, .blend_constant = { 0.f, 0.f, 0.f, 0.f },
}; };
err = vdp_output_surface_render_bitmap_surface(sys->vdp, target, &area, err = vdp_output_surface_render_bitmap_surface(sys->vdp, target, &dst_area,
surface, NULL, &color, &state, 0); surface, &src_area, &color,
&state, 0);
if (err != VDP_STATUS_OK) if (err != VDP_STATUS_OK)
msg_Err(vd, "blending failure: %s", msg_Err(vd, "blending failure: %s",
vdp_get_error_string(sys->vdp, err)); vdp_get_error_string(sys->vdp, err));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment