Re: A simple GtkSpinner is very costly in CPU cycles



Well the Gtk main loop can not break out, it means you can not play
animation of the GtkSpinner as slow as you want. I'm sorry I had not used
the GtkSpinner before, then I just did a test on the widget, so I see we
only make it playing or stop animation by setting it's "active" property
TRUE or FALSE.


On Wed, Mar 21, 2018 at 2:50 PM, Kian Karas <kian karas dev gmail com>
wrote:

Hi Lucky

I don't understand what it is you suggest. Could you elaborate?

Regards

On Tue, Mar 20, 2018 at 3:35 PM, Lucky B.C <lblackc13 gmail com> wrote:

Hi,
I am not sure about playing animation of the spinner to cause the high
cost. But you can try to have a callback from the g_timeout_add function
for starting (gtk_spinner_start) and stopping (gtk_spinner_stop) the
animation.

On Tue, Mar 20, 2018, 21:07 Kian Karas <kian karas dev gmail com> wrote:

Hi smart people

I just introduced animation, in the form of a GtkSpinner, to my
application
for the first time. When the spinner is animating, the application takes
up
45 % of the CPU resources (the application is otherwise idle at 0-2,6 %).
The CPU is a single core ARM Cortex-A7 running at 528 MHz (maximum).

This seems like a lot of MIPS for rotating an image of approximately
20x20
px.

Could it be caused by a simple misconfiguration?

Any suggestions on how I can reduce the load without disabling animation
completely?

Is it possible to slow down the frame rate of animations some how?

Thanks!
Kian
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list





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