Abdelrazak Younes wrote:

> Abdelrazak Younes a écrit :
>> Andre Poenitz a écrit :
>>> On Thu, Mar 16, 2006 at 10:50:41AM +0100, Abdelrazak Younes wrote:
>>>  
>>>>> I thought even painting into a pixmap should only be done in a
>>>>> paintEvent(). The pixmap is located on the server side after all...
>>>>>       
>>>> I don't think so... or maybe I don't understand what you mean by
>>>> "server side".
>>>>     
>>>
>>> The X server.
>>>
>>> A 'pixmap' is located on the X server, whereas an 'image' is located on
>>> the X client. So pixel manipulation is cheap on images, display is
>>> (reaonably) cheap for pixmaps. And I though (but am not sure) that
>>> one accesses the server only in paintEvents nowadays.
>>>   
>> I think there is some "qui-proquo" here. What I call the backing pixmap
>> in QWorkArea is a QPixmap which is an off-screen, pixel-based paint
>> device. So it is really an image even if it rely in windowing system, in
>> this case the X server. The painting of this image into screen handled
>> by the Xserver is indeed done in QWorkArea::paintEvent() and that is the
>> one and only painting of the buffer view onto the screen. This was just
>> for clarification and I think we agree on everything except the fact
>> that QPixmap can be painted into at any time.
> 
> Hum, after thinking a bit more about this, I am maybe wrong here when
> the windowing system is an X11 server. Georg's post pushed me to try
> using a backing QImage instead of a QPixmap. I cannot feel any speed
> difference within Windows but I guess it can make a big difference on
> X11. Especially over the network as pointed by Georg. Besides, the code
> is cleaner and a bit shorter.

I cannot test now over a really slow connection, but on a 100 MBit network I
see a performance loss with the patch for pressing PgDown multiple times in
a document with some graphics and formulas, but I guess a real test would
be to do this on a slower network.
I don't see any difference if not running over the network.
The rason for the performance loss might be that with your patch the image
data goes over the network whenever QWorkArea::paintEvent is called. It is
probably cheaper to do simple image manipulations over the network, but let
the pixmap data reside in the X server instead of transferring it for every
paint event.

BTW I guess you read http://doc.trolltech.com/4.1/qpixmap.html ?


Georg

Reply via email to