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

Andreas Pakulat apaku at gmx.de
Sat Jan 19 15:22:42 CET 2008


On 20.01.08 00:21:17, Ian Wadham wrote:
> On Sat, 19 Jan 2008 11:52 pm, Andreas Pakulat wrote:
> > Unrelated question: Do the svg games already use KPixmapCache for
> > caching the rendered svg's?
>
> Not sure if any do.  KGoldrunner does not.  It was the next thing I
> was going to try: mainly to save pixmaps between closes and
> re-opens of main window and avoid SVG loads on startup.

Nice :)

> > IMHO that could speed up re-resizing the 
> > app, i.e. if you change from maximization to "normal" size and back, as
> > in that case it would only reload a QPixmap instead of rerendering the
> > svg.
> Within one session of the game, possibly.  But KMainWindow and friends
> forget "normal" size when a maximized main window closes ... ;-)

But as soon as the user uses the same size again he could get it from
the cache. Ideally the apps would be able to specify some kind of
"ratio" in which the pixmap will just be scaled with QImage, instead of
re-rendering the whole svg. I suspect even with the
qpixmap->qimage->qpixmap conversion its faster and for small
numbers of the ratio (i.e. little size difference between the actual
cached image and the currently needed size) I doubt anybody can see a
difference between the scaled and a freshly rendered version.

> BTW, the KDE Games team did kick around ideas like KPixmapCache
> before the release of KDE 4.0, but mostly decided to leave refinements
> till KDE 4.1.  I think we did well to produce a large slab of working
> KDE 4.0 apps, Andreas, don't you?

Uhm, I wasn't saying anything like "the 4.0 games are bad", I wasn't
even thinking of that. I regularly play two or three of them, even
though they have a kde3 version, simply because they look a lot nicer :)

You people did a great job, I'm just thinking out loud what comes to my
mind to speed up the rendering-stuff. Maybe thats because I've got a
poor 4-year old laptop with a relatively low-end cpu/gpu...

Andreas

-- 
Accent on helpful side of your nature.  Drain the moat.


More information about the kde-games-devel mailing list