From f266178698307608ee23741e69b9626196e66481 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 14 Jan 2016 18:10:37 -0700 Subject: video: Use fractional units for X coordinates With anti-aliased fonts we need a more fine-grained horizontal position than a single pixel. Characters can be positioned to start part-way through a pixel, with anti-aliasing (greyscale edges) taking care of the visual effect. To cope with this, use fractional units (1/256 pixel) for horizontal positions in the text console. Signed-off-by: Simon Glass [agust: rebased] Signed-off-by: Anatolij Gustschin --- test/dm/video.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/dm/video.c') diff --git a/test/dm/video.c b/test/dm/video.c index 9f5e7fc..be94633 100644 --- a/test/dm/video.c +++ b/test/dm/video.c @@ -106,14 +106,14 @@ static int dm_test_video_text(struct unit_test_state *uts) ut_asserteq(46, compress_frame_buffer(dev)); for (i = 0; i < 20; i++) - vidconsole_putc_xy(con, i * 8, 0, ' ' + i); + vidconsole_putc_xy(con, VID_TO_POS(i * 8), 0, ' ' + i); ut_asserteq(273, compress_frame_buffer(dev)); vidconsole_set_row(con, 0, WHITE); ut_asserteq(46, compress_frame_buffer(dev)); for (i = 0; i < 20; i++) - vidconsole_putc_xy(con, i * 8, 0, ' ' + i); + vidconsole_putc_xy(con, VID_TO_POS(i * 8), 0, ' ' + i); ut_asserteq(273, compress_frame_buffer(dev)); return 0; -- cgit v1.1