[Panel-devel] Multi-threaded SVG Rendering has arrived...

Aaron J. Seigo aseigo at kde.org
Mon Nov 26 11:01:34 CET 2007


On Sunday 25 November 2007, Sean Harmer wrote:
> The various paint() functions will also cause requested Svg elements to be
> scheduled for rendering. If there is no cached pixmap ready, then paint
> will not paint anything. So you should connect to svgRendered() to trigger
> another repaint. This is the quick and dirty way of using the
> multithreading features.
>
> To make more efficient use of the multithreading, you should take a look at
> panel.cpp in the second patch. This triggers a fresh rendering of the SVG
> elements from within constraintsUpdated. The panel class has been modified
> by adding a couple of bools to keep track of which parts of the Svg have
> been rendered. When all of the requisite parts are rendered into the Svg
> cache, then the paintBackground() function is allowed to proceed.

it would be very nice if this could be kept hidden from the applets entirely, 
since this is too high of a bar for the kind of code we're going to be 
expecting people to write. it also sounds error prone (leading to applets not 
painting because someone forgot to call update() again)

if one could associate a QGraphicsItem* or a QWidget* with a given Svg 
rendering job, this would allow Svg to call update() on the associated object 
automatically at the same time that svgSetRendered or svgRendered signals are 
emitted.

in the paint methods, we can extract the device being painted to, which gives 
us a way to get at the QWidget transparently, but this does not help with 
QGraphicsItems (the painter is on the view and doesn't know about the item), 
so we'd have to come up with some solution there.

we can't really use the parent QObject either, since that may not be the item 
that is ultimately being painted to ...

i'm too tired right now to think this through any further. will take it up 
after sleep.

> A new paint function has been added to Plasma::Svg that allows painting a
> subset of the entire cached pixmap. This should allow certain
> containments/plasmoids to make more efficient use of Svg images by only
> painting the dirty area.

this is good; it would be best if it were committed on its own to keep it 
nicely away from the rest of the changes.

> Is this OK to commit now please? I know of the following things that need
> to be done:

if we can find a way to handle the above issues, i'm find with committing 
these features .. however, i haven't had a chance to review the code very 
carefully at this point (i'm just about to head to bed).

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Trolltech
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20071126/bbcdd97f/attachment.pgp 


More information about the Panel-devel mailing list