I get good framerates I am just trying to speed up my program start time instead of parsing a interface configuration file and then create the data structure based on the file.<br><br>
<div class="gmail_quote">On Thu, Sep 16, 2010 at 3:44 AM, Maarten Bosmans <span dir="ltr"><<a href="mailto:mkbosmans@gmail.com">mkbosmans@gmail.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">2010/9/15 Talguy <<a href="mailto:talguy385@gmail.com">talguy385@gmail.com</a>>:<br>
<div>
<div></div>
<div class="h5">> I have a interface data structure consisting of a list of objects of the<br>> graphical elements that I manipulate on the screen. The objects are gauges<br>> that update with new data 30 times a second. To help speedup startup time<br>
> of the program I would like to be able to serialize this data structure and<br>> store it on the disk and then read it back in to the last state of the<br>> interface. My question is how would I serialize the image surfaces,<br>
> transformation matrics and other cairomm classes that I use in my program.<br><br></div></div>How long does the drawing of all the gauges take, have you measured<br>it? I'd imagine that it takes too long to get to a decent framerate,<br>
so you'll probably need some caching at runtime. But the one time<br>effort of drawing your background to an imagesurface is likely not to<br>delay your startup significantly. So I'd advise you to measure before<br>
you optimize!<br><br>But to answer your question: image surfaces can be serialized to png<br>files or to raw bit data, but in the last case you'll have to store<br>the width, height, surface format and possibly stride too. The<br>
transformation matrix and other cairo_t state you'd be best to just<br>set them again at program startup, using the standard cairo functions.<br><font color="#888888"><br>Maarten<br></font></blockquote></div><br>