summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/vl/vl_compositor.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/gallium/auxiliary/vl/vl_compositor.c b/src/gallium/auxiliary/vl/vl_compositor.c
index cc257e5614f..74512c1d40a 100644
--- a/src/gallium/auxiliary/vl/vl_compositor.c
+++ b/src/gallium/auxiliary/vl/vl_compositor.c
@@ -378,16 +378,16 @@ default_rect(struct vl_compositor_layer *layer)
}
static inline struct vertex2f
-calc_topleft(struct vertex2f inv_size, struct pipe_video_rect rect)
+calc_topleft(struct vertex2f size, struct pipe_video_rect rect)
{
- struct vertex2f res = { rect.x * inv_size.x, rect.y * inv_size.y };
+ struct vertex2f res = { rect.x / size.x, rect.y / size.y };
return res;
}
static inline struct vertex2f
-calc_bottomright(struct vertex2f inv_size, struct pipe_video_rect rect)
+calc_bottomright(struct vertex2f size, struct pipe_video_rect rect)
{
- struct vertex2f res = { (rect.x + rect.w) * inv_size.x, (rect.y + rect.h) * inv_size.y };
+ struct vertex2f res = { (rect.x + rect.w) / size.x, (rect.y + rect.h) / size.y };
return res;
}
@@ -395,12 +395,12 @@ static inline void
calc_src_and_dst(struct vl_compositor_layer *layer, unsigned width, unsigned height,
struct pipe_video_rect src, struct pipe_video_rect dst)
{
- struct vertex2f inv_size = { 1.0f / width, 1.0f / height };
+ struct vertex2f size = { width, height };
- layer->src.tl = calc_topleft(inv_size, src);
- layer->src.br = calc_bottomright(inv_size, src);
- layer->dst.tl = calc_topleft(inv_size, dst);
- layer->dst.br = calc_bottomright(inv_size, dst);
+ layer->src.tl = calc_topleft(size, src);
+ layer->src.br = calc_bottomright(size, src);
+ layer->dst.tl = calc_topleft(size, dst);
+ layer->dst.br = calc_bottomright(size, dst);
}
static void