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

Andreas Pakulat apaku at gmx.de
Tue Jan 22 23:25:37 CET 2008


On 21.01.08 01:00:46, Luciano Montanaro wrote:
> Il Monday 21 January 2008 00:51:04 Andreas Pakulat ha scritto:
> > Ok, so after 2 hours of hacking I have kpat using the CardCache class
> > I've written. Unfortunately KPat is totally useless with this. I don't
> > yet know why, but for some reason the rendering of just a single
> > frontside takes multiple seconds. I suspect I'm using the svg renderer
> > in a wrong way, or maybe its really the parsing of the svgz (currently
> > done for each request to render a frontside).
> 
> I don't know how you are using the svg renderer. You definitely want to load 
> the svg data once and render the various elements from the single instance.
> 
> The parsing is done on load time, after that, rendering from that is roughly 
> equivalent as drawing a QPicture.

Yeah, somehow I still managed to make initial startup of KPat "dog
slow", but doing resizes (with maximize atm) has gotten quite a bit
faster. According to my little stop-watch, resizing from maximize to
restored size (about 1/3rd of the desktop I think) takes 3 seconds now
(5 with original kpat) and going back to maximize takes now roughly 5
seconds (9 with original kpat). So there's an improvement, unfortunately
I also still have a few bugs (like cards don't have proper height/width
ratio, crash on closing)

> > So this just means that I'm back to pen&paper for the card cache, doing
> > a bit "premature" optimizations (like re-using the svg renderer,
> > introducing threading via ThreadWeaver) and creating a real testcase
> > scenario for it.
> 
> Threading is not going to help if you do not have multiple cores...

I wasn't talking about pure speed, I was thinking more about keeping the
gui responsive, while the theme loads in the background. I took this
from the original kpat cache code, which also simply started a separate
thread for loading a complete theme when the theme changed and then
later only drew the cards it really displayed.

So to conclude: I'm pretty confident I'll have something presentable by
the weekend.

Andreas

-- 
Beware of low-flying butterflies.


More information about the kde-games-devel mailing list