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 <sjg@chromium.org> [agust: rebased] Signed-off-by: Anatolij Gustschin <agust@denx.de>
This commit is contained in:
committed by
Anatolij Gustschin
parent
6e42e25196
commit
f266178698
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user