Fix error mask generation in checkLineContinuity
authorAlexander Galazin <alexander.galazin@arm.com>
Thu, 20 Apr 2017 12:08:44 +0000 (14:08 +0200)
committerAlexander Galazin <alexander.galazin@arm.com>
Thu, 20 Apr 2017 12:08:44 +0000 (14:08 +0200)
Even if some pixels are missing the function could return
all-zero errorMask if the messageLimitcounter was exhausted.

Components: AOSP
Affects: dEQP-GLES31.functional.primitive_bounding_box.lines.*

Google bug: 35987764

modules/gles31/functional/es31fPrimitiveBoundingBoxTests.cpp

index 01cefc8..eb655fc 100644 (file)
@@ -2186,13 +2186,16 @@ deUint8 LineRenderCase::checkLineContinuity (const tcu::ConstPixelBufferAccess&
                ++totalPixels;
        }
 
-       if (missedPixels > 0 && --messageLimitCounter >= 0)
+       if (missedPixels > 0)
        {
-               m_testCtx.getLog()
-                       << tcu::TestLog::Message
-                       << "Found non-continuous " << ((advance.x() == 1)  ? ("horizontal") : ("vertical")) << " line near " << begin << ". "
-                       << "Missed pixels: " << missedPixels
-                       << tcu::TestLog::EndMessage;
+               if (--messageLimitCounter >= 0)
+               {
+                       m_testCtx.getLog()
+                               << tcu::TestLog::Message
+                               << "Found non-continuous " << ((advance.x() == 1)  ? ("horizontal") : ("vertical")) << " line near " << begin << ". "
+                               << "Missed pixels: " << missedPixels
+                               << tcu::TestLog::EndMessage;
+               }
                // allow 10% missing pixels for warning
                if (missedPixels <= deRoundFloatToInt32((float)totalPixels * 0.1f))
                        errorMask = SCANRESULT_LINE_CONT_WARN_BIT;