Le 24 janv. 11 à 18:24, Philipp Lohmann a écrit :

Hi,



Hi Philipp,


IMHO this is going to flicker somewhat whatever you do, since you need to erase the FixedText and the paint another one.


Ok.


On the Mac you see this not because all drawing is double buffered;


Is it possible to use double buffering on Windows and Linux too .. or not ?



you do the "flickering" stuff in the back buffer which then gets copied in a single step when the mac comes around to update the actual window.


That's what I thought after some tries : Mac OS X is the only one using true double-buffering. I must admit in my mind (and I was wrong) Windows should, but looks like it does not :-/


If you wanted to emulate this behavior on all platforms you could have your own control that does this using a VitualDevice to prepare its text and then only copy that to the window when the ::Paint method gets called. But that is probably a bit overblown.


If I understand you correctly, you want to say that, on Windows and Linux, only double-buffering emulation is possible ?

The "emulation" solution look interesting, but looks a bit complicated, and on slow machines (like XO) I'm not sure it will work well. Last but not least, maybe there is some hidden drawback.



You could also simplify things by not having different FixedTexts but using only one, calling SetText on that one FixedText when you need to change the text.


Ok, I'll try what you suggest. I was wondering which one was the most costly at runtime : only one or set all and Show() / Hide() only one.


This will also flicker at least a little since here also the window needs to get erased and then the new text drawn.


Indeed


But it will save a lot of clip region operations (removing the FixedText from the parents clip region and inserting the other one) which will gain some performance.


Ah, I missed this point.



If you have flickering already, do not use SetPaintTransparent and set a normal background (like solid white for instance). Transparent painting always causes the all parents up to the first opaque (not transparent) parent to restore the view, so a lot more painting gets done until finally the text can be drawn; transparent windows will cause more flicker, not less.



Your explanation is extremely interesting : I had no clue where cycles were lost, and the way transparency works explains a lot.


Just my 2 cents, pl




I got some time today, and if nothing goes wrong, I should report feedback soon. To tell you more, I'm playing with annotation mode, and the idea is to provide an interactive mode, without any toolbar nor menu, and at the end, modify Draw behavior


As usual, thanks a lot for your golden advices !!
Eric

--
qɔᴉɹə
Education Project:
http://wiki.services.openoffice.org/wiki/Education_Project
Projet OOo4Kids : http://wiki.ooo4kids.org/index.php/Main_Page
L'association EducOOo : http://www.educoo.org
Blog : http://eric.bachard.org/news





Reply via email to