Make RGBA constants methods.
authorDejan Mircevski <deki@google.com>
Fri, 6 Nov 2015 22:08:44 +0000 (17:08 -0500)
committerDejan Mircevski <deki@google.com>
Mon, 9 Nov 2015 20:08:35 +0000 (15:08 -0500)
Without this, other global variables that are initialized with values
like RGBA::white will have a race condition with the RGBA::white
initialization.  We have seen a bug where a global array of RGBA
constants was being initialized before the constants themselves, so all
elements were (0, 0, 0, 0).

Change-Id: Idd6a88efda8375e52f15ed285afe38631b9c464a

37 files changed:
framework/common/tcuRGBA.cpp
framework/common/tcuRGBA.hpp
modules/egl/teglColorClearCase.cpp
modules/gles2/functional/es2fDefaultVertexAttributeTests.cpp
modules/gles2/functional/es2fDepthRangeTests.cpp
modules/gles2/functional/es2fDepthStencilClearTests.cpp
modules/gles2/functional/es2fDitheringTests.cpp
modules/gles2/functional/es2fMultisampleTests.cpp
modules/gles2/functional/es2fShaderBuiltinVarTests.cpp
modules/gles2/functional/es2fShaderFragDataTests.cpp
modules/gles2/functional/es2fUniformApiTests.cpp
modules/gles2/stress/es2sSpecialFloatTests.cpp
modules/gles3/functional/es3fASTCDecompressionCases.cpp
modules/gles3/functional/es3fDefaultVertexAttributeTests.cpp
modules/gles3/functional/es3fDepthStencilClearTests.cpp
modules/gles3/functional/es3fDitheringTests.cpp
modules/gles3/functional/es3fFragDepthTests.cpp
modules/gles3/functional/es3fFramebufferBlitTests.cpp
modules/gles3/functional/es3fMultisampleTests.cpp
modules/gles3/functional/es3fShaderBuiltinVarTests.cpp
modules/gles3/functional/es3fShaderDerivateTests.cpp
modules/gles3/functional/es3fShaderFragDataTests.cpp
modules/gles3/functional/es3fUniformApiTests.cpp
modules/gles3/stress/es3sSpecialFloatTests.cpp
modules/gles31/functional/es31fGeometryShaderTests.cpp
modules/gles31/functional/es31fPrimitiveBoundingBoxTests.cpp
modules/gles31/functional/es31fProgramUniformTests.cpp
modules/gles31/functional/es31fSampleVariableTests.cpp
modules/gles31/functional/es31fTessellationGeometryInteractionTests.cpp
modules/gles31/functional/es31fTessellationTests.cpp
modules/gles31/functional/es31fTextureBorderClampTests.cpp
modules/gles31/functional/es31fTextureGatherTests.cpp
modules/gles31/functional/es31fTextureMultisampleTests.cpp
modules/gles31/stress/es31sTessellationGeometryInteractionTests.cpp
modules/glshared/glsRasterizationTestUtil.cpp
modules/glshared/glsTextureTestUtil.cpp
modules/glshared/glsUniformBlockCase.cpp

index fedd91c..a212378 100644 (file)
 namespace tcu
 {
 
-const RGBA     RGBA::red               (0xFF, 0x0,  0x0,  0xFF);
-const RGBA     RGBA::green             (0x0,  0xFF, 0x0,  0xFF);
-const RGBA     RGBA::blue              (0x0,  0x0,  0xFF, 0xFF);
-const RGBA     RGBA::gray              (0x80, 0x80, 0x80, 0xFF);
-const RGBA     RGBA::white             (0xFF, 0xFF, 0xFF, 0xFF);
-const RGBA     RGBA::black             (0x0,  0x0,      0x0,  0xFF);
-
 RGBA::RGBA (const Vec4& v)
 {
        const deUint32 r = (deUint32)floatToU8(v.x());
index 76e7dbc..b7fb451 100644 (file)
@@ -92,13 +92,13 @@ public:
        bool            operator==                              (const RGBA& v) const { return (m_value == v.m_value); }
        bool            operator!=                              (const RGBA& v) const { return (m_value != v.m_value); }
 
-       // Color constants
-       const static RGBA       red;
-       const static RGBA       green;
-       const static RGBA       blue;
-       const static RGBA       gray;
-       const static RGBA       white;
-       const static RGBA       black;
+       // Color constants.  Designed as methods to avoid static-initialization-order fiasco.
+       static inline const RGBA red    (void) { return RGBA(0xFF, 0x0,  0x0,  0xFF); }
+       static inline const RGBA green  (void) { return RGBA(0x0,  0xFF, 0x0,  0xFF); }
+       static inline const RGBA blue   (void) { return RGBA(0x0,  0x0,  0xFF, 0xFF); }
+       static inline const RGBA gray   (void) { return RGBA(0x80, 0x80, 0x80, 0xFF); }
+       static inline const RGBA white  (void) { return RGBA(0xFF, 0xFF, 0xFF, 0xFF); }
+       static inline const RGBA black  (void) { return RGBA(0x0,  0x0,  0x0,  0xFF); }
 
 private:
        deUint32        m_value;
index db38ad0..e2006cb 100644 (file)
@@ -192,7 +192,7 @@ void SingleThreadColorClearCase::executeForContexts (EGLDisplay display, EGLSurf
        {
                EGLint          api                     = contexts[0].first;
                EGLContext      context         = contexts[0].second;
-               ClearOp         clear           (0, 0, width, height, RGBA::black);
+               ClearOp         clear           (0, 0, width, height, RGBA::black());
 
                egl.makeCurrent(display, surface, surface, context);
                EGLU_CHECK_MSG(egl, "eglMakeCurrent");
@@ -376,7 +376,7 @@ void MultiThreadColorClearCase::executeForContexts (EGLDisplay display, EGLSurfa
                        {
                                // First clear is always full-screen black.
                                if (threadNdx == 0 && packetNdx == 0 && clearNdx == 0)
-                                       packet.clears[clearNdx] = ClearOp(0, 0, width, height, RGBA::black);
+                                       packet.clears[clearNdx] = ClearOp(0, 0, width, height, RGBA::black());
                                else
                                        packet.clears[clearNdx] = computeRandomClear(rnd, width, height);
                        }
index b2672bb..30379f8 100644 (file)
@@ -429,7 +429,7 @@ bool AttributeCase::verifyUnicoloredBuffer (const tcu::Surface& scene, const tcu
        tcu::RGBA               exampleColor;
        tcu::IVec2              examplePos;
 
-       tcu::clear(errorMask.getAccess(), tcu::RGBA::green.toIVec());
+       tcu::clear(errorMask.getAccess(), tcu::RGBA::green().toIVec());
 
        m_testCtx.getLog() << tcu::TestLog::Message << "Verifying rendered image. Expecting color " << refColor << ", threshold " << colorThreshold << tcu::TestLog::EndMessage;
 
@@ -450,7 +450,7 @@ bool AttributeCase::verifyUnicoloredBuffer (const tcu::Surface& scene, const tcu
                        }
 
                        error = true;
-                       errorMask.setPixel(x, y, tcu::RGBA::red);
+                       errorMask.setPixel(x, y, tcu::RGBA::red());
                }
        }
 
index a59b1a0..1e7170c 100644 (file)
@@ -238,7 +238,7 @@ DepthRangeCompareCase::IterateResult DepthRangeCompareCase::iterate (void)
                        float   d               = depthRangeTransform(triQuadInterpolate(xf, yf, m_depthCoord), m_zNear, m_zFar);
                        bool    dpass   = compare(m_compareFunc, d, constDepth*0.5f + 0.5f);
 
-                       referenceFrame.setPixel(x, y, dpass ? tcu::RGBA::green : tcu::RGBA::blue);
+                       referenceFrame.setPixel(x, y, dpass ? tcu::RGBA::green() : tcu::RGBA::blue());
                }
 
                // Fill right half - comparison to interpolated depth
@@ -250,7 +250,7 @@ DepthRangeCompareCase::IterateResult DepthRangeCompareCase::iterate (void)
                        float   d               = depthRangeTransform(triQuadInterpolate(xf, yf, m_depthCoord), m_zNear, m_zFar);
                        bool    dpass   = compare(m_compareFunc, d, rd);
 
-                       referenceFrame.setPixel(x, y, dpass ? tcu::RGBA::green : tcu::RGBA::blue);
+                       referenceFrame.setPixel(x, y, dpass ? tcu::RGBA::green() : tcu::RGBA::blue());
                }
        }
 
index cbbcf99..ec1c130 100644 (file)
@@ -400,7 +400,7 @@ void DepthStencilClearCase::renderReference (tcu::Surface& dst, const vector<Cle
        const tcu::RenderTarget&        renderTarget    = renderCtx.getRenderTarget();
 
        // Clear surface to red.
-       tcu::clear(dst.getAccess(), tcu::RGBA::red.toVec());
+       tcu::clear(dst.getAccess(), tcu::RGBA::red().toVec());
 
        if (m_testDepth)
        {
index 6fa1e27..b5d5239 100644 (file)
@@ -291,7 +291,7 @@ bool DitheringCase::drawAndCheckGradient (const bool isVerticallyIncreasing, con
 
                                if (!checkColor(inputClr, renderedImg.getPixel(x, y), colorChoicesOk))
                                {
-                                       errorMask.setPixel(x, y, tcu::RGBA::red);
+                                       errorMask.setPixel(x, y, tcu::RGBA::red());
 
                                        if (colorChoicesOk)
                                        {
@@ -300,7 +300,7 @@ bool DitheringCase::drawAndCheckGradient (const bool isVerticallyIncreasing, con
                                        }
                                }
                                else
-                                       errorMask.setPixel(x, y, tcu::RGBA::green);
+                                       errorMask.setPixel(x, y, tcu::RGBA::green());
                        }
                }
 
@@ -394,7 +394,7 @@ bool DitheringCase::drawAndCheckUnicoloredQuad (const Vec4& quadColor) const
                        {
                                if (!checkColor(quadColor, renderedImg.getPixel(x, y), colorChoicesOk))
                                {
-                                       errorMask.setPixel(x, y, tcu::RGBA::red);
+                                       errorMask.setPixel(x, y, tcu::RGBA::red());
 
                                        if (colorChoicesOk)
                                        {
@@ -403,7 +403,7 @@ bool DitheringCase::drawAndCheckUnicoloredQuad (const Vec4& quadColor) const
                                        }
                                }
                                else
-                                       errorMask.setPixel(x, y, tcu::RGBA::green);
+                                       errorMask.setPixel(x, y, tcu::RGBA::green());
                        }
                }
 
index 9e7cc6a..3db1379 100644 (file)
@@ -160,7 +160,7 @@ static bool drawUnicolorTestErrors (tcu::Surface& img, const tcu::PixelBufferAcc
                {
                        if (!tcu::compareThreshold(img.getPixel(x, y), refColor, tcu::RGBA(3, 3, 3, 3)))
                        {
-                               img.setPixel(x, y, tcu::RGBA::red);
+                               img.setPixel(x, y, tcu::RGBA::red());
                                errorImg.setPixel(Vec4(1.0f, 0.0f, 0.0f, 1.0f), x, y);
                        }
                }
@@ -1019,7 +1019,7 @@ SampleStencilCase::IterateResult SampleStencilCase::iterate (void)
                for (int x = 0; x < clearedImg.getWidth(); x++)
                {
                        const tcu::RGBA& clr = clearedImg.getPixel(x, y);
-                       if (clr != tcu::RGBA::black)
+                       if (clr != tcu::RGBA::black())
                        {
                                log << TestLog::Message << "Failure: first non-black pixel, color " << clr << ", detected at coordinates (" << x << ", " << y << ")" << TestLog::EndMessage;
                                log << TestLog::Image("ClearedImg", "Image after clearing, erroneously non-black", clearedImg);
index a987cc1..9d48e49 100644 (file)
@@ -641,10 +641,10 @@ public:
                for (int y = 0; y < refImg.getHeight(); y++)
                {
                        for (int x = 0; x < refImg.getWidth()/2; x++)
-                               refImg.setPixel(x, y, tcu::RGBA::green);
+                               refImg.setPixel(x, y, tcu::RGBA::green());
 
                        for (int x = refImg.getWidth()/2; x < refImg.getWidth(); x++)
-                               refImg.setPixel(x, y, tcu::RGBA::blue);
+                               refImg.setPixel(x, y, tcu::RGBA::blue());
                }
 
                // Compare
index f1ef8f0..1aa0c9e 100644 (file)
@@ -204,7 +204,7 @@ public:
                        glu::readPixels(renderCtx, 0, 0, result.getAccess());
                        GLU_EXPECT_NO_ERROR(gl.getError(), "Reading pixels failed");
 
-                       isOk = compareSingleColor(m_testCtx.getLog(), result, tcu::RGBA::green, threshold);
+                       isOk = compareSingleColor(m_testCtx.getLog(), result, tcu::RGBA::green(), threshold);
 
                        m_testCtx.setTestResult(isOk ? QP_TEST_RESULT_PASS      : QP_TEST_RESULT_FAIL,
                                                                        isOk ? "Pass"                           : "Image comparison failed");
index 6e64042..f3470eb 100644 (file)
@@ -1719,7 +1719,7 @@ bool UniformCase::renderTest (const vector<BasicUniform>& basicUniforms, const S
        {
                for (int x = 0; x < renderedImg.getWidth(); x++)
                {
-                       if (renderedImg.getPixel(x, y) != tcu::RGBA::white)
+                       if (renderedImg.getPixel(x, y) != tcu::RGBA::white())
                                numFailedPixels += 1;
                }
        }
index 3602575..9a1c812 100644 (file)
@@ -187,10 +187,10 @@ bool RenderCase::checkResultImage (const tcu::Surface& result)
                const tcu::RGBA col = result.getPixel(x, y);
 
                if (col.getGreen() == 255)
-                       errorMask.setPixel(x, y, tcu::RGBA::green);
+                       errorMask.setPixel(x, y, tcu::RGBA::green());
                else
                {
-                       errorMask.setPixel(x, y, tcu::RGBA::red);
+                       errorMask.setPixel(x, y, tcu::RGBA::red());
                        error = true;
                }
        }
@@ -324,11 +324,11 @@ bool RenderCase::drawTestPattern (bool useTexture)
                        colorDiff.y() > formatThreshold.getGreen() + colorThreshold ||
                        colorDiff.z() > formatThreshold.getBlue()  + colorThreshold)
                {
-                       errorMask.setPixel(x, y, tcu::RGBA::red);
+                       errorMask.setPixel(x, y, tcu::RGBA::red());
                        error = true;
                }
                else
-                       errorMask.setPixel(x, y, tcu::RGBA::green);
+                       errorMask.setPixel(x, y, tcu::RGBA::green());
        }
 
        // report error
@@ -1390,8 +1390,8 @@ void OutputCase::testFBO (void)
        // Check results
        {
                tcu::Surface            errorMask               (TEST_CANVAS_SIZE, TEST_CANVAS_SIZE);
-               const tcu::RGBA         badPixelColor   = tcu::RGBA::red;
-               const tcu::RGBA         okPixelColor    = tcu::RGBA::green;
+               const tcu::RGBA         badPixelColor   = tcu::RGBA::red();
+               const tcu::RGBA         okPixelColor    = tcu::RGBA::green();
                int                                     badPixels               = 0;
 
                m_testCtx.getLog() << tcu::TestLog::Message << "Checking passes have identical red and blue channels and the green channel is correct in the constant pass." << tcu::TestLog::EndMessage;
@@ -1612,8 +1612,8 @@ void BlendingCase::testFBO (void)
        // Check results
        {
                tcu::Surface            errorMask               (TEST_CANVAS_SIZE, TEST_CANVAS_SIZE);
-               const tcu::RGBA         badPixelColor   = tcu::RGBA::red;
-               const tcu::RGBA         okPixelColor    = tcu::RGBA::green;
+               const tcu::RGBA         badPixelColor   = tcu::RGBA::red();
+               const tcu::RGBA         okPixelColor    = tcu::RGBA::green();
                int                                     badPixels               = 0;
 
                m_testCtx.getLog() << tcu::TestLog::Message << "Checking patterns are identical." << tcu::TestLog::EndMessage;
index c668dfd..5389b33 100644 (file)
@@ -1566,7 +1566,7 @@ static bool compareBlockImages (const Surface&            reference,
 
                        maxDiffDst = tcu::max(maxDiffDst, diff);
 
-                       errorMaskDst.setPixel(x, y, isOk ? tcu::RGBA::green : tcu::RGBA::red);
+                       errorMaskDst.setPixel(x, y, isOk ? tcu::RGBA::green() : tcu::RGBA::red());
 
                        if (!isOk && firstFailedBlockCoordDst.x() == -1)
                                firstFailedBlockCoordDst = blockCoord;
index 7c769a8..5117e83 100644 (file)
@@ -506,7 +506,7 @@ bool AttributeCase::verifyUnicoloredBuffer (const tcu::Surface& scene, const tcu
        tcu::RGBA               exampleColor;
        tcu::IVec2              examplePos;
 
-       tcu::clear(errorMask.getAccess(), tcu::RGBA::green.toIVec());
+       tcu::clear(errorMask.getAccess(), tcu::RGBA::green().toIVec());
 
        m_testCtx.getLog() << tcu::TestLog::Message << "Verifying rendered image. Expecting color " << refColor << ", threshold " << colorThreshold << tcu::TestLog::EndMessage;
 
@@ -527,7 +527,7 @@ bool AttributeCase::verifyUnicoloredBuffer (const tcu::Surface& scene, const tcu
                        }
 
                        error = true;
-                       errorMask.setPixel(x, y, tcu::RGBA::red);
+                       errorMask.setPixel(x, y, tcu::RGBA::red());
                }
        }
 
index 0138bc8..77bd5a5 100644 (file)
@@ -403,7 +403,7 @@ void DepthStencilClearCase::renderReference (tcu::Surface& dst, const vector<Cle
        const tcu::RenderTarget&        renderTarget    = renderCtx.getRenderTarget();
 
        // Clear surface to red.
-       tcu::clear(dst.getAccess(), tcu::RGBA::red.toVec());
+       tcu::clear(dst.getAccess(), tcu::RGBA::red().toVec());
 
        if (m_testDepth)
        {
index 8fe1bc8..350b734 100644 (file)
@@ -291,7 +291,7 @@ bool DitheringCase::drawAndCheckGradient (const bool isVerticallyIncreasing, con
 
                                if (!checkColor(inputClr, renderedImg.getPixel(x, y), colorChoicesOk))
                                {
-                                       errorMask.setPixel(x, y, tcu::RGBA::red);
+                                       errorMask.setPixel(x, y, tcu::RGBA::red());
 
                                        if (colorChoicesOk)
                                        {
@@ -300,7 +300,7 @@ bool DitheringCase::drawAndCheckGradient (const bool isVerticallyIncreasing, con
                                        }
                                }
                                else
-                                       errorMask.setPixel(x, y, tcu::RGBA::green);
+                                       errorMask.setPixel(x, y, tcu::RGBA::green());
                        }
                }
 
@@ -394,7 +394,7 @@ bool DitheringCase::drawAndCheckUnicoloredQuad (const Vec4& quadColor) const
                        {
                                if (!checkColor(quadColor, renderedImg.getPixel(x, y), colorChoicesOk))
                                {
-                                       errorMask.setPixel(x, y, tcu::RGBA::red);
+                                       errorMask.setPixel(x, y, tcu::RGBA::red());
 
                                        if (colorChoicesOk)
                                        {
@@ -403,7 +403,7 @@ bool DitheringCase::drawAndCheckUnicoloredQuad (const Vec4& quadColor) const
                                        }
                                }
                                else
-                                       errorMask.setPixel(x, y, tcu::RGBA::green);
+                                       errorMask.setPixel(x, y, tcu::RGBA::green());
                        }
                }
 
index d8d8dd8..307089a 100644 (file)
@@ -245,7 +245,7 @@ FragDepthCompareCase::IterateResult FragDepthCompareCase::iterate (void)
                        float   d               = m_evalFunc(Vec2(xf, yf));
                        bool    dpass   = compare(m_compareFunc, d, constDepth*0.5f + 0.5f);
 
-                       referenceFrame.setPixel(x, y, dpass ? tcu::RGBA::green : tcu::RGBA::blue);
+                       referenceFrame.setPixel(x, y, dpass ? tcu::RGBA::green() : tcu::RGBA::blue());
                }
 
                // Fill right half - comparison to interpolated depth
@@ -257,7 +257,7 @@ FragDepthCompareCase::IterateResult FragDepthCompareCase::iterate (void)
                        float   d               = m_evalFunc(Vec2(xf, yf));
                        bool    dpass   = compare(m_compareFunc, d, rd);
 
-                       referenceFrame.setPixel(x, y, dpass ? tcu::RGBA::green : tcu::RGBA::blue);
+                       referenceFrame.setPixel(x, y, dpass ? tcu::RGBA::green() : tcu::RGBA::blue());
                }
        }
 
index 74e79a7..2ee16b6 100644 (file)
@@ -221,7 +221,7 @@ bool BlitNearestFilterConsistencyCase::compare (const tcu::Surface& reference, c
 
                if (!isValidColor)
                {
-                       errorMask.setPixel(destinationArea.x() + dx, destinationArea.y() + dy, tcu::RGBA::red);
+                       errorMask.setPixel(destinationArea.x() + dx, destinationArea.y() + dy, tcu::RGBA::red());
                        error = true;
                }
        }
@@ -276,7 +276,7 @@ bool BlitNearestFilterConsistencyCase::compare (const tcu::Surface& reference, c
 
                if (resultSign != correctSign)
                {
-                       errorMask.setPixel(destinationArea.x() + dx, destinationArea.y() + dy, tcu::RGBA::red);
+                       errorMask.setPixel(destinationArea.x() + dx, destinationArea.y() + dy, tcu::RGBA::red());
                        error = true;
                }
        }
index 19ac82d..7b751d5 100644 (file)
@@ -162,7 +162,7 @@ static bool drawUnicolorTestErrors (tcu::Surface& img, const tcu::PixelBufferAcc
                {
                        if (!tcu::compareThreshold(img.getPixel(x, y), refColor, tcu::RGBA(3, 3, 3, 3)))
                        {
-                               img.setPixel(x, y, tcu::RGBA::red);
+                               img.setPixel(x, y, tcu::RGBA::red());
                                errorImg.setPixel(Vec4(1.0f, 0.0f, 0.0f, 1.0f), x, y);
                        }
                }
@@ -1166,7 +1166,7 @@ SampleStencilCase::IterateResult SampleStencilCase::iterate (void)
                for (int x = 0; x < clearedImg.getWidth(); x++)
                {
                        const tcu::RGBA& clr = clearedImg.getPixel(x, y);
-                       if (clr != tcu::RGBA::black)
+                       if (clr != tcu::RGBA::black())
                        {
                                log << TestLog::Message << "Failure: first non-black pixel, color " << clr << ", detected at coordinates (" << x << ", " << y << ")" << TestLog::EndMessage;
                                log << TestLog::Image("ClearedImg", "Image after clearing, erroneously non-black", clearedImg);
index 7cb6f4f..d10fa8c 100644 (file)
@@ -670,10 +670,10 @@ public:
                for (int y = 0; y < refImg.getHeight(); y++)
                {
                        for (int x = 0; x < refImg.getWidth()/2; x++)
-                               refImg.setPixel(x, y, tcu::RGBA::green);
+                               refImg.setPixel(x, y, tcu::RGBA::green());
 
                        for (int x = refImg.getWidth()/2; x < refImg.getWidth(); x++)
-                               refImg.setPixel(x, y, tcu::RGBA::blue);
+                               refImg.setPixel(x, y, tcu::RGBA::blue());
                }
 
                // Compare
index 70217b8..70e61b4 100644 (file)
@@ -401,7 +401,7 @@ static bool verifyConstantDerivate (tcu::TestLog&                                           log,
                                                                                        << ", at x = " << x << ", y = " << y
                                                << TestLog::EndMessage;
                                numFailedPixels += 1;
-                               errorMask.setPixel(tcu::RGBA::red.toVec(), x, y);
+                               errorMask.setPixel(tcu::RGBA::red().toVec(), x, y);
                        }
                }
        }
@@ -823,7 +823,7 @@ TriangleDerivateCase::IterateResult TriangleDerivateCase::iterate (void)
        // Verify
        {
                tcu::Surface errorMask(result.getWidth(), result.getHeight());
-               tcu::clear(errorMask.getAccess(), tcu::RGBA::green.toVec());
+               tcu::clear(errorMask.getAccess(), tcu::RGBA::green().toVec());
 
                const bool isOk = verify(result.getAccess(), errorMask.getAccess());
 
index e96f631..825e0b4 100644 (file)
@@ -204,7 +204,7 @@ public:
                        glu::readPixels(renderCtx, 0, 0, result.getAccess());
                        GLU_EXPECT_NO_ERROR(gl.getError(), "Reading pixels failed");
 
-                       isOk = compareSingleColor(m_testCtx.getLog(), result, tcu::RGBA::green, threshold);
+                       isOk = compareSingleColor(m_testCtx.getLog(), result, tcu::RGBA::green(), threshold);
 
                        m_testCtx.setTestResult(isOk ? QP_TEST_RESULT_PASS      : QP_TEST_RESULT_FAIL,
                                                                        isOk ? "Pass"                           : "Image comparison failed");
@@ -296,8 +296,8 @@ public:
                        gl.drawBuffers(DE_LENGTH_OF_ARRAY(drawBuffers), &drawBuffers[0]);
                }
 
-               gl.clearBufferfv(GL_COLOR, 0, tcu::RGBA::red.toVec().getPtr());
-               gl.clearBufferfv(GL_COLOR, 1, tcu::RGBA::red.toVec().getPtr());
+               gl.clearBufferfv(GL_COLOR, 0, tcu::RGBA::red().toVec().getPtr());
+               gl.clearBufferfv(GL_COLOR, 1, tcu::RGBA::red().toVec().getPtr());
 
                gl.viewport             (0, 0, width, height);
                gl.useProgram   (program.getProgram());
@@ -327,7 +327,7 @@ public:
                                glu::readPixels(renderCtx, 0, 0, result.getAccess());
                                GLU_EXPECT_NO_ERROR(gl.getError(), "Reading pixels failed");
 
-                               if (!compareSingleColor(m_testCtx.getLog(), result, ndx == 0 ? tcu::RGBA::green : tcu::RGBA::red, threshold))
+                               if (!compareSingleColor(m_testCtx.getLog(), result, ndx == 0 ? tcu::RGBA::green() : tcu::RGBA::red(), threshold))
                                        allOk = false;
                        }
 
index 3364d22..7d75d1c 100644 (file)
@@ -2129,7 +2129,7 @@ bool UniformCase::renderTest (const vector<BasicUniform>& basicUniforms, const S
        {
                for (int x = 0; x < renderedImg.getWidth(); x++)
                {
-                       if (renderedImg.getPixel(x, y) != tcu::RGBA::white)
+                       if (renderedImg.getPixel(x, y) != tcu::RGBA::white())
                                numFailedPixels += 1;
                }
        }
index 64ba419..aee32de 100644 (file)
@@ -190,10 +190,10 @@ bool RenderCase::checkResultImage (const tcu::Surface& result)
                const tcu::RGBA col = result.getPixel(x, y);
 
                if (col.getGreen() == 255)
-                       errorMask.setPixel(x, y, tcu::RGBA::green);
+                       errorMask.setPixel(x, y, tcu::RGBA::green());
                else
                {
-                       errorMask.setPixel(x, y, tcu::RGBA::red);
+                       errorMask.setPixel(x, y, tcu::RGBA::red());
                        error = true;
                }
        }
@@ -332,11 +332,11 @@ bool RenderCase::drawTestPattern (bool useTexture)
                        colorDiff.y() > formatThreshold.getGreen() + colorThreshold ||
                        colorDiff.z() > formatThreshold.getBlue()  + colorThreshold)
                {
-                       errorMask.setPixel(x, y, tcu::RGBA::red);
+                       errorMask.setPixel(x, y, tcu::RGBA::red());
                        error = true;
                }
                else
-                       errorMask.setPixel(x, y, tcu::RGBA::green);
+                       errorMask.setPixel(x, y, tcu::RGBA::green());
        }
 
        // report error
@@ -1753,8 +1753,8 @@ void OutputCase::testFBO (void)
        // Check results
        {
                tcu::Surface            errorMask               (TEST_CANVAS_SIZE, TEST_CANVAS_SIZE);
-               const tcu::RGBA         badPixelColor   = tcu::RGBA::red;
-               const tcu::RGBA         okPixelColor    = tcu::RGBA::green;
+               const tcu::RGBA         badPixelColor   = tcu::RGBA::red();
+               const tcu::RGBA         okPixelColor    = tcu::RGBA::green();
                int                                     badPixels               = 0;
 
                m_testCtx.getLog() << tcu::TestLog::Message << "Checking passes have identical red and blue channels and the green channel is correct in the constant pass." << tcu::TestLog::EndMessage;
@@ -1980,8 +1980,8 @@ void BlendingCase::testFBO (void)
        // Check results
        {
                tcu::Surface            errorMask               (TEST_CANVAS_SIZE, TEST_CANVAS_SIZE);
-               const tcu::RGBA         badPixelColor   = tcu::RGBA::red;
-               const tcu::RGBA         okPixelColor    = tcu::RGBA::green;
+               const tcu::RGBA         badPixelColor   = tcu::RGBA::red();
+               const tcu::RGBA         okPixelColor    = tcu::RGBA::green();
                int                                     badPixels               = 0;
 
                m_testCtx.getLog() << tcu::TestLog::Message << "Checking patterns are identical." << tcu::TestLog::EndMessage;
index 2f4e60c..fe55d52 100644 (file)
@@ -3404,7 +3404,7 @@ bool LayeredRenderCase::verifyImageSingleColoredRow (const tcu::Surface& layer,
        if (logging)
                m_testCtx.getLog() << tcu::TestLog::Message << "Expecting all pixels with distance less or equal to (about) " << barLength << " pixels from left border to be of color " << barColor.swizzle(0,1,2) << "." << tcu::TestLog::EndMessage;
 
-       tcu::clear(errorMask.getAccess(), tcu::RGBA::green.toIVec());
+       tcu::clear(errorMask.getAccess(), tcu::RGBA::green().toIVec());
 
        for (int y = 0; y < layer.getHeight(); ++y)
        for (int x = 0; x < layer.getWidth(); ++x)
@@ -3427,7 +3427,7 @@ bool LayeredRenderCase::verifyImageSingleColoredRow (const tcu::Surface& layer,
                allPixelsOk &= isOk;
 
                if (!isOk)
-                       errorMask.setPixel(x, y, tcu::RGBA::red);
+                       errorMask.setPixel(x, y, tcu::RGBA::red());
        }
 
        if (allPixelsOk)
index d25314e..4748b7f 100644 (file)
@@ -1341,7 +1341,7 @@ void GridRenderCase::verifyRenderResult (const IterationConfig& config)
 
                if (error)
                {
-                       errorMask.setPixel(x, y, tcu::RGBA::red);
+                       errorMask.setPixel(x, y, tcu::RGBA::red());
                        anyError = true;
                }
        }
@@ -3401,7 +3401,7 @@ bool BlitFboCase::verifyImage (const BlitArgs& args)
                if (error)
                {
                        anyError = true;
-                       errorMask.setPixel(x, y, tcu::RGBA::red);
+                       errorMask.setPixel(x, y, tcu::RGBA::red());
                }
        }
 
@@ -3898,7 +3898,7 @@ bool DepthDrawCase::verifyImage (const tcu::Surface& viewport) const
 
                if (error)
                {
-                       errorMask.setPixel(x, y, tcu::RGBA::red);
+                       errorMask.setPixel(x, y, tcu::RGBA::red());
                        anyError = true;
                }
        }
@@ -4256,14 +4256,14 @@ bool ClearCase::verifyImagesEqual (const tcu::PixelBufferAccess& withoutBBox, co
        tcu::Surface    errorMask       (withoutBBox.getWidth(), withoutBBox.getHeight());
        bool                    anyError        = false;
 
-       tcu::clear(errorMask.getAccess(), tcu::RGBA::green.toIVec());
+       tcu::clear(errorMask.getAccess(), tcu::RGBA::green().toIVec());
 
        for (int y = 0; y < withoutBBox.getHeight(); ++y)
        for (int x = 0; x < withoutBBox.getWidth(); ++x)
        {
                if (withoutBBox.getPixelInt(x, y) != withBBox.getPixelInt(x, y))
                {
-                       errorMask.setPixel(x, y, tcu::RGBA::red);
+                       errorMask.setPixel(x, y, tcu::RGBA::red());
                        anyError = true;
                }
        }
@@ -4289,7 +4289,7 @@ bool ClearCase::verifyImageResultValid (const tcu::PixelBufferAccess& result)
        tcu::Surface    errorMask       (result.getWidth(), result.getHeight());
        bool                    anyError        = false;
 
-       tcu::clear(errorMask.getAccess(), tcu::RGBA::green.toIVec());
+       tcu::clear(errorMask.getAccess(), tcu::RGBA::green().toIVec());
 
        for (int y = 0; y < result.getHeight(); ++y)
        for (int x = 0; x < result.getWidth(); ++x)
@@ -4299,7 +4299,7 @@ bool ClearCase::verifyImageResultValid (const tcu::PixelBufferAccess& result)
                // allow green, yellow and any shade between
                if (pixel[1] != 255 || pixel[2] != 0)
                {
-                       errorMask.setPixel(x, y, tcu::RGBA::red);
+                       errorMask.setPixel(x, y, tcu::RGBA::red());
                        anyError = true;
                }
        }
@@ -4626,7 +4626,7 @@ bool ViewportCallOrderCase::verifyImage (const tcu::PixelBufferAccess& result)
        tcu::Surface            errorMask               (result.getWidth(), result.getHeight());
        bool                            anyError                = false;
 
-       tcu::clear(errorMask.getAccess(), tcu::RGBA::green.toIVec());
+       tcu::clear(errorMask.getAccess(), tcu::RGBA::green().toIVec());
 
        for (int y = 0; y < result.getHeight(); ++y)
        for (int x = 0; x < result.getWidth(); ++x)
@@ -4641,7 +4641,7 @@ bool ViewportCallOrderCase::verifyImage (const tcu::PixelBufferAccess& result)
                if ((insideMeshArea && (pixel[1] != 255 || pixel[2] != 0)) ||
                        (outsideMeshArea && (pixel[0] != 0 || pixel[1] != 0 || pixel[2] != 0)))
                {
-                       errorMask.setPixel(x, y, tcu::RGBA::red);
+                       errorMask.setPixel(x, y, tcu::RGBA::red());
                        anyError = true;
                }
        }
index c020b34..91a1257 100644 (file)
@@ -1632,7 +1632,7 @@ bool UniformCase::renderTest (const vector<BasicUniform>& basicUniforms, const S
        {
                for (int x = 0; x < renderedImg.getWidth(); x++)
                {
-                       if (renderedImg.getPixel(x, y) != tcu::RGBA::green)
+                       if (renderedImg.getPixel(x, y) != tcu::RGBA::green())
                                numFailedPixels += 1;
                }
        }
index 14b2c31..f60b862 100644 (file)
@@ -221,7 +221,7 @@ static bool verifyImageWithVerifier (const tcu::Surface& resultImage, tcu::TestL
                if (!verifier.verify(color, tcu::IVec2(x,y)))
                {
                        error = true;
-                       errorMask.setPixel(x, y, tcu::RGBA::red);
+                       errorMask.setPixel(x, y, tcu::RGBA::red());
                }
        }
 
@@ -756,7 +756,7 @@ bool SamplePosDistributionCase::verifySampleBuffers (const std::vector<tcu::Surf
 
                                        samplePosNotUnique = true;
                                        uniquenessOk = false;
-                                       errorMask.setPixel(x, y, tcu::RGBA::red);
+                                       errorMask.setPixel(x, y, tcu::RGBA::red());
                                }
                        }
                }
@@ -828,7 +828,7 @@ bool SamplePosDistributionCase::verifySampleBuffers (const std::vector<tcu::Surf
                                        }
 
                                        distibutionError = true;
-                                       errorMask.setPixel(x, y, tcu::RGBA::red);
+                                       errorMask.setPixel(x, y, tcu::RGBA::red());
                                }
                        }
 
@@ -1553,7 +1553,7 @@ bool SampleMaskUniqueCase::verifySampleBuffers (const std::vector<tcu::Surface>&
 
                                        maskNdxNotUnique = true;
                                        uniquenessOk = false;
-                                       errorMask.setPixel(x, y, tcu::RGBA::red);
+                                       errorMask.setPixel(x, y, tcu::RGBA::red());
                                }
                        }
                }
index 5fcb276..64e60e0 100644 (file)
@@ -2509,7 +2509,7 @@ bool GridRenderCase::verifyResultLayer (int layerNdx, const tcu::Surface& image)
                // Color must be a linear combination of green and yellow
                if (color.getGreen() < 255 - threshold || color.getBlue() > threshold)
                {
-                       errorMask.setPixel(x, y, tcu::RGBA::red);
+                       errorMask.setPixel(x, y, tcu::RGBA::red());
                        foundError = true;
                }
        }
index 73e2cf3..27d945c 100644 (file)
@@ -1074,7 +1074,7 @@ static void drawTessCoordVisualization (tcu::Surface& dst, TessPrimitiveType pri
        tcu::clear(dst.getAccess(), tcu::Vec4(0.0f, 0.0f, 0.0f, 1.0f));
 
        for (int i = 0; i < (int)coords.size(); i++)
-               drawTessCoordPoint(dst, primitiveType, coords[i], tcu::RGBA::white, 2);
+               drawTessCoordPoint(dst, primitiveType, coords[i], tcu::RGBA::white(), 2);
 }
 
 static int binarySearchFirstVec3WithXAtLeast (const vector<Vec3>& sorted, float x)
@@ -1171,9 +1171,9 @@ static bool compareTessCoords (TestLog& log, TessPrimitiveType primitiveType, co
        drawTessCoordVisualization(resVisual, primitiveType, resCoords);
 
        // Check that all points in reference also exist in result.
-       success = oneWayComparePointSets(log, refVisual, primitiveType, refCoords, resCoords, "reference", "result", tcu::RGBA::blue) && success;
+       success = oneWayComparePointSets(log, refVisual, primitiveType, refCoords, resCoords, "reference", "result", tcu::RGBA::blue()) && success;
        // Check that all points in result also exist in reference.
-       success = oneWayComparePointSets(log, resVisual, primitiveType, resCoords, refCoords, "result", "reference", tcu::RGBA::red) && success;
+       success = oneWayComparePointSets(log, resVisual, primitiveType, resCoords, refCoords, "result", "reference", tcu::RGBA::red()) && success;
 
        if (!success)
        {
@@ -2797,8 +2797,8 @@ WindingCase::IterateResult WindingCase::iterate (void)
                                for (int y = 0; y < rendered.getHeight();       y++)
                                for (int x = 0; x < rendered.getWidth();        x++)
                                {
-                                       numWhitePixels  += rendered.getPixel(x, y) == tcu::RGBA::white  ? 1 : 0;
-                                       numRedPixels    += rendered.getPixel(x, y) == tcu::RGBA::red    ? 1 : 0;
+                                       numWhitePixels  += rendered.getPixel(x, y) == tcu::RGBA::white()        ? 1 : 0;
+                                       numRedPixels    += rendered.getPixel(x, y) == tcu::RGBA::red()  ? 1 : 0;
                                }
 
                                DE_ASSERT(numWhitePixels + numRedPixels <= totalNumPixels);
@@ -3277,7 +3277,7 @@ PerPatchDataCase::IterateResult PerPatchDataCase::iterate (void)
                        for (int y = 0; y < rendered.getHeight();       y++)
                        for (int x = 0; x < rendered.getWidth();        x++)
                        {
-                               if (rendered.getPixel(x, y) != tcu::RGBA::white)
+                               if (rendered.getPixel(x, y) != tcu::RGBA::white())
                                {
                                        log << TestLog::Message << "Failure: expected all white pixels" << TestLog::EndMessage;
                                        m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Image verification failed");
@@ -5415,12 +5415,12 @@ PrimitiveDiscardCase::IterateResult PrimitiveDiscardCase::iterate (void)
 
                                                        if (isMSAA)
                                                        {
-                                                               if (pixels.getPixel(x, y) != tcu::RGBA::black)
+                                                               if (pixels.getPixel(x, y) != tcu::RGBA::black())
                                                                        pixelOk = true;
                                                        }
                                                        else
                                                        {
-                                                               if (pixels.getPixel(x, y) == tcu::RGBA::white)
+                                                               if (pixels.getPixel(x, y) == tcu::RGBA::white())
                                                                        pixelOk = true;
                                                        }
                                                }
@@ -5444,7 +5444,7 @@ PrimitiveDiscardCase::IterateResult PrimitiveDiscardCase::iterate (void)
                                                {
                                                        if (y > lastWhitePixelRow || (y > secondToLastWhitePixelRow && x > lastWhitePixelColumnOnSecondToLastWhitePixelRow))
                                                        {
-                                                               if (pixels.getPixel(x, y) != tcu::RGBA::black)
+                                                               if (pixels.getPixel(x, y) != tcu::RGBA::black())
                                                                {
                                                                        log << TestLog::Message << "Failure: expected all pixels to be black in the area "
                                                                                                                        << (lastWhitePixelColumnOnSecondToLastWhitePixelRow < pixels.getWidth()-1
index 742324b..66daaf4 100644 (file)
@@ -1117,7 +1117,7 @@ bool TextureBorderClampTest::verifyTextureGatherResult (const tcu::ConstPixelBuf
        tcu::Surface                                                            errorMask                       (renderedFrame.getWidth(), renderedFrame.getHeight());
        int                                                                                     numFailedPixels         = 0;
 
-       tcu::clear(errorMask.getAccess(), tcu::RGBA::green.toVec());
+       tcu::clear(errorMask.getAccess(), tcu::RGBA::green().toVec());
 
        for (int py = 0; py < reference.getHeight(); ++py)
        for (int px = 0; px < reference.getWidth(); ++px)
@@ -1137,7 +1137,7 @@ bool TextureBorderClampTest::verifyTextureGatherResult (const tcu::ConstPixelBuf
                {
                        if (!tcu::isGatherOffsetsResultValid(effectiveView, samplerParams.sampler, lookupPrecision, texCoord, 0, glu::getDefaultGatherOffsets(), resultValue))
                        {
-                               errorMask.setPixel(px, py, tcu::RGBA::red);
+                               errorMask.setPixel(px, py, tcu::RGBA::red());
                                ++numFailedPixels;
                        }
                }
@@ -1182,7 +1182,7 @@ bool TextureBorderClampTest::verifyTextureGatherCmpResult (const tcu::ConstPixel
        int                                                                                     numFailedPixels         = 0;
        bool                                                                            lowQuality                      = false;
 
-       tcu::clear(errorMask.getAccess(), tcu::RGBA::green.toVec());
+       tcu::clear(errorMask.getAccess(), tcu::RGBA::green().toVec());
 
        for (int py = 0; py < reference.getHeight(); ++py)
        for (int px = 0; px < reference.getWidth(); ++px)
@@ -1204,7 +1204,7 @@ bool TextureBorderClampTest::verifyTextureGatherCmpResult (const tcu::ConstPixel
                                // fall back to low quality verification
                                if (!tcu::isGatherOffsetsCompareResultValid(effectiveView, samplerParams.sampler, lowQualityTexComparePrecision, texCoord, glu::getDefaultGatherOffsets(), refZ, resultValue))
                                {
-                                       errorMask.setPixel(px, py, tcu::RGBA::red);
+                                       errorMask.setPixel(px, py, tcu::RGBA::red());
                                        ++numFailedPixels;
                                }
                        }
index 1eecc83..128b75a 100644 (file)
@@ -587,7 +587,7 @@ static bool verifyGatherOffsets (TestLog&                                           log,
        tcu::Surface                            errorMask               (width, height);
        bool                                            success                 = true;
 
-       tcu::clear(errorMask.getAccess(), tcu::RGBA::green.toVec());
+       tcu::clear(errorMask.getAccess(), tcu::RGBA::green().toVec());
 
        for (int py = 0; py < height; py++)
        for (int px = 0; px < width; px++)
@@ -608,7 +608,7 @@ static bool verifyGatherOffsets (TestLog&                                           log,
                {
                        if (!isGatherOffsetsResultValid(texture, sampler, lookupPrec, texCoord, componentNdx, offsets, resultPix))
                        {
-                               errorMask.setPixel(px, py, tcu::RGBA::red);
+                               errorMask.setPixel(px, py, tcu::RGBA::red());
                                success = false;
                        }
                }
@@ -665,7 +665,7 @@ static bool verifyGatherOffsetsCompare (TestLog&                                                    log,
        tcu::Surface                            errorMask               (width, height);
        bool                                            success                 = true;
 
-       tcu::clear(errorMask.getAccess(), tcu::RGBA::green.toVec());
+       tcu::clear(errorMask.getAccess(), tcu::RGBA::green().toVec());
 
        for (int py = 0; py < height; py++)
        for (int px = 0; px < width; px++)
@@ -685,7 +685,7 @@ static bool verifyGatherOffsetsCompare (TestLog&                                                    log,
                {
                        if (!isGatherOffsetsCompareResultValid(texture, sampler, compPrec, texCoord, offsets, refZ, resultPix))
                        {
-                               errorMask.setPixel(px, py, tcu::RGBA::red);
+                               errorMask.setPixel(px, py, tcu::RGBA::red());
                                success = false;
                        }
                }
@@ -714,7 +714,7 @@ static bool verifySingleColored (TestLog& log, const ConstPixelBufferAccess& res
        tcu::Surface                            errorMask               (width, height);
        bool                                            success                 = true;
 
-       tcu::clear(errorMask.getAccess(), tcu::RGBA::green.toVec());
+       tcu::clear(errorMask.getAccess(), tcu::RGBA::green().toVec());
        tcu::clear(idealAccess, refColor);
 
        for (int py = 0; py < height; py++)
@@ -722,7 +722,7 @@ static bool verifySingleColored (TestLog& log, const ConstPixelBufferAccess& res
        {
                if (result.getPixel(px, py) != refColor)
                {
-                       errorMask.setPixel(px, py, tcu::RGBA::red);
+                       errorMask.setPixel(px, py, tcu::RGBA::red());
                        success = false;
                }
        }
index 1bdf3e4..88bede3 100644 (file)
@@ -934,7 +934,7 @@ bool SampleMaskCase::verifyTexture (int sample)
        tcu::Surface    errorMask       (m_canvasSize, m_canvasSize);
        bool                    error           = false;
 
-       tcu::clear(errorMask.getAccess(), tcu::RGBA::green.toVec());
+       tcu::clear(errorMask.getAccess(), tcu::RGBA::green().toVec());
 
        // Draw sample:
        //      Sample sampleNdx is set to red channel
@@ -954,13 +954,13 @@ bool SampleMaskCase::verifyTexture (int sample)
                if (color.getGreen() != 0)
                {
                        error = true;
-                       errorMask.setPixel(x, y, tcu::RGBA::red);
+                       errorMask.setPixel(x, y, tcu::RGBA::red());
                }
                // enabled sample was not written to
                else if (color.getRed() != 255 && !allowMissingCoverage)
                {
                        error = true;
-                       errorMask.setPixel(x, y, tcu::RGBA::red);
+                       errorMask.setPixel(x, y, tcu::RGBA::red());
                }
        }
 
index 9165ef5..2269522 100644 (file)
@@ -394,7 +394,7 @@ bool GridRenderCase::verifyResultLayer (int layerNdx, const tcu::Surface& image)
                // Color must be a linear combination of green and yellow
                if (color.getGreen() < 255 - threshold || color.getBlue() > threshold)
                {
-                       errorMask.setPixel(x, y, tcu::RGBA::red);
+                       errorMask.setPixel(x, y, tcu::RGBA::red());
                        foundError = true;
                }
        }
index 6088888..b55df3b 100644 (file)
@@ -1124,7 +1124,7 @@ bool verifySinglesampleLineGroupRasterization (const tcu::Surface& surface, cons
                for (int x = 0; x < referenceLineMap.getWidth(); ++x)
                {
                        const bool reference    = referenceLineMap.getAccess().getPixelInt(x, y).x() != 0;
-                       const bool result               = compareColors(surface.getPixel(x, y), tcu::RGBA::white, args.redBits, args.greenBits, args.blueBits);
+                       const bool result               = compareColors(surface.getPixel(x, y), tcu::RGBA::white(), args.redBits, args.greenBits, args.blueBits);
 
                        if (reference)
                                ++referenceFragments;
@@ -1149,14 +1149,14 @@ bool verifySinglesampleLineGroupRasterization (const tcu::Surface& surface, cons
                                for (int dy = -1; dy < 2 && !foundFragment; ++dy)
                                for (int dx = -1; dx < 2 && !foundFragment; ++dx)
                                {
-                                       if (compareColors(surface.getPixel(x+dx, y+dy), tcu::RGBA::white, args.redBits, args.greenBits, args.blueBits))
+                                       if (compareColors(surface.getPixel(x+dx, y+dy), tcu::RGBA::white(), args.redBits, args.greenBits, args.blueBits))
                                                foundFragment = true;
                                }
 
                                if (!foundFragment)
                                {
                                        missingFragments = true;
-                                       errorMask.setPixel(x, y, tcu::RGBA::red);
+                                       errorMask.setPixel(x, y, tcu::RGBA::red());
                                }
                        }
                }
@@ -1201,7 +1201,7 @@ bool verifySinglesampleLineGroupRasterization (const tcu::Surface& surface, cons
                                for (int y = 0; y < surface.getHeight(); ++y)
                                for (int x = 0; x < surface.getWidth(); ++x)
                                        if (referenceLineMap.getAccess().getPixelInt(x, y).x())
-                                               reference.setPixel(x, y, tcu::RGBA::white);
+                                               reference.setPixel(x, y, tcu::RGBA::white());
 
                                log << tcu::TestLog::Message << "Invalid fragment count in result image." << tcu::TestLog::EndMessage;
                                log << tcu::TestLog::ImageSet("Verification result", "Result of rendering")
@@ -1237,7 +1237,7 @@ bool verifySinglesampleLineGroupRasterization (const tcu::Surface& surface, cons
 
                        for (int x = 1; x < referenceLineMap.getWidth() - 1; ++x)
                        {
-                               const bool      result  = compareColors(surface.getPixel(x, y), tcu::RGBA::white, args.redBits, args.greenBits, args.blueBits);
+                               const bool      result  = compareColors(surface.getPixel(x, y), tcu::RGBA::white(), args.redBits, args.greenBits, args.blueBits);
                                int                     lineID  = 0;
 
                                // Which line does this fragment belong to?
@@ -1318,7 +1318,7 @@ bool verifySinglesampleLineGroupRasterization (const tcu::Surface& surface, cons
 
                        for (int y = 1; y < referenceLineMap.getHeight() - 1; ++y)
                        {
-                               const bool      result  = compareColors(surface.getPixel(x, y), tcu::RGBA::white, args.redBits, args.greenBits, args.blueBits);
+                               const bool      result  = compareColors(surface.getPixel(x, y), tcu::RGBA::white(), args.redBits, args.greenBits, args.blueBits);
                                int                     lineID  = 0;
 
                                // Which line does this fragment belong to?
@@ -1541,7 +1541,7 @@ bool verifyLineGroupPixelIndependentInterpolation (const tcu::Surface&                            surfac
                }
 
                // background color is possible?
-               if (lineSurroundingCoverage == 0 && compareColors(color, tcu::RGBA::black, args.redBits, args.greenBits, args.blueBits))
+               if (lineSurroundingCoverage == 0 && compareColors(color, tcu::RGBA::black(), args.redBits, args.greenBits, args.blueBits))
                        continue;
 
                // Check those lines
@@ -1865,7 +1865,7 @@ bool verifySinglesampleWideLineGroupInterpolation (const tcu::Surface& surface,
                }
 
                // background color is possible?
-               if (lineSurroundingCoverage == 0 && compareColors(color, tcu::RGBA::black, args.redBits, args.greenBits, args.blueBits))
+               if (lineSurroundingCoverage == 0 && compareColors(color, tcu::RGBA::black(), args.redBits, args.greenBits, args.blueBits))
                        continue;
 
                // Check those lines
index 452f3c9..7e7da21 100644 (file)
@@ -1725,7 +1725,7 @@ int computeTextureLookupDiff (const tcu::ConstPixelBufferAccess&  result,
                tcu::Vec2( 0, +1),
        };
 
-       tcu::clear(errorMask, tcu::RGBA::green.toVec());
+       tcu::clear(errorMask, tcu::RGBA::green().toVec());
 
        for (int py = 0; py < result.getHeight(); py++)
        {
@@ -1779,7 +1779,7 @@ int computeTextureLookupDiff (const tcu::ConstPixelBufferAccess&  result,
 
                                if (!isOk)
                                {
-                                       errorMask.setPixel(tcu::RGBA::red.toVec(), px, py);
+                                       errorMask.setPixel(tcu::RGBA::red().toVec(), px, py);
                                        numFailed += 1;
                                }
                        }
@@ -1830,7 +1830,7 @@ int computeTextureLookupDiff (const tcu::ConstPixelBufferAccess&  result,
                tcu::Vec2( 0, +1),
        };
 
-       tcu::clear(errorMask, tcu::RGBA::green.toVec());
+       tcu::clear(errorMask, tcu::RGBA::green().toVec());
 
        for (int py = 0; py < result.getHeight(); py++)
        {
@@ -1889,7 +1889,7 @@ int computeTextureLookupDiff (const tcu::ConstPixelBufferAccess&  result,
 
                                if (!isOk)
                                {
-                                       errorMask.setPixel(tcu::RGBA::red.toVec(), px, py);
+                                       errorMask.setPixel(tcu::RGBA::red().toVec(), px, py);
                                        numFailed += 1;
                                }
                        }
@@ -2023,7 +2023,7 @@ int computeTextureLookupDiff (const tcu::ConstPixelBufferAccess&  result,
                tcu::Vec2(+1, +1),
        };
 
-       tcu::clear(errorMask, tcu::RGBA::green.toVec());
+       tcu::clear(errorMask, tcu::RGBA::green().toVec());
 
        for (int py = 0; py < result.getHeight(); py++)
        {
@@ -2105,7 +2105,7 @@ int computeTextureLookupDiff (const tcu::ConstPixelBufferAccess&  result,
 
                                if (!isOk)
                                {
-                                       errorMask.setPixel(tcu::RGBA::red.toVec(), px, py);
+                                       errorMask.setPixel(tcu::RGBA::red().toVec(), px, py);
                                        numFailed += 1;
                                }
                        }
@@ -2197,7 +2197,7 @@ int computeTextureLookupDiff (const tcu::ConstPixelBufferAccess&  result,
                tcu::Vec2( 0, +1),
        };
 
-       tcu::clear(errorMask, tcu::RGBA::green.toVec());
+       tcu::clear(errorMask, tcu::RGBA::green().toVec());
 
        for (int py = 0; py < result.getHeight(); py++)
        {
@@ -2276,7 +2276,7 @@ int computeTextureLookupDiff (const tcu::ConstPixelBufferAccess&  result,
 
                                if (!isOk)
                                {
-                                       errorMask.setPixel(tcu::RGBA::red.toVec(), px, py);
+                                       errorMask.setPixel(tcu::RGBA::red().toVec(), px, py);
                                        numFailed += 1;
                                }
                        }
@@ -2364,7 +2364,7 @@ int computeTextureLookupDiff (const tcu::ConstPixelBufferAccess&  result,
                tcu::Vec2( 0, +1),
        };
 
-       tcu::clear(errorMask, tcu::RGBA::green.toVec());
+       tcu::clear(errorMask, tcu::RGBA::green().toVec());
 
        for (int py = 0; py < result.getHeight(); py++)
        {
@@ -2419,7 +2419,7 @@ int computeTextureLookupDiff (const tcu::ConstPixelBufferAccess&  result,
 
                                if (!isOk)
                                {
-                                       errorMask.setPixel(tcu::RGBA::red.toVec(), px, py);
+                                       errorMask.setPixel(tcu::RGBA::red().toVec(), px, py);
                                        numFailed += 1;
                                }
                        }
@@ -2473,7 +2473,7 @@ int computeTextureLookupDiff (const tcu::ConstPixelBufferAccess&  result,
                tcu::Vec2( 0, +1),
        };
 
-       tcu::clear(errorMask, tcu::RGBA::green.toVec());
+       tcu::clear(errorMask, tcu::RGBA::green().toVec());
 
        for (int py = 0; py < result.getHeight(); py++)
        {
@@ -2533,7 +2533,7 @@ int computeTextureLookupDiff (const tcu::ConstPixelBufferAccess&  result,
 
                                if (!isOk)
                                {
-                                       errorMask.setPixel(tcu::RGBA::red.toVec(), px, py);
+                                       errorMask.setPixel(tcu::RGBA::red().toVec(), px, py);
                                        numFailed += 1;
                                }
                        }
@@ -2670,7 +2670,7 @@ int computeTextureLookupDiff (const tcu::ConstPixelBufferAccess&  result,
                tcu::Vec2(+1, +1),
        };
 
-       tcu::clear(errorMask, tcu::RGBA::green.toVec());
+       tcu::clear(errorMask, tcu::RGBA::green().toVec());
 
        for (int py = 0; py < result.getHeight(); py++)
        {
@@ -2753,7 +2753,7 @@ int computeTextureLookupDiff (const tcu::ConstPixelBufferAccess&  result,
 
                                if (!isOk)
                                {
-                                       errorMask.setPixel(tcu::RGBA::red.toVec(), px, py);
+                                       errorMask.setPixel(tcu::RGBA::red().toVec(), px, py);
                                        numFailed += 1;
                                }
                        }
@@ -2840,7 +2840,7 @@ int computeTextureCompareDiff (const tcu::ConstPixelBufferAccess& result,
                tcu::Vec2( 0, +1),
        };
 
-       tcu::clear(errorMask, tcu::RGBA::green.toVec());
+       tcu::clear(errorMask, tcu::RGBA::green().toVec());
 
        for (int py = 0; py < result.getHeight(); py++)
        {
@@ -2852,7 +2852,7 @@ int computeTextureCompareDiff (const tcu::ConstPixelBufferAccess& result,
                        // Other channels should trivially match to reference.
                        if (!tcu::boolAll(tcu::lessThanEqual(tcu::abs(refPix.swizzle(1,2,3) - resPix.swizzle(1,2,3)), nonShadowThreshold)))
                        {
-                               errorMask.setPixel(tcu::RGBA::red.toVec(), px, py);
+                               errorMask.setPixel(tcu::RGBA::red().toVec(), px, py);
                                numFailed += 1;
                                continue;
                        }
@@ -2904,7 +2904,7 @@ int computeTextureCompareDiff (const tcu::ConstPixelBufferAccess& result,
 
                                if (!isOk)
                                {
-                                       errorMask.setPixel(tcu::RGBA::red.toVec(), px, py);
+                                       errorMask.setPixel(tcu::RGBA::red().toVec(), px, py);
                                        numFailed += 1;
                                }
                        }
@@ -2954,7 +2954,7 @@ int computeTextureCompareDiff (const tcu::ConstPixelBufferAccess& result,
                tcu::Vec2( 0, +1),
        };
 
-       tcu::clear(errorMask, tcu::RGBA::green.toVec());
+       tcu::clear(errorMask, tcu::RGBA::green().toVec());
 
        for (int py = 0; py < result.getHeight(); py++)
        {
@@ -2966,7 +2966,7 @@ int computeTextureCompareDiff (const tcu::ConstPixelBufferAccess& result,
                        // Other channels should trivially match to reference.
                        if (!tcu::boolAll(tcu::lessThanEqual(tcu::abs(refPix.swizzle(1,2,3) - resPix.swizzle(1,2,3)), nonShadowThreshold)))
                        {
-                               errorMask.setPixel(tcu::RGBA::red.toVec(), px, py);
+                               errorMask.setPixel(tcu::RGBA::red().toVec(), px, py);
                                numFailed += 1;
                                continue;
                        }
@@ -3026,7 +3026,7 @@ int computeTextureCompareDiff (const tcu::ConstPixelBufferAccess& result,
 
                                if (!isOk)
                                {
-                                       errorMask.setPixel(tcu::RGBA::red.toVec(), px, py);
+                                       errorMask.setPixel(tcu::RGBA::red().toVec(), px, py);
                                        numFailed += 1;
                                }
                        }
@@ -3076,7 +3076,7 @@ int computeTextureCompareDiff (const tcu::ConstPixelBufferAccess& result,
                tcu::Vec2( 0, +1),
        };
 
-       tcu::clear(errorMask, tcu::RGBA::green.toVec());
+       tcu::clear(errorMask, tcu::RGBA::green().toVec());
 
        for (int py = 0; py < result.getHeight(); py++)
        {
@@ -3088,7 +3088,7 @@ int computeTextureCompareDiff (const tcu::ConstPixelBufferAccess& result,
                        // Other channels should trivially match to reference.
                        if (!tcu::boolAll(tcu::lessThanEqual(tcu::abs(refPix.swizzle(1,2,3) - resPix.swizzle(1,2,3)), nonShadowThreshold)))
                        {
-                               errorMask.setPixel(tcu::RGBA::red.toVec(), px, py);
+                               errorMask.setPixel(tcu::RGBA::red().toVec(), px, py);
                                numFailed += 1;
                                continue;
                        }
@@ -3141,7 +3141,7 @@ int computeTextureCompareDiff (const tcu::ConstPixelBufferAccess& result,
 
                                if (!isOk)
                                {
-                                       errorMask.setPixel(tcu::RGBA::red.toVec(), px, py);
+                                       errorMask.setPixel(tcu::RGBA::red().toVec(), px, py);
                                        numFailed += 1;
                                }
                        }
@@ -3181,7 +3181,7 @@ static int compareGenMipmapBilinear (const tcu::ConstPixelBufferAccess& dst, con
                const float             cy              = (float(y)+0.5f) / dstH * srcH;
                const bool              isOk    = tcu::isLinearSampleResultValid(src, sampler, lookupPrec, tcu::Vec2(cx, cy), 0, result);
 
-               errorMask.setPixel(isOk ? tcu::RGBA::green.toVec() : tcu::RGBA::red.toVec(), x, y);
+               errorMask.setPixel(isOk ? tcu::RGBA::green().toVec() : tcu::RGBA::red().toVec(), x, y);
                if (!isOk)
                        numFailed += 1;
        }
@@ -3217,7 +3217,7 @@ static int compareGenMipmapBox (const tcu::ConstPixelBufferAccess& dst, const tc
                const float             cy              = deFloatFloor(float(y) / dstH * srcH) + 1.0f;
                const bool              isOk    = tcu::isLinearSampleResultValid(src, sampler, lookupPrec, tcu::Vec2(cx, cy), 0, result);
 
-               errorMask.setPixel(isOk ? tcu::RGBA::green.toVec() : tcu::RGBA::red.toVec(), x, y);
+               errorMask.setPixel(isOk ? tcu::RGBA::green().toVec() : tcu::RGBA::red().toVec(), x, y);
                if (!isOk)
                        numFailed += 1;
        }
@@ -3272,7 +3272,7 @@ static int compareGenMipmapVeryLenient (const tcu::ConstPixelBufferAccess& dst,
 
                isOk = boolAll(logicalAnd(lessThanEqual(minVal, result), lessThanEqual(result, maxVal)));
 
-               errorMask.setPixel(isOk ? tcu::RGBA::green.toVec() : tcu::RGBA::red.toVec(), x, y);
+               errorMask.setPixel(isOk ? tcu::RGBA::green().toVec() : tcu::RGBA::red().toVec(), x, y);
                if (!isOk)
                        numFailed += 1;
        }
index fd272bf..e766c52 100644 (file)
@@ -1933,7 +1933,7 @@ bool UniformBlockCase::render (deUint32 program) const
                {
                        for (int x = 0; x < pixels.getWidth(); x++)
                        {
-                               if (pixels.getPixel(x, y) != tcu::RGBA::white)
+                               if (pixels.getPixel(x, y) != tcu::RGBA::white())
                                        numFailedPixels += 1;
                        }
                }