[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwin
Subject:    Re: Why custom flushBuffer code?
From:       Fredrik =?iso-8859-15?q?H=F6glund?= <fredrik () kde ! org>
Date:       2010-12-02 1:12:27
Message-ID: 201012020212.27993.fredrik () kde ! org
[Download RAW message or body]

On Wednesday 01 December 2010, Martin Gräßlin wrote:
> Hi,
> 
> can anyone explain me why we need the code in 
> void SceneOpenGL::flushBuffer( int mask, QRegion damage )
> for double buffering?
> 
> I just tried to implement it with ES and none of the used API calls is 
> present. There is neither an equivialent to glxCopySubBuffer nor the 
> glBitmap/glCopyPixel combo.
> 
> So my ES code is currently running without anything in paintBackground and 
> without anything in flushBuffer except eglSwapBuffer. And it's working fine. I 
> cannot notice any problems.
> 
> So if there is no reason for that code, I would dare to remove the flushBuffer 
> and paintBackground code. This should improve the rendering quite a lot as 
> it's many glScissor followed by single quad painting.

The contents of the back buffer is undefined after a call to SwapBuffers(),
so you have to do a full repaint afterwards.

Most Mesa drivers currently implement SwapBuffers() by blitting the
contents of the back buffer to the front buffer, after which the contents
of the buffers is identical. When it's implemented this way it's possible
to do partial updates with SwapBuffers(), but KWin can't depend on it.

The DRM recently gained a new pageflip ioctl that makes it possible for
DRI2 drivers to implement page flipping properly. But as far as I know
the only driver that supports it in a released version is the Intel driver.
Radeon also supports it in the drm-next branch, but it won't be merged
until the 2.6.38 merge window.

Regards,
Fredrik

_______________________________________________
kwin mailing list
kwin@kde.org
https://mail.kde.org/mailman/listinfo/kwin

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic