Fix color change verification in dithering tests
authorPyry Haulos <phaulos@google.com>
Tue, 18 Apr 2017 23:13:59 +0000 (16:13 -0700)
committerPyry Haulos <phaulos@google.com>
Tue, 18 Apr 2017 23:13:59 +0000 (16:13 -0700)
Tests were supposed to allow color change once per row/column depending
on gradient direction but instead allowed color change in constant
direction only once over whole image.

Affects:

dEQP-GLES2.functional.dither.disabled.gradient_*
dEQP-GLES3.functional.dither.disabled.gradient_*

Bug: 37477346
Change-Id: I37ef06b4ff527f8c316eae56c8a99c88cdaaf4b4

modules/gles2/functional/es2fDitheringTests.cpp
modules/gles3/functional/es3fDitheringTests.cpp

index faf9cb0..96d7baa 100644 (file)
@@ -317,11 +317,12 @@ bool DitheringCase::drawAndCheckGradient (const bool isVerticallyIncreasing, con
        {
                const int       increasingDirectionSize = isVerticallyIncreasing ? renderedImg.getHeight() : renderedImg.getWidth();
                const int       constantDirectionSize   = isVerticallyIncreasing ? renderedImg.getWidth() : renderedImg.getHeight();
-               bool            colorHasChanged                 = false;
 
                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;
index ad02947..5e52d9e 100644 (file)
@@ -317,11 +317,12 @@ bool DitheringCase::drawAndCheckGradient (const bool isVerticallyIncreasing, con
        {
                const int       increasingDirectionSize = isVerticallyIncreasing ? renderedImg.getHeight() : renderedImg.getWidth();
                const int       constantDirectionSize   = isVerticallyIncreasing ? renderedImg.getWidth() : renderedImg.getHeight();
-               bool            colorHasChanged                 = false;
 
                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;