From 26a83bef7b98899913b19ddb7efadaa1f435b25f Mon Sep 17 00:00:00 2001 From: Thong Thai Date: Tue, 15 Sep 2020 18:55:45 -0400 Subject: [PATCH] gallium/auxiliary/vl: Include src region in scale_y calculation Signed-off-by: Thong Thai Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3521 Reviewed-by: Leo Liu Part-of: --- src/gallium/auxiliary/vl/vl_compositor_cs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gallium/auxiliary/vl/vl_compositor_cs.c b/src/gallium/auxiliary/vl/vl_compositor_cs.c index 0706cc8..029449f 100644 --- a/src/gallium/auxiliary/vl/vl_compositor_cs.c +++ b/src/gallium/auxiliary/vl/vl_compositor_cs.c @@ -711,10 +711,12 @@ draw_layers(struct vl_compositor *c, drawn.area = calc_drawn_area(s, layer); drawn.scale_x = layer->viewport.scale[0] / - (float)layer->sampler_views[0]->texture->width0; + (float)layer->sampler_views[0]->texture->width0 * + (layer->src.br.x - layer->src.tl.x); drawn.scale_y = layer->viewport.scale[1] / ((float)layer->sampler_views[0]->texture->height0 * - (s->interlaced ? 2.0 : 1.0)); + (s->interlaced ? 2.0 : 1.0) * + (layer->src.br.y - layer->src.tl.y)); drawn.translate_x = (int)layer->viewport.translate[0]; drawn.translate_y = (int)layer->viewport.translate[1]; -- 2.7.4