diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-03-14 22:02:09 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-03-14 22:03:58 +0000 |
commit | 94cb10c3f2b9bbb6ae3c76faebe9fc88691224a9 (patch) | |
tree | b56ca1d35a2cb6b25ee355a6d367635a356e6869 /src/sna/gen5_render.c | |
parent | dad50881d545da665191c6681f2acd0ebc3ddbfc (diff) |
sna/gen5+: Add missing float casts in computation of scaled src offsets
Without the casts, the division ends up as 0 rather than the fractional
offset into the texture.
The casts were missed in the claimed fix:
commit 89038ddb96aabc4bc1f04402b2aca0ce546e8bf3
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Thu Feb 28 14:35:54 2013 +0000
sna/video: Correct scaling of source offsets
Reported-by: Roman Elshin <roman.elshin@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=62343
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/gen5_render.c')
-rw-r--r-- | src/sna/gen5_render.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c index 8c8a996f..8b50d22e 100644 --- a/src/sna/gen5_render.c +++ b/src/sna/gen5_render.c @@ -1363,10 +1363,10 @@ gen5_render_video(struct sna *sna, #endif src_scale_x = (float)src_width / dst_width / frame->width; - src_offset_x = frame->src.x1 / frame->width - dstRegion->extents.x1 * src_scale_x; + src_offset_x = (float)frame->src.x1 / frame->width - dstRegion->extents.x1 * src_scale_x; src_scale_y = (float)src_height / dst_height / frame->height; - src_offset_y = frame->src.y1 / frame->height - dstRegion->extents.y1 * src_scale_y; + src_offset_y = (float)frame->src.y1 / frame->height - dstRegion->extents.y1 * src_scale_y; box = REGION_RECTS(dstRegion); nbox = REGION_NUM_RECTS(dstRegion); |