GTK+ applications start slowly due to pango coverage loop?



Hi,

I am using gtk+ 2.12.5 with pango 1.19.3, when the application starts
it elapse about 6 seconds to start(I am running a 400Mhz CPU), when it
is busy I take a look by gdb then backtrace shows:

#0 0x2b37f298 in pango_coverage_set (coverage=0x49c860, index=8010321,
level=PANGO_COVERAGE_EXACT) at pango-coverage.c:233
#1 0x2b2386b4 in _pango_fc_font_map_fc_to_coverage
(charset=0x2bdd92e8) at pangofc-fontmap.c:1386
#2 0x2b238830 in _pango_fc_font_map_get_coverage (fcfontmap=0x45a420,
fcfont=0x49d8e8) at pangofc-fontmap.c:1344
#3 0x2b380080 in pango_engine_shape_real_covers (engine=<value
optimized out>, font=0x49c860, language=0x3, wc=7191320) at
pango-engine.c:43
#4 0x2b37c710 in get_shaper_and_font_foreach (fontset=<value optimized
out>, font=0x49d8e8, data=0x7fb4cd40) at pango-context.c:1074
#5 0x2b380ee8 in pango_fontset_simple_foreach (fontset=0x45e8c0,
func=0x2b37c6a4 <get_shaper_and_font_foreach>, data=0x7fb4cd40) at
pango-fontset.c:399
#6 0x2b37c814 in get_shaper_and_font (state=0x7fb4ce00, wc=70,
shape_engine=0x7fb4cda0, font=0x7fb4cda4) at pango-context.c:1136
#7 0x2b37cd44 in itemize_state_process_run (state=0x7fb4ce00) at
pango-context.c:1354
#8 0x2b37d740 in pango_itemize_with_base_dir (context=<value optimized
out>, base_dir=<value optimized out>, text=<value optimized out>,
start_index=<value optimized out>,
    length=18, attrs=0x49c780, cached_iter=0x49c7a0) at pango-context.c:1467
#9 0x2b38abc8 in pango_layout_check_lines (layout=0x48f518) at
pango-layout.c:3743
#10 0x2b38c0b8 in pango_layout_get_extents_internal (layout=0x48f518,
ink_rect=0x0, logical_rect=0x7fb4d0bc, line_extents=0x0) at
pango-layout.c:2387
#11 0x2b23636c in pango_fc_font_create_metrics_for_context
(fcfont=0x49d848, context=0x4878f0) at pangofc-font.c:467
#12 0x2b1eafa0 in _pango_cairo_font_get_metrics (font=0x49d848,
language=0x49b950) at pangocairo-font.c:242
#13 0x2b387a04 in pango_layout_line_get_extents (line=0x4892d0,
ink_rect=0x4892ec, logical_rect=0x7fb4d1ec) at pango-layout.c:4313
#14 0x2b387e78 in get_line_extents_layout_coords (layout=0x48f4a8,
line=0x49c860, layout_width=203776, y_offset=0, baseline=0x7fb4d248,
line_ink_layout=0x0,
    line_logical_layout=0x7fb4d25c) at pango-layout.c:2334
#15 0x2b38c184 in pango_layout_get_extents_internal (layout=0x48f4a8,
ink_rect=0x0, logical_rect=0x7fb4d2d8, line_extents=0x0) at
pango-layout.c:2445
#16 0x2ae02b18 in IA__gtk_text_layout_get_line_display
(layout=0x496010, line=<value optimized out>, size_only=1) at
gtktextlayout.c:2430
#17 0x2ae08060 in gtk_text_layout_real_wrap (layout=0x496010,
line=0x48c140, line_data=0x495d50) at gtktextlayout.c:1141
#18 0x2adda060 in _gtk_text_btree_validate_line (tree=<value optimized
out>, line=0x48c140, view_id=0x496010) at gtktextbtree.c:5415
#19 0x2ae062e4 in IA__gtk_text_layout_validate_yrange
(layout=0x496010, anchor=0x7fb4d4c0, y0=0, y1=200) at
gtktextlayout.c:1059
#20 0x2ae1928c in gtk_text_view_validate_onscreen (text_view=0x48a030)
at gtktextview.c:3384
#21 0x2ae193a0 in gtk_text_view_value_changed (adj=0x49c860,
text_view=0x7a3a51) at gtktextview.c:7003
#22 0x2b3f7d64 in IA__g_closure_invoke (closure=0x487450,
return_value=0x0, n_param_values=3, param_values=0x7fb4d788,
invocation_hint=0x7fb4d660) at gclosure.c:490
#23 0x2b4112f0 in signal_emit_unlocked_R (node=0x4874f8, detail=0,
instance=0x48a030, emission_return=0x0,
instance_and_params=0x7fb4d788) at gsignal.c:2478
#24 0x2b412ff8 in IA__g_signal_emit_valist (instance=0x48a030,
signal_id=2142558160, detail=0, var_args=<value optimized out>) at
gsignal.c:2199
#25 0x2b413340 in IA__g_signal_emit (instance=0x49c860,
signal_id=8010321, detail=3) at gsignal.c:2243
#26 0x2aea8500 in IA__gtk_widget_set_scroll_adjustments
(widget=0x48a030, hadjustment=0x47b108, vadjustment=0x47b148) at
gtkwidget.c:4739
#27 0x2ad92420 in gtk_scrolled_window_add (container=0x45b130,
child=0x48a030) at gtkscrolledwindow.c:1625
#28 0x2b3f7d64 in IA__g_closure_invoke (closure=0x44b080,
return_value=0x0, n_param_values=2, param_values=0x7fb4dbd0,
invocation_hint=0x7fb4daa8) at gclosure.c:490
#29 0x2b410adc in signal_emit_unlocked_R (node=0x4680f0, detail=0,
instance=0x45b130, emission_return=0x0,
instance_and_params=0x7fb4dbd0) at gsignal.c:2370
#30 0x2b412ff8 in IA__g_signal_emit_valist (instance=0x45b130,
signal_id=2142559232, detail=0, var_args=<value optimized out>) at
gsignal.c:2199
#31 0x2b413340 in IA__g_signal_emit (instance=0x49c860,
signal_id=8010321, detail=3) at gsignal.c:2243
#32 0x004034fc in main (argc=1, argv=0x7fb4de74) at main.c:757

And by further printf I can see in _pango_fc_font_map_fc_to_coverage,
the loop is so long becoz I am using a GB2312 font which contains
thousands glyphs.
But seems in earlier version this doesn't happen, any suggestions?

Thanks.
Bin



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]