Alexei Podtelezhnikov
c653b8d2f1
* src/smooth/ftgrays.c (FT_GRAY_SET): Adjust for better code.
4 years ago
Alexei Podtelezhnikov
8f43d324d1
[smooth] Faster bitmap sweeping.
...
Selecting the fill rule or checking the direct mode each time we call
`gray_hline' is sub-optimal. This effectively splits the direct mode
into a separate code path while inlining `gray_hline' and saving 5-7%
of rendering time.
* src/smooth/ftgrays.c (gray_hline): Eliminated in favor of...
(FT_FILL_RULE, FT_GRAY_SET): ... these new macros...
(gray_sweep): ... inlined here.
(gray_sweep_direct): New function that handles the direct span buffer.
(gray_TWorker): Remove the span buffer.
(gray_raster_render, gray_convert_glyph): Updated.
4 years ago
Alexei Podtelezhnikov
b070264521
* src/smooth/ftgrays.c (gray_hline): Simplify even-odd computations.
...
It is too bad the even-odd rule is not used much.
4 years ago
Alexei Podtelezhnikov
967a34eee3
[type1] Avoid MM memory zeroing.
...
* src/type1/t1load.c (t1_allocate_blend, parse_blend_design_map):
Tweak allocation macros.
* src/type1/t1objs.c (T1_Face_Done): Minor.
4 years ago
Alexei Podtelezhnikov
2f62d8e075
* src/bdf/bdflib.c (_bdf_list_ensure): Tweak allocation macro.
4 years ago
Alexei Podtelezhnikov
79ed536d01
* src/psaux/psobjs.c (ps_parser_load_field): Tweak allocation macro.
4 years ago
Alexei Podtelezhnikov
44c59414eb
* src/sfnt/sfobjs.c (sfnt_load_face): Tweak allocation macro.
4 years ago
Alexei Podtelezhnikov
998c7c0f1c
* src/cid/cidload.c (cid_read_subrs): Tweak allocation macro.
4 years ago
Alexei Podtelezhnikov
2d95784885
* src/base/ftrfork.c (FT_Raccess_Get_DataOffsets): Tweak allocation.
4 years ago
Alexei Podtelezhnikov
8150ed0db2
[cff,psaux] Avoid memory zeroing (contd.).
...
* src/cff/cffload.c (cff_blend_doBlend, cff_blend_build_vector): Tweak
allocation macros.
* src/psaux/psarrst.c (cf2_arrstack_setNumElements): Ditto.
* src/psaux/psstack.c (cf2_stack_init): Ditto.
4 years ago
Ben Wagner
82fd32d674
* src/cid/cidload.c (cid_hex_to_binary): Improve return value.
...
Add argument to return the actual number of bytes that were decoded.
The actual number of bytes decoded can be quite variable depending
on the number of ignored 'whitespace' bytes or early termination
with `>`.
(cid_face_open): Updated to use this calculated value. This avoids
trusting `parser->binary_length` is always be correct and reading
uninitialized bits if fewer are actually decoded.
First reported as
https://crbug.com/1203240
4 years ago
Alexei Podtelezhnikov
66630d882c
[sfnt] Streamline POST format 2.0 handing.
...
To reduce memory allocations, we read an entire Pascal-string buffer
and convert it to a C-string buffer. We also reject tables with
Postscript glyph names exceeding 63 bytes.
* src/sfnt/ttpost.c (load_format20): Implement it.
(load_post_names): Check the minimal POST table size.
(load_format25, tt_face_free_ps_names): Updated accordingly.
4 years ago
Alexei Podtelezhnikov
ec95f9c921
[bdf,pcf] Avoid memory zeroing (contd.).
...
* src/bdf/bdflib.c (bdf_create_property, _bdf_add_comment,
_bdf_add_property, bdf_load_font): Tweak allocation macros.
* src/pcf/pcfread.c (pcf_get_properties, pcf_get_metrics): Ditto.
4 years ago
Alexei Podtelezhnikov
d911cb5392
* src/cid/cidload.c (cid_read_subrs): Tweak allocaton macro.
4 years ago
Alexei Podtelezhnikov
dc42f826af
[sfnt] Avoid some memory zeroing.
...
* src/sfnt/sfobjs.c (sfnt_open_font, sfnt_init_face,
tt_name_ascii_from_{utf16,other}): Tweak allocaton macros.
* src/sfnt/ttload.c (tt_face_load_name): Ditto.
4 years ago
Alexei Podtelezhnikov
b8968d666e
* src/sfnt/ttpost.c (load_format_{20,25}): Tweak allocaton macros.
4 years ago
Alexei Podtelezhnikov
2583b6085e
* src/sfnt/pngshim.c (Load_SBit_Png): Tweak allocaton macro.
4 years ago
Alexei Podtelezhnikov
56ae943050
[truetype] Avoid some memory zeroing.
...
* src/truetype/ttinterp.c (Init_Context): Tweak allocation macro.
* src/truetype/ttpload.c (tt_face_load_cvt): Ditto.
4 years ago
Alexei Podtelezhnikov
c177cc354d
[woff2] Avoid some memory zeroing.
...
* src/sfnt/sfwoff2.c (store_loca, woff2_open_font): Tweak macros.
4 years ago
Alexei Podtelezhnikov
4e1c6a12e5
* src/gzip/ftgzip.c (ft_gzip_alloc): Zero out memory again.
4 years ago
Alexei Podtelezhnikov
f631542dae
[lzw] Preserve decompression stack when relocating to heap.
...
* src/lzw/ftzopen.c (ft_lzwstate_stack_grow): Copy stack when
relocating to heap.
4 years ago
Alexei Podtelezhnikov
c213c8a9bb
* src/cid/cidgload.c (cid_load_glyph): Restore the glyph_length check.
4 years ago
Werner Lemberg
2ec6feaf39
* src/psmodule.c (ps_unicodes_init): Ignore empty glyph names.
...
Reported as
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=33637
4 years ago
Alexei Podtelezhnikov
caff87b1f9
* src/sfnt/sfobjs.c (sfnt_init_face): Revert macro change.
4 years ago
Alexei Podtelezhnikov
8750e843df
[cff] Avoid some memory zeroing.
...
* src/cff/cffparse.c (cff_parser_init): Tweak memory macro.
* src/cff/cffload.c (cff_index_load_offsets, cff_index_get_pointers,
cff_charset_load, cff_vstore_load): Ditto.
4 years ago
Alexei Podtelezhnikov
618d0834c7
[pfr] Avoid some memory zeroing.
...
* src/pfr/pfrobjs.c (pfr_face_init) : Tweak memory macro.
* src/pfr/pfrload.c (pfr_extra_item_load_stem_snaps,
pfr_phy_font_load): Ditto.
4 years ago
Alexei Podtelezhnikov
b0a281974d
* src/winfonts/winfnt.c (FNT_Face_Init): Tweak memory macro.
4 years ago
Alexei Podtelezhnikov
deee5b7017
[psaux,psnames] Avoid some memory zeroing.
...
* src/psaux/psstack.c (cf2_stack_init): Tweak memory macro.
* src/psnames/psmodule.c (ps_unicodes_init): Ditto.
4 years ago
Alexei Podtelezhnikov
270ff52f62
[base] Avoid some memory zeroing.
...
* src/base/ftrfork.c (FT_Raccess_Get_DataOffsets): Use FT_QNEW_ARRAY.
* src/base/ftsnames.c (FT_Get_Sfnt_{Name,LangTag}): Ditto.
4 years ago
Alexei Podtelezhnikov
c2d283143a
[bdf,pcf] Avoid some memory zeroing.
...
* src/pcf/pcfread.c (pcf_read_TOC, pcf_get_properties, pcf_load_font):
Tweak memory macros.
* src/bdf/bdfdrivr.c (BDF_Face_Init): Ditto.
* src/bdf/bdflib.c (_bdf_readstreami, bdf_create_property,
_bdf_parse_glyphs, _bdf_parse_start): Ditto.
(_bdf_add_property): Do not handle zero size.
4 years ago
Issam E. Maghni
f998eaf972
* builds/meson/process_ftoption_h.py: Add LF at EOF.
...
This fixes
.../ftoption.h:1030:10: error:
no newline at end of file [-Werror,-Wnewline-eof]
for the generated `ftoption.h` file.
4 years ago
Alexei Podtelezhnikov
c78f78fab4
* src/cff/cffload.c (cff_index_get_pointers): s/FT_QALLOC/FT_ALLOC/.
4 years ago
Alexei Podtelezhnikov
0bd5d95d66
* src/base/ftobjs.c (Mac_Read_POST_Resource): s/FT_ALLOC/FT_QALLOC/.
...
* builds/mac/ftmac.c (FT_New_Face_From_SFNT, read_lwfn): Ditto.
4 years ago
Alexei Podtelezhnikov
e6e5b67db3
* src/sdf/ftsdf.c (sdf_{edge,contour,shape}_new): Use FT_QALLOC.
4 years ago
Alexei Podtelezhnikov
6ada59ab7c
[sfnt] s/FT_ALLOC/FT_QALLOC/ for initialized buffers.
...
* src/sfnt/sfdriver.c (get_win_string, get_apple_string,
sfnt_get_var_ps_name): Do not zero out the buffer.
* src/sfnt/sfobjs.c (sfnt_init_face): Ditto.
* src/sfnt/sfwoff.c (woff_open_font): Ditto.
* src/sfnt/sfwoff2.c (woff2_open_font): Ditto.
4 years ago
Alexei Podtelezhnikov
ec9e5114b1
[cff,type1,type42] s/FT_ALLOC/FT_QALLOC/ for initialized buffers.
...
* src/cff/cffload.c (cff_index_get_pointers, cff_index_get_name):
Do not zero out the buffer.
* src/cff/cffdrivr.c (cff_ps_get_font_info): Ditto.
* src/type1/t1load.c (parse_subrs, parse_charstrings,
parse_blend_axis_types): Ditto.
* src/type1/t1parse.c (T1_New_Parser, T1_Get_Private_Dict): Ditto.
* src/type42/t42parse.c (t42_parser_init): Ditto.
4 years ago
Alexei Podtelezhnikov
baa0f71ddf
[cid] s/FT_ALLOC/FT_QALLOC/ and clean up.
...
* src/cid/cidgload.c (cid_load_glyph): Do not zero out the buffer.
* src/cid/cidload.c (cid_face_open, cid_read_subrs): Ditto.
4 years ago
Alexei Podtelezhnikov
b3438ccb31
[pfr] s/FT_ALLOC/FT_QALLOC/ for initialized buffers.
...
* src/pfr/pfrload.c (pfr_extra_item_load_font_id, pfr_aux_name_load):
Do not zero out the buffer.
4 years ago
Alexei Podtelezhnikov
1e525c62ae
[bzip2,gzip] s/FT_ALLOC/FT_QALLOC/ for initialized buffers.
...
* src/bzip2/ftbzip2.c (ft_bzip2_alloc): Do not zero out the buffer.
* src/gzip/ftgzip.c (ft_gzip_alloc, FT_Stream_OpenGzip): Ditto.
4 years ago
Alexei Podtelezhnikov
a0fb6dbcd9
[pcf,bdf,winfonts] s/FT_ALLOC/FT_QALLOC/ for initialized buffers.
...
* src/pcf/pcfread.c (pcf_interpret_style): Do not zero out the buffer.
* src/bdf/bdfdrivr.c (bdf_interpret_style): Ditto.
* src/winfonts/winfnt.c (FNT_Face_Init, FNT_Load_Glyph): Ditto.
4 years ago
Alexei Podtelezhnikov
23f85c8a98
[cache] Optimize SBit copying.
...
* src/cache/ftcsbits.c (ftc_snode_load): Do not initialize the buffer.
(ftc_sbit_copy_bitmap): Accept zero size, s/FT_ALLOC/FT_QALLOC/.
4 years ago
Alexei Podtelezhnikov
93715ab2c4
[gxvalid,otvalid] s/FT_ALLOC/FT_QALLOC/ for initialized buffers.
...
* src/gxvalid/gxvmod.c (gxv_load_table): Do not zero out the buffer.
* src/otvalid/otvmod.c (otv_load_table): Ditto.
4 years ago
Alexei Podtelezhnikov
90b97a833d
[psaux] s/FT_ALLOC/FT_QALLOC/ for initialized buffers.
...
* src/psaux/psobjs.c (ps_table_done, ps_parser_load_field): Do not
zero out the buffer.
4 years ago
Alexei Podtelezhnikov
44b1ebe514
[base] s/FT_ALLOC/FT_QALLOC/ for initialized buffers.
...
* src/base/ftobjs.c (open_face_PS_from_sfnt_stream,
Mac_Read_sfnt_Resource): Do not zero out the buffer.
* src/base/ftmac.c (FT_New_Face_From_SFNT, read_lwfn): Ditto.
* src/base/ftrfork.c (raccess_make_file_name,
raccess_guess_darwin_hfsplus, raccess_guess_darwin_newvfs): Ditto.
4 years ago
Alexei Podtelezhnikov
8a459e5172
[cache] Restore SBit copying for unowned (BDF) bitmaps.
...
* src/cache/ftcsbits.c (ftc_sbit_copy_bitmap): Restore.
(ftc_snode_load): Check ownership and copy unowned bitmaps.
4 years ago
Alexei Podtelezhnikov
361465dec9
Bitmap tracing.
4 years ago
Dominik Röttsches
e662a9500f
[sfnt] Return in 'COLR' v1 when layer pointer outside table
...
* src/sfnt/ttcolr.c (tt_face_get_paint_layers): Add missing return
when paint pointer outside table.
(read_paint): Add missing return when paint pointer outside table.
4 years ago
Alexei Podtelezhnikov
7c685cb3f6
[cache] Switch to lazy SBit setting.
...
* src/cache/ftcsbits.c (ftc_sbit_copy_bitmap): Removed.
(ftc_snode_load): Take the bitmap ownership instead of copying.
4 years ago
Alexei Podtelezhnikov
02dec61731
Typo.
4 years ago
Daniel Welty
2e68785e08
* src/cache/ftcsbits.c (ftc_snode_load): Properly handle short pitch.
4 years ago