pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roger L. Whitcomb" <Roger.Whitc...@actian.com>
Subject RE: Slow fade sadness
Date Mon, 26 Aug 2013 21:58:49 GMT
Hi Erik,

                Interesting problem.  Couple of questions for you:

*         When you comment out the "Label.repaint()" where are you doing
that?  In your code or in FadeTransition.java in Pivot (presumably in
the "update()" method)?

*         Have you done any profiling to see where the CPU utilization
is happening?

*         What version of Pivot are you using?  The reason I ask is I
recall a 100% CPU repaint issue that should have been fixed for 2.0.3.,
but I don't remember where it occurred.

*         Just FYI a FadeTransition is just an animated FadeDecorator,
so analogously your custom decorator could probably be a custom
transition that uses your custom decorator (OnOffDecorator that has a
single boolean state), and then the transition just toggles the
decorator state in the "update" method...  Just thinking out loud...

 

~Roger

 

From: Erik Innocent [mailto:einnocent@gmail.com] 
Sent: Monday, August 26, 2013 2:42 PM
To: user
Subject: Slow fade sadness

 

Hi, all! I've got a new and fun problem to discuss with you. So, I'm
using the FadeTransition to fade a label. Concurrently, I'm sometimes
using a custom decorator to blink an image. (Come to think of it, maybe
a Transition would technically be more appropriate for blinking than a
Decorator, but whatever...) The fade lasts about two seconds, and the
blinking five seconds (when it happens).

 

I've noticed a few things, on my Macbook Pro i7 2.7GHz with 8GB and
otherwise low CPU load...

*	I've got the FadeTransition set to 10Hz, but the fade calls hit
at around once per 300ms with 100% CPU utilization
*	If I comment-out the Label.repaint() method, the fade calls hit
every 100ms, as intended (but no fading happens, of course)
*	The image blinking is configured for 2Hz, but during the fade,
the blinks are irregular due to high CPU load. When the fading stops,
the blinks become regular. This is my biggest issue, since it looks
really bad.

I'm considering trying something advanced, like passing the
Label.repaint() call to an Executor so it doesn't block, and then the
blink callback can hit in a timely manner. But I'm reading Java
Concurrency in Action, chapter 9 ("GUI Applications"), and it talks
about how most GUI frameworks (including Swing... which Pivot sits on,
right?) are already single-threaded, and for a reason. I'm going to try
the Executor and see how it works, though I'm guessing I'll just be
shifting the issue from one thread to another, but I have to try
something. In the mean time, I'm curious to hear if you have advice
regarding this slow redraw issue I'm seeing that is causing the
blocking. Maybe there is a non-blocking Component.redraw() I don't know
about... =)

 

Thanks in advance for your time!

 

Cheers,

--E

 


Mime
View raw message