tcu::Surface refBuffer (width, height);
Frame newFrame (width, height);
EGLint currentBufferAge = -1;
- vector<EGLint> damageRegion;
if (frameNdx % 2 == 0)
generateRandomFrame(newFrame, m_evenFrameDrawType, rnd);
if (currentBufferAge > 0)
{
+ vector<EGLint> damageRegion;
+
hasPositiveAge = true;
if (m_supportBufferAge)
+ {
damageRegion = getDamageRegion(newFrame, 10, 10, 10, 10);
+ }
else
+ {
damageRegion = getDamageRegion(newFrame, 0, 0, 0, 0);
+ // Set empty damage region to avoid invalidating the framebuffer. The damage area is invalidated
+ // if the buffer age extension is not supported.
+ if (damageRegion.size() == 0)
+ damageRegion = vector<EGLint>(4, 0);
+ }
EGLU_CHECK_CALL(egl, setDamageRegionKHR(m_eglDisplay, m_eglSurface, &damageRegion[0], (EGLint)damageRegion.size()/4));
}