Re: writing a text widget with pango



Peter Zelezny <pzel dodo com au> writes: 
True, it keeps alot of GSList around etc. So I converted it to create a
Layout on-the-fly, but the results are a little sluggish. Is there any
room for improvement in pango's internal: pango_layout_check_lines()? It
seems to be spending most of its time here.

We did some profiling/optimization on that code, but there probably is
room for improvement. I doubt you'll get order-of-magnitude gains, as
there is inherently a lot of work being done, but you might speed it
up a good bit.
  
+  /* layouts with a width of -1 have no wraps; always 1 line */
+  if (layout->width == -1)
+    return 1;

Seems good, should go in bugzilla...
 
I'll probably delve into pango_layout_check_lines() next, and see what
can be done. Perhaps there should be a special version of
pango_layout_get_line_count that doesn't create the layout->lines list (for
when you're just measuring, but not going to render).

That'd be excellent.

Havoc



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