Ignore A channel in EGL RGB5_A1 clear color tests
authorAlexander Galazin <alexander.galazin@arm.com>
Tue, 6 Jun 2017 11:22:58 +0000 (13:22 +0200)
committerPyry Haulos <phaulos@google.com>
Tue, 6 Jun 2017 21:04:23 +0000 (14:04 -0700)
Dithering can siginifcantly impact alpha channel and the framework
can't fully account it.

Components: AOSP
Affects:
dEQP-EGL.functional.color_clears.*.rgba5551*

Bug: 62383988

Change-Id: Ic8fa4da1a840da56f74af3e076d0728d9abbdadc
(cherry picked from commit 9da1b45a8ed2489a46dd698953d963fa8bfbf1e7)

modules/egl/teglColorClearCase.cpp

index e2006cb..8ae8b4c 100644 (file)
@@ -244,7 +244,8 @@ void SingleThreadColorClearCase::executeForContexts (EGLDisplay display, EGLSurf
 
        // Compare images
        {
-               bool imagesOk = tcu::pixelThresholdCompare(log, "ComparisonResult", "Image comparison result", refFrame, frame, RGBA(1,1,1,1) + pixelFmt.getColorThreshold(), tcu::COMPARE_LOG_RESULT);
+               tcu::RGBA eps = pixelFmt.alphaBits == 1 ? RGBA(1,1,1,127) : RGBA(1,1,1,1);
+               bool imagesOk = tcu::pixelThresholdCompare(log, "ComparisonResult", "Image comparison result", refFrame, frame, eps + pixelFmt.getColorThreshold(), tcu::COMPARE_LOG_RESULT);
 
                if (!imagesOk)
                        m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Image comparison failed");
@@ -430,7 +431,8 @@ void MultiThreadColorClearCase::executeForContexts (EGLDisplay display, EGLSurfa
 
        // Compare images
        {
-               bool imagesOk = tcu::pixelThresholdCompare(log, "ComparisonResult", "Image comparison result", refFrame, frame, RGBA(1,1,1,1) + pixelFmt.getColorThreshold(), tcu::COMPARE_LOG_RESULT);
+               tcu::RGBA eps = pixelFmt.alphaBits == 1 ? RGBA(1,1,1,127) : RGBA(1,1,1,1);
+               bool imagesOk = tcu::pixelThresholdCompare(log, "ComparisonResult", "Image comparison result", refFrame, frame, eps + pixelFmt.getColorThreshold(), tcu::COMPARE_LOG_RESULT);
 
                if (!imagesOk)
                        m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Image comparison failed");