[Kde-games-devel] SVG and MainWindow resize handling

Luciano Montanaro mikelima at gmail.com
Mon Jan 21 01:22:18 CET 2008


Il Saturday 19 January 2008 20:10:13 Andreas Pakulat ha scritto:
> On 19.01.08 19:06:38, Luciano Montanaro wrote:
> > Il Saturday 19 January 2008 18:32:20 Andreas Pakulat ha scritto:
> > > On 19.01.08 17:00:26, Luciano Montanaro wrote:
> > > > For example, loading card graphics in Qt svgviewer is almost
> > > > instantaneous here. Loading them in KPat seem to take longer...
> > >
> > > Here I don't see a noticeable difference.
> >
> > I do, here. But I have an intel card. Can you try loading a deck of card
> > in qt svgviewer, and switch between painting on image/pixmap? Is there
> > any difference? Here the difference is noticeable. For Tigullio
> > international, less than 1s "native" rendering,
> > around 3s "image" rendering.
>
> Loading with "image" takes about twice as long as the "native" one.
>

So, it's more or less like here... I have tried my slower desktop PC. On that, 
the difference between image and pixmap is still there, but not so 
pronounced. The openGL rendering is faster, but aliased. It may be an option 
for someone, though.

> > > Huh? It already uses QPixmap (there's no KPixmap). Or are you saying
> > > that KPixmapCache cannot be run in a non-gui Thread? Do you have some
> > > data to back that up - the API docs don't talk about that. And the
> > > QPixmap docs also don't say anything about this.
> >
> > Here is the excerpt from the qimage page...
>


> Uhm, but that doesn't say anything about QPixmap at all - at least as
> far as I can see. Also QPixmap is a QPaintDevice the same as QImage.
>

Well, it says that you CAN paint from a thread other than the GUI thread. So I 
interpreted that to mean that other paint devices could not be used from a 
non-gui thread.

And it says that you can use from a non gui thread except when you want to 
draw text... so that's another hint that Other surfaces are intended to be 
used from the gui thread only.

Oh, there is another reference to that from here:
http://doc.trolltech.com/4.3/paintsystem.html

"One advantage of using QImage as a paint device is that it is possible to 
guarantee the pixel exactness of any drawing operation in a 
platform-independent way. Another benefit is that the painting can be 
performed in another thread than the current GUI thread."


> > So, it looks like QPixmaps can only be used in the main thread. Maybe it
> > is platform specific, though.
>
> I don't see that anywhere mentioned (except that you need to translate
> text into a painter path before doing the painting). Also I'd be quite
> surprised if this would be platform specific, AFAIK kdegames work on
> win32 as well - so that covers windows and X11 and I'm actually not
> aware of any other windowing system that KDE supports.

Well, here I was worried for X11 anyway... 

Ciao,
Luciano


More information about the kde-games-devel mailing list