[Kde-games-devel] SVG and MainWindow resize handling
Andreas Pakulat
apaku at gmx.de
Sat Jan 19 23:08:01 CET 2008
On 19.01.08 19:12:15, Mauricio Piacentini wrote:
> Andreas Pakulat wrote:
> > However, it does use QImage normally to store the actual data, so
> > there's the overhead of one QImage->QPixmap conversion when using it.
> >
> > I think we really need to do some profiling, with different approaches.
> > I'll try to implement kpat+cardcache tomorrow and see what data that
> > gives, compared to the current kpat implementation.
>
> As far as I remember, we are not rendering directly to a QPixmap due to
> more than one reason. These MIGHT be: not able to paint outside
> paintEvents on QPixmaps
That one for sure not, you can create a QPixmap, paint on it and then
save it to a file without problem.
>, X Server caching, and/or problems with correct
> rendering of alpha channels.
I highly suspect this last one, as QPixmap doesn't let you specify the
format of the image wrt. alpha channels.
However, the cardcache I've written on top of KPixmapCache still renders
svg's itself (because KPixmapCache has no way of defining the element in
the svg when letting it load the svg) and thus still uses a QImage as
"first" image source. The same happens for pngs, which are read into a
QImage and that one is then transformed to fit the requested size. Only
after that the image is converted into a pixmap and stored in the cache.
> However, it has been some time since I
> tried it, so the situation might have changed. Maybe you could research
> this a little bit with one game and post the results if there are better
> ways to do this rendering?
OMG, I really need to stop being sucked into all kinds of things :) As I
said, I'll try to add the pixmap caching to kpat tomorrow and see
wether/how that improves speed at startup, changing decks and resizing.
> I do not want to sound harsh, but there appears to be an assumption on
> some messages of this thread that people were just sloppy with coding of
> SVG support in games, and I know that this was not true. As an example,
> Andreas suggested:
I'm sorry if any of you feel that way or read my questions in such a
way. I really wanted to know wether games use the pixmap cache, to
a) look how they use it (for what type of things, with or without memory
cache...)
b) having some starting point for comparisons, without the need to grep
through the code.
Next time I'll leave the question innocent as it was, before I added the
rest of the paragraph :)
Andreas
--
You are always busy.
More information about the kde-games-devel
mailing list