CP: Use empty region when buffer age is not supported
authorKalle Raita <kraita@google.com>
Thu, 25 Aug 2016 21:52:52 +0000 (14:52 -0700)
committerPyry Haulos <phaulos@google.com>
Tue, 30 Aug 2016 17:16:42 +0000 (10:16 -0700)
In the dEQP-EGL.functional.partial_update.* tests the damage region
needs to set to empty instead of implicit full screen for frame that do
not draw when the EGL_KHR_buffer_age is not supported. Otherwise the
contents become invalid and cannot be verified.

Bug: 30735352
Test: Local run of dEQP-EGL.functional.partial_update.* on various Nexus devices

(cherry picked from commit bc29554d7eed0bd996506fc1e074f264305c8143)

Change-Id: I17fc4fdca1da176e13e78b1ec2bebc8cb6d266b0

modules/egl/teglPartialUpdateTests.cpp

index 33ff3ea..f2f280e 100644 (file)
@@ -504,7 +504,6 @@ TestCase::IterateResult PartialUpdateTest::iterate (void)
                tcu::Surface    refBuffer                (width, height);
                Frame                   newFrame                 (width, height);
                EGLint                  currentBufferAge = -1;
-               vector<EGLint>  damageRegion;
 
                if (frameNdx % 2 == 0)
                        generateRandomFrame(newFrame, m_evenFrameDrawType, rnd);
@@ -528,12 +527,22 @@ TestCase::IterateResult PartialUpdateTest::iterate (void)
 
                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));
                }