Detect changes to a PangoLayout


In Clutter we currently use Pango to render the ClutterTexts. Every
time the ClutterText is painted we call pango_renderer_draw_layout
which creates some geometry to send to the GPU.

It would be nice if we could avoid rebuilding this geometry every
frame and keep it in a vertex buffer object instead. There is a patch
to do this here:

This works by attaching some data to the pango layout when it is first
painted using g_object_set_qdata. It works fine for ClutterTexts because
they abandon the layout and recreate it any time it needs to make some
changes. However we also expose an interface from Cogl for directly
rendering pango layouts. In that case it might not work correctly if
the developer renders the layout, makes some changes to it and then
renders it again later because the VBO will already have been created
and attached to the layout.

So my question is: is there any to detect when the PangoLayout has
been altered so we can recreate the VBO? PangoLayout doesn't seem to
have any properties or signals that I could attach to.

Thanks for your help.

- Neil

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