From 7d112535f41c38cd992cd0c99443f117f1e585ce Mon Sep 17 00:00:00 2001 From: rie kanazawa Date: Fri, 9 Nov 2018 11:07:43 +0900 Subject: [PATCH] DO NOT MERGE: Make the tests permissive for Lollipop MR1 dEQP-GLES3.functional.dither.disabled#gradient_white dEQP-GLES3.functional.dither.disabled#gradient_red dEQP-GLES3.functional.dither.disabled#gradient_green dEQP-GLES3.functional.dither.disabled#gradient_blue dEQP-GLES3.functional.dither.disabled#gradient_alpha Bug:117302647 Test: Build CTS Test: run cts --plan CTS-DEQP --disable-reboot https://android.googlesource.com/platform/external/deqp/+/8c44b09211d253dfc09bc8b7dfbc1f60c277d9f6%5E%21/#F0 modules/gles2/functional/es2fDitheringTests.cpp modules/gles3/functional/es3fDitheringTests.cpp Bug: 23219552 + https://android.googlesource.com/platform/external/deqp/+/085b52b2cda2eb522aa80f207d814dfc96bac84b%5E%21/#F0 Bug: 37477346 Change-Id: I013c970e84e764ce9ac49f1ecc7620369162388c Signed-off-by: rie kanazawa --- modules/gles2/functional/es2fDitheringTests.cpp | 26 ++++++++++++++++--------- modules/gles3/functional/es3fDitheringTests.cpp | 24 ++++++++++++++--------- 2 files changed, 32 insertions(+), 18 deletions(-) mode change 100644 => 100755 modules/gles2/functional/es2fDitheringTests.cpp mode change 100644 => 100755 modules/gles3/functional/es3fDitheringTests.cpp diff --git a/modules/gles2/functional/es2fDitheringTests.cpp b/modules/gles2/functional/es2fDitheringTests.cpp old mode 100644 new mode 100755 index 6fa1e27..8b81e00 --- a/modules/gles2/functional/es2fDitheringTests.cpp +++ b/modules/gles2/functional/es2fDitheringTests.cpp @@ -315,12 +315,13 @@ bool DitheringCase::drawAndCheckGradient (const bool isVerticallyIncreasing, con if (!m_ditheringEnabled) { - const int increasingDirectionSize = isVerticallyIncreasing ? renderedImg.getHeight() : renderedImg.getWidth(); - const int constantDirectionSize = isVerticallyIncreasing ? renderedImg.getWidth() : renderedImg.getHeight(); + const int increasingDirectionSize = isVerticallyIncreasing ? renderedImg.getHeight() : renderedImg.getWidth(); + const int constantDirectionSize = isVerticallyIncreasing ? renderedImg.getWidth() : renderedImg.getHeight(); for (int incrPos = 0; incrPos < increasingDirectionSize; incrPos++) { - tcu::RGBA prevConstantDirectionPix; + bool colorHasChanged = false; + tcu::RGBA prevConstantDirectionPix; for (int constPos = 0; constPos < constantDirectionSize; constPos++) { const int x = isVerticallyIncreasing ? constPos : incrPos; @@ -329,13 +330,20 @@ bool DitheringCase::drawAndCheckGradient (const bool isVerticallyIncreasing, con if (constPos > 0 && clr != prevConstantDirectionPix) { - log << TestLog::Message - << "Failure: colors should be constant per " << (isVerticallyIncreasing ? "row" : "column") - << " (since dithering is disabled), but the color at position (" << x << ", " << y << ") is " << clr - << " and does not equal the color at (" << (isVerticallyIncreasing ? x-1 : x) << ", " << (isVerticallyIncreasing ? y : y-1) << "), which is " << prevConstantDirectionPix - << TestLog::EndMessage; + // Allow color to change once to take into account possibly + // discontinuity between triangles + if (colorHasChanged) + { + log << TestLog::Message + << "Failure: colors should be constant per " << (isVerticallyIncreasing ? "row" : "column") + << " (since dithering is disabled), but the color at position (" << x << ", " << y << ") is " << clr + << " and does not equal the color at (" << (isVerticallyIncreasing ? x-1 : x) << ", " << (isVerticallyIncreasing ? y : y-1) << "), which is " << prevConstantDirectionPix + << TestLog::EndMessage; - return false; + return false; + } + else + colorHasChanged = true; } prevConstantDirectionPix = clr; diff --git a/modules/gles3/functional/es3fDitheringTests.cpp b/modules/gles3/functional/es3fDitheringTests.cpp old mode 100644 new mode 100755 index 8fe1bc8..bda2300 --- a/modules/gles3/functional/es3fDitheringTests.cpp +++ b/modules/gles3/functional/es3fDitheringTests.cpp @@ -315,12 +315,13 @@ bool DitheringCase::drawAndCheckGradient (const bool isVerticallyIncreasing, con if (!m_ditheringEnabled) { - const int increasingDirectionSize = isVerticallyIncreasing ? renderedImg.getHeight() : renderedImg.getWidth(); - const int constantDirectionSize = isVerticallyIncreasing ? renderedImg.getWidth() : renderedImg.getHeight(); + const int increasingDirectionSize = isVerticallyIncreasing ? renderedImg.getHeight() : renderedImg.getWidth(); + const int constantDirectionSize = isVerticallyIncreasing ? renderedImg.getWidth() : renderedImg.getHeight(); for (int incrPos = 0; incrPos < increasingDirectionSize; incrPos++) { - tcu::RGBA prevConstantDirectionPix; + bool colorHasChanged = false; + tcu::RGBA prevConstantDirectionPix; for (int constPos = 0; constPos < constantDirectionSize; constPos++) { const int x = isVerticallyIncreasing ? constPos : incrPos; @@ -329,13 +330,18 @@ bool DitheringCase::drawAndCheckGradient (const bool isVerticallyIncreasing, con if (constPos > 0 && clr != prevConstantDirectionPix) { - log << TestLog::Message - << "Failure: colors should be constant per " << (isVerticallyIncreasing ? "row" : "column") - << " (since dithering is disabled), but the color at position (" << x << ", " << y << ") is " << clr - << " and does not equal the color at (" << (isVerticallyIncreasing ? x-1 : x) << ", " << (isVerticallyIncreasing ? y : y-1) << "), which is " << prevConstantDirectionPix - << TestLog::EndMessage; + if (colorHasChanged) + { + log << TestLog::Message + << "Failure: colors should be constant per " << (isVerticallyIncreasing ? "row" : "column") + << " (since dithering is disabled), but the color at position (" << x << ", " << y << ") is " << clr + << " and does not equal the color at (" << (isVerticallyIncreasing ? x-1 : x) << ", " << (isVerticallyIncreasing ? y : y-1) << "), which is " << prevConstantDirectionPix + << TestLog::EndMessage; - return false; + return false; + } + else + colorHasChanged = true; } prevConstantDirectionPix = clr; -- 2.7.4