mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-17 02:15:02 +00:00
video: Update stb_truetype
This was brought in in 2016 and a number of changes have been made since then. There does not seem to be much change in functionality, but it is a good idea to update from time to time. Bring in the latest version: 5736b15 ("re-add perlin noise again") Add a few necessary functions, with dummies in some cases. Update the tests as there are subtle changes in rendering, perhaps not for the better. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
87c1a4130c
commit
04f3dcd503
3 changed files with 2079 additions and 221 deletions
|
@ -62,10 +62,43 @@ static double tt_sqrt(double value)
|
|||
return lo;
|
||||
}
|
||||
|
||||
static double tt_fmod(double x, double y)
|
||||
{
|
||||
double rem;
|
||||
|
||||
if (y == 0.0)
|
||||
return 0.0;
|
||||
rem = x - (x / y) * y;
|
||||
|
||||
return rem;
|
||||
}
|
||||
|
||||
/* dummy implementation */
|
||||
static double tt_pow(double x, double y)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* dummy implementation */
|
||||
static double tt_cos(double val)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* dummy implementation */
|
||||
static double tt_acos(double val)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define STBTT_ifloor tt_floor
|
||||
#define STBTT_iceil tt_ceil
|
||||
#define STBTT_fabs tt_fabs
|
||||
#define STBTT_sqrt tt_sqrt
|
||||
#define STBTT_pow tt_pow
|
||||
#define STBTT_fmod tt_fmod
|
||||
#define STBTT_cos tt_cos
|
||||
#define STBTT_acos tt_acos
|
||||
#define STBTT_malloc(size, u) ((void)(u), malloc(size))
|
||||
#define STBTT_free(size, u) ((void)(u), free(size))
|
||||
#define STBTT_assert(x)
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -556,7 +556,7 @@ static int dm_test_video_truetype(struct unit_test_state *uts)
|
|||
ut_assertok(video_get_nologo(uts, &dev));
|
||||
ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
|
||||
vidconsole_put_string(con, test_string);
|
||||
ut_asserteq(12187, compress_frame_buffer(uts, dev));
|
||||
ut_asserteq(12174, compress_frame_buffer(uts, dev));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -577,7 +577,7 @@ static int dm_test_video_truetype_scroll(struct unit_test_state *uts)
|
|||
ut_assertok(video_get_nologo(uts, &dev));
|
||||
ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
|
||||
vidconsole_put_string(con, test_string);
|
||||
ut_asserteq(34481, compress_frame_buffer(uts, dev));
|
||||
ut_asserteq(34287, compress_frame_buffer(uts, dev));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -598,7 +598,7 @@ static int dm_test_video_truetype_bs(struct unit_test_state *uts)
|
|||
ut_assertok(video_get_nologo(uts, &dev));
|
||||
ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
|
||||
vidconsole_put_string(con, test_string);
|
||||
ut_asserteq(29579, compress_frame_buffer(uts, dev));
|
||||
ut_asserteq(29471, compress_frame_buffer(uts, dev));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue