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;
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;
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;
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;