After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 328189 - Deal with proper change notification for PangoContext
Deal with proper change notification for PangoContext
Status: RESOLVED DUPLICATE of bug 340066
Product: pango
Classification: Platform
Component: general
unspecified
Other All
: Normal enhancement
: Small feature
Assigned To: pango-maint
pango-maint
Depends on:
Blocks:
 
 
Reported: 2006-01-22 17:34 UTC by Behdad Esfahbod
Modified: 2006-05-19 18:04 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Behdad Esfahbod 2006-01-22 17:34:31 UTC
Cleaning up 5-years old pango/TODO.xml:

          <code>pango_layout_context_changed()</code> is a
          hack. Either the context should have change-notification, or else
          the layout should make a copy of the context when the context is
          set. Use signals for change-notification needs to wait
          on <code>GSignal</code> getting finished.

Not sure how hard it would be nowadays with the cairo backend.  For the least, it needs cairo to support change notification on cairo_t objects if I'm not mistaken.  Not sure if it's worth the change at all now that people are used to this function.
Comment 1 Owen Taylor 2006-01-22 17:54:40 UTC
Well, with the Cairo backend, you aren't going to get away from
having to call pango_cairo_update_context(), but it would still
be nice if that automatically propagated to layouts created for 
that context. I don't think people are used to 
pango_layout_context_changed(), they just don't change their
contexts very often :-)

This bug could actually be fixed without adding a signal to 
PangoContext by keeping a serial, and then pango_layout_check_lines()
could compare the context's serial with the last serial seen
by the layout.

You don't get the temporary memory saving of dumping the cached 
layouts, but you don't pay the overhead of signal connections in the common
case where the context doesn't change.
Comment 2 Owen Taylor 2006-01-22 17:58:19 UTC
(To expand a little on the memory issue, while the transition
is going on, you have:
 
 - All fonts used by all layouts which have been updated
 - All fonts used by all layouts which haven't yet been updated

if you have active notification then the second set will be empty
when the transition finishes, but with only passive noticing
of changes, then the second set could stay non-empty forever.
Still, I'm not sure this makes up for the signal costs and complexity)
Comment 3 Behdad Esfahbod 2006-01-22 18:27:23 UTC
Agreed.  But does it only affect pango_layout_check_lines()?
Comment 4 Owen Taylor 2006-01-22 19:06:40 UTC
All cached information in PangoLayout I'm aware of is within the
big blob of things eliminated by pango_layout_clear_lines() and
recomputed by pango_layout_check_lines(), but probably would be
good to audit to reconfirm.
Comment 5 Behdad Esfahbod 2006-05-19 18:04:23 UTC

*** This bug has been marked as a duplicate of 340066 ***