[dense] Add compilation fixes for meson

* builds/meson/parse_modules_cfg.py: Add dense module

* meson.build: Add SSE flags to ft2_defines, -lm to link_args

* src/dense/ftdense.c: Fixes for compilation errors
This commit is contained in:
Anurag Thakur 2023-06-05 23:32:04 +05:30
parent cf779f5fbf
commit 1bf65eff60
3 changed files with 11 additions and 3 deletions

View File

@ -87,6 +87,7 @@ def generate_ftmodule(lists):
names = {
"raster": ("ft_raster1",),
"smooth": ("ft_smooth",),
"dense": ("ft_dense",),
"svg": ("ft_svg",),
"sdf": ("ft_sdf", "ft_bitmap_sdf"),
}.get(module)

View File

@ -395,6 +395,13 @@ if use_unix_ftsystem_c
endif
if cc.get_id() == 'msvc'
ft2_defines += ['/arch:AVX']
else
ft2_defines += ['-msse4.1']
endif
ft2_lib = library('freetype',
sources: ft2_sources + [ftmodule_h],
c_args: ft2_defines,
@ -403,7 +410,7 @@ ft2_lib = library('freetype',
dependencies: ft2_deps,
install: true,
version: ft2_so_version,
link_args: common_ldflags,
link_args: common_ldflags + ['-lm'],
)

View File

@ -154,7 +154,7 @@ dense_render_line( dense_worker* worker, FT_Pos tox, FT_Pos toy )
{
int linestart = y * worker->m_w;
FT26D6 dy = min( (y + 1)<<6, to_y ) - max( y<<6, from_y );
FT26D6 dy = FT_MIN( (y + 1)<<6, to_y ) - FT_MAX( y<<6, from_y );
m_a[linestart + x0i] += dir*dy*(64 - x + x0floor);
m_a[linestart + ( x0i + 1 )] += dir*dy*(x-x0floor);
@ -457,7 +457,7 @@ __m128i offset = _mm_setzero_si128();
// shuffle
y = _mm_shuffle_epi8( y, mask );
_mm_store_ss( (float*)&dest[i], (__m128)y );
_mm_store_ss( (float*)&dest[i], _mm_castsi128_ps(y) );
// store the current prefix sum in offset
offset = _mm_castps_si128( _mm_shuffle_ps( _mm_castsi128_ps( x ),