[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Support for animated icons (on mouseover)
From:       Waldo Bastian <bastian () kde ! org>
Date:       2002-01-18 0:00:39
[Download RAW message or body]

On Thursday 17 January 2002 03:20 pm, David Faure wrote:
> On Friday 18 January 2002 00:11, Waldo Bastian wrote:
> > On Thursday 17 January 2002 05:44 am, David Faure wrote:
> > > > I have to try it to want it defaulted off?  I can't apply common
> > > > sense, and experience with other animations locking up my XServer?
> > >
> > > This is about changing the icon's pixmap, a simple
> > > QIconViewItem::setPixmap()! How is this going to lock up your X server
> > > ??????
> >
> > That happens in the QMovie::current_frame() call where the frame is
> > prepared and send to the X-server. It doesn't lock up the X-server of
> > course, but it certainly causes traffic.
>
> Err, you were the one who convinced me to use QMovie & MNG instead of the
> kimage_concat solution.... But there isn't much difference, right ? Both
> send a pixmap to the X server ?

Yes... kimage_concat does it upfront and QMovie does it while playing. For 
this case the QMovie behaviour is probably more efficient since your app is 
relatively idle anyway and you might not need all the frames.

> > The biggest performance problem is probably just the disk-access for
> > opening the movie. That's not a problem when your system is idle, but
> > when you have pressure on your io-system it might take a while. In that
> > case it would probably make the UI jerky.
>
> Yup. That's why Dirk's idea of moving the movie to the iconview (and
> keeping the last one in memory for a while) might be helpful.

Dunno if that really matters much. it's about the first access..where you 
actually have to read from the disk, that can take a while if there are other 
read-operations queued in front of you. The second access comes out of the 
disk-cache. 

I don't know the level of caching that QMovie does internally (e.g. whether it 
keeps decoded frames around). If it does then caching might save you some CPU 
cycles there but I doubt that it does. Better let the disk cache do its work.

On the other hand if the animation is for something common like the 
folder-icon then you might want to cache it since it is most likely needed 
rather often. Caching increases your memory usage though... it doesn't come 
for free.

Cheers,
Waldo
-- 
bastian@kde.org  |   SuSE Labs KDE Developer  |  bastian@suse.com

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic