Hi Jorge, On Fri, Mar 14, 2008 at 06:53:08PM -0400, Jorge Arellano Cid wrote:
Hi Johannes,
On Tue, Mar 11, 2008 at 07:27:01PM +0100, Johannes Hofmann wrote:
Hi,
below is another patch to reduce the redraws caused by resizing tables. A new method Layout::queueDrawExcept(), that requests the drawing of a rectangle except another rectangle is added. It is then used in widget.cc to redraw the area that was previously occupied by a widget, but is no longer occupied after a resize or move. This makes it possible to redraw less when a table resizes. All in all it should reduce the flicker a bit when loading table based pages.
On the topic of reducing the flicker, I'm far of an expert and please correct me if I'm wrong. AFAIU, the current design draws the background color before the widget content.
This is: if you have an html page as big table, in dillo, it will become a table inside a textblock. When the textblock is asked to redraw, it will _erase_ the table with its background color and ask its child (the table) to redraw. Causing flicker.
Yes, that's true. In addition, before anything is drawn, the rectangle to be drawn is already cleared with the background color in FltkViewBase::draw() (the fillrect () calls).
If this is true, a big gain could come from a different approach: just draw the surroundings of the widgets and ask the child widgets to redraw.
This way widgets aren't erased beforehand, and can also decide not to redraw themselves when nothing has changed.
I have worked a bit on this idea, and the attached patch mocks the idea hackishly. It draws the "padding" area of the CSS box (see the picture in namespacedw_1_1core_1_1style.html in dw docs)
Please give it a review and share your comments, corrections and thoughts.
I've been thinking about something similar as well, but I don't think it will work out generally. The main problem is text drawing and maybe transparent widgets (don't know whether they exist already). Anyway, for drawing text, you need to erase the area first. Just comment out the fillrect () calls in FltkViewBase::draw() to see what I mean :-) Therefore, we will always have flicker, when drawing text. The good news is that all the flicker can be avoided easily with some double buffering technique. And from dillo1 we even know that this is not necessarily slow :-) So for me the flicker itself is not that much of a problem. It may be an indicator for unnecessary redraws, which should be avoided to save CPU power. But I think current cvs is already pretty good in this regard. So I would propose to start to think about efficient double buffering similar to what I had posted in http://lists.auriga.wearlab.de/pipermail/dillo-dev/2007-November/003379.html but platform independent using fltk2 support. Cheers, Johannes