[Panel-devel] PhotoFrame plasmoid, plasma performances & the Zen

Mercurio mercurio at personellarete.it
Mon Jul 9 12:29:58 CEST 2007


Hello all, I'm new to KDE and Qt development: it seems Aaron's (and
other) advertising  was very effective, after all :D

I'm working to the photoframe plasmoid, and I'm concerned about its
performances. The users will surely try to load some of their 6+
megapixels photos, and rotate and stack them on the desktop. Currently
the paintInterface() of this plasmoid just draws a prescaled and
composed  pixmap of the photo: indeed it is very fast and I don't know
how to optimize further this...

but the plasmoid uses QGraphicsItem transformations for rotation, and
when it is rotated, plasma recalculates the transformation each paint
event. So it becomes very slow when  you try to move it, or when you
move above it another (big) plasmoid, such another photoframe.

So should I prerender the rotated picture in a pixmap (and deal with the
coordinate mess) or use QGraphicsItems (great) facilities as much as I
can, maybe also for scaling, and let this performance problem to plasma
developers? ^^''

Also this plamoid hangs plasma while it loads or downloads the image. It
seems that multithreading programming will be mandatory for some
plasmoids like this... does things get better if I try to write a
DataEngine for loading images?

Thanks for your patience.

- Antonio Vinci

p.s. sorry for this c++ newbye question: doesn't all objects created
with the "new" keyword must be explicitly destroyed  with "delete", at
least in the class destructor?  Otherwise there is a memory leak if you
open and close many plasmoids, isn't it?


More information about the Panel-devel mailing list