[Panel-devel] svg rendering

Sean Harmer sh at theharmers.co.uk
Tue Oct 30 12:43:43 CET 2007


On Sunday 28 October 2007 10:45:47 Sean Harmer wrote:
> No doubt I'll be posting back later with questions on how best to integrate
> this - *if* I can get the basics going that is ;-)
Time for a status report...

I have the basics of threaded svg rendering in place now. Threads get created 
and run OK, Svg's are mostly (see below) rendered OK onto QImages which are 
then passed back to the main thread, converted to pixmaps, cached and then 
rendered.

A problem that I have just run into is that in Qt 4.3.x rendering of fonts is 
not supported outside of the GUI thread. This leads to problems when trying 
to render for e.g. the analog clock SVG in a separate thread.

I can see a few possible solutions to this until multi-threaded rendering of 
fonts becomes available in Qt 4.4:
 
http://labs.trolltech.com/blogs/2007/09/27/multi-threaded-text-layout-and-printing/

My ideas to get round this are:

* Do not allow the use of fonts in SVG's until KDE 4.1 and Qt 4.4. - Is this 
such a bad idea anyway, what happens in SVGs where different character sets 
are in use? The applet would then have to paint the text on itself rather 
than relying upon the SVG's text.

* Try to get Bradley et al. at TrollTech to backport the changes for 
multi-threaded text rendering to Qt 4.3.(x+1), or somehow get it into 
qt-copy.

* Abandon the multi-threaded SVG gubbins until 4.1. Although it would be a 
shame to throw away what I've got done so far as I think we could get a ncie 
performance kick from it (although I'v enot done any benchmarking yet as it 
is too early to do so).

I'll plow on for the moment whilst we mull this over. I need to implement so 
better cacheing in Plasma::Svg and friends. For the brave who feel like 
testing I've attached the current state of my patch. It still needs some 
tidying up and I need to check the visibility of certain classes etc but it 
doesn't crash now and you do actually get to see some rendered SVGs - apart 
from those with fonts in them ;-)

Cheers,

Sean

>
> Sean
> _______________________________________________
> Panel-devel mailing list
> Panel-devel at kde.org
> https://mail.kde.org/mailman/listinfo/panel-devel


-------------- next part --------------
A non-text attachment was scrubbed...
Name: svg-threading.patch
Type: text/x-diff
Size: 15873 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20071030/ee37a88e/attachment.bin 


More information about the Panel-devel mailing list