Hmm, I'm not really a fan of that approach as it causes spurious redraws due to the repaint-rescheduling happening every time a draw function is called (eg, all the time). Overdraw will certainly be the cause of flickering in some cases though.
The other option is to grab the current damage region and clip drawing to that so there is no overdraw. For example:
Hmm, I'm not really a fan of that approach as it causes spurious redraws due to the repaint- rescheduling happening every time a draw function is called (eg, all the time). Overdraw will certainly be the cause of flickering in some cases though.
The other option is to grab the current damage region and clip drawing to that so there is no overdraw. For example:
bool scissoringEnabled = glIsEnabled (GL_SCISSOR_TEST);
GLint lastScissorBox[4];
glGetIntegerv (GL_SCISSOR_BOX, lastScissorBox);
glEnable (GL_SCISSOR_TEST);
CompRect::vector rects = region.rects ();
foreach (const CompRect &rect, rects)
screen- >height () - rect.y2 (),
rect.width (),
rect.height ());
{
glScissor (rect.x1 (),
streamingBu ffer->render ();
}
/* Reset scissor state */ bled)
if (!scissoringEna
glDisable (GL_SCISSOR_TEST);
/* Reset scissor box to old value */
lastScissor Box[1],
lastScissor Box[2],
lastScissor Box[3]) ;
glScissor (lastScissorBox[0],
This reminds me that GLVertexBuffer could probably use a clip () or renderClipped () method so that we don't have to repeat this everywhere.