GtkImage animation performance


When GtkImage needs to draw the next frame in animation it calls
gtk_widget_queue_draw() and does the actual drawing whenever.  Now with
slower hardware this simple queuing is causing quite a significant
performance hit.  Displaying a 24x24 10fps animation with GtkImage makes
some 20% CPU load; if you manually handle timeouts and gdk_draw_pixbuf()
the load is closer to 5% using the same animation.

I was wondering if there were some good reasons for animations to go
through the whole redraw queuing all the time?  Couldn't the next frame
be drawn directly instead?

When all you really need to update is the animation frame it would be
quite more efficient to simply draw the new frame directly.  And I think
the same would apply to progress bars as well.

Tommi Komulainen                            <tommi komulainen nokia com>

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