Fix color change verification in dithering tests

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
diff --git a/modules/gles2/functional/es2fDitheringTests.cpp b/modules/gles2/functional/es2fDitheringTests.cpp
index faf9cb0..96d7baa 100644
--- a/modules/gles2/functional/es2fDitheringTests.cpp
+++ b/modules/gles2/functional/es2fDitheringTests.cpp
@@ -317,11 +317,12 @@
 	{
 		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;
diff --git a/modules/gles3/functional/es3fDitheringTests.cpp b/modules/gles3/functional/es3fDitheringTests.cpp
index ad02947..5e52d9e 100644
--- a/modules/gles3/functional/es3fDitheringTests.cpp
+++ b/modules/gles3/functional/es3fDitheringTests.cpp
@@ -317,11 +317,12 @@
 	{
 		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;