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

Luciano Montanaro mikelima at gmail.com
Sat Jan 19 17:00:26 CET 2008


Il Saturday 19 January 2008 13:52:35 Andreas Pakulat ha scritto:
> On 19.01.08 21:37:25, Ian Wadham wrote:
> > On Sat, 19 Jan 2008 07:22 pm, Andreas Pakulat wrote:
> > > On 19.01.08 14:18:30, Ian Wadham wrote:
> > > > I think the approach can be used in any KDE 4 game and probably in
> > > > other apps that require substantial graphics processing during
> > > > startup. I think it will also work if the main window library code
> > > > gets changed, though I see no signs of that happening in the TechBase
> > > > TODO lists. Any comments or feedback?
> > >
> > > a) Great Work.
> >
> > Thanks Andreas ... :-)
> >
> > > b) Where's the patch or branch?
> >
> > It's rev 762565 of kdegames/kgoldrunner on trunk.  Previous rev
> > of KGoldrunner was 762169.  Rev 762565 involved small changes to
> > the three main classes (6 files): main widget, canvas and game.
>
> Thanks, I'll have a look later tonight.
>
> Unrelated question: Do the svg games already use KPixmapCache for
> caching the rendered svg's? 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.
>
> Andreas

Yes, we have talked about using pixmap caches for the svg graphics...
However, I'm not sure it is really needed, for all games, and for all 
graphics.

For example, loading card graphics in Qt svgviewer is almost instantaneous 
here. Loading them in KPat seem to take longer...

Uhm, the cards are loaded in a thread in kpat; so KPixmaps cannot be used. :(

However, just for a quick test, I tried disabling the cache code...

Here using the cached pixmaps seem to actually slow down kpat startup.

Applying a fix like that Ian has applied to kgoldrunner would also skip one 
rendering...

Luciano

-------------- next part --------------
A non-text attachment was scrubbed...
Name: nocache.diff
Type: text/x-diff
Size: 1354 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-games-devel/attachments/20080119/040e09a0/attachment.bin 


More information about the kde-games-devel mailing list