Merge "Ignore A channel in EGL RGB5_A1 clear color tests" into oc-dev
authorPyry Haulos <phaulos@google.com>
Wed, 7 Jun 2017 00:12:19 +0000 (00:12 +0000)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Wed, 7 Jun 2017 00:12:20 +0000 (00:12 +0000)
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");