Andre Poenitz wrote:
On Thu, Jun 08, 2006 at 10:29:39AM +0200, Abdelrazak Younes wrote:
Abdelrazak> The QPicture class "records" painting operations, it is
Abdelrazak> similar to vector based painting (SVG or windows Meta
Abdelrazak> file). So when you paint onto a QPicture it is not a real
Abdelrazak> painting. The real painting happens when you "replay" the
Abdelrazak> QPicture onto another pixmap oriented device. The fact
Abdelrazak> that all painting operations happen in one go (during the
Abdelrazak> update to the screen) is the winning factor here because
Abdelrazak> the painting operation are "unified" first.
[...]
_I_ think it is faster because of there is only one pixmap drawing.
I bet against it.
My preliminary assessment (scrolldown with PageDown) says the opposite
though. Besides, I never said I was sure of it. I explained my
reasoning... would you care to explain yours?
Storing lots of things in a QPicture eats a lot of memory. That's one.
For two: I cannot see a conceptional difference on Win: There all the
drawing is done using that (Gunnar, look away!) insane raster painter.
Note that my primary target for optimisation is X11 and Mac. For me Qt4
on windows is fast enough.
[interesting stuff]
Well... when I think about it, it might be possible that QPicture
compresses some operations and avoid, say, changing pens too often.
That was my theory indeed.
So in theory there might be a gain (note that I haven't checked the code
here). But then one might ask why TT puts energy into a rarely used
device (QPicture) yet leave the main road in that unfortunate state it
is in now.
Well, I read they put a lot of energy in Arthur which is actually vector
based, isn't it? Maybe optimizing for Arthur had the nice side effect of
QPicture optimisation... dunno really.
Thing might be completely different in case TT fell into some trap and
uses bi-directional communication. I am not aware of this being the
case, though, but I haven't checked the X11 painting code as intensively
as I did for the Windows code.
As I said, priority is to optimize for X11 and Mac...
Thanks for the explanation. I am going to cache the pens to see if
there's any benefit.
Abdel.