[haiku-development] Re: Compositing window management

  • From: Stephan Aßmus <superstippi@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 15 Jun 2011 11:40:47 +0200

Hi again,

On 15.06.2011 11:19, Stephan Aßmus wrote:
There are some nice properties which can be coded into the compositor:
It can be locked to the screen refresh rate, and you may cause window
painting to happen in separate temporary buffers. The compositor would
then compose the dirty parts of the back-buffer at a fixed rate, in its
own thread. It requests buffers from each Window to do so, but the
buffers would always be clean. When a Window draws, which is undisturbed
by the compositor asking for the buffer, it draws into a temporary
buffer. When it is done, it switches the new clean buffer for the old
clean one by holding the compositor lock for a short time (also telling
the compositor to recompose at the same time). This way you can never
see dirty parts of any window anymore as a user, and since the
compositor is locked to the screen refresh, you see no tearing either.

Sorry, but I left out another bit of important information:

In DrawingEngine, you will see another thing which is that "overlays" may be hidden before a drawing function and shown again after it is completed. There is only one type of overlay at the moment, which is the mouse cursor bitmap. When the user drags something, the drag bitmap and the mouse cursor shape are temporarily combined. This code of temporarily hiding the mouse cursor is both still needed for certain types of HWInterface, and somewhat absolete at the same time: The mouse cursor is composited on top of the front-buffer, on the fly, when transfering parts of the back buffer to the front buffer. The mouse shape is not actually visible in the back-buffer and that's why the code which temporarily hides it is a no-op. There are however compile options which make the app_server run with a single front buffer, and then this code would be needed.

In any case, it would cleanup a lot of code to remove the single-buffer run-mode option, and to move the mouse shape management entirely into the new Compositor class. It would be composited like any window buffer, on top of anything else.

I should write this up as an article on www.haiku-os.org :-)

Best regards,
-Stephan


Other related posts: