From 4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 11 Jul 2018 18:11:13 +0200 Subject: Roll back to ANGLE/2845 --- gfx/angle/src/tests/test_utils/ANGLETest.cpp | 71 +++++++++++++++------------- 1 file changed, 39 insertions(+), 32 deletions(-) (limited to 'gfx/angle/src/tests/test_utils/ANGLETest.cpp') diff --git a/gfx/angle/src/tests/test_utils/ANGLETest.cpp b/gfx/angle/src/tests/test_utils/ANGLETest.cpp index 77f1d8dec..1a9d8b50f 100755 --- a/gfx/angle/src/tests/test_utils/ANGLETest.cpp +++ b/gfx/angle/src/tests/test_utils/ANGLETest.cpp @@ -30,6 +30,8 @@ const GLColor GLColor::transparentBlack = GLColor(0u, 0u, 0u, 0u); const GLColor GLColor::white = GLColor(255u, 255u, 255u, 255u); const GLColor GLColor::yellow = GLColor(255u, 255u, 0, 255u); +const GLColor16 GLColor16::white = GLColor16(65535u, 65535u, 65535u, 65535u); + namespace { float ColorNorm(GLubyte channelValue) @@ -136,6 +138,14 @@ GLColor::GLColor(const Vector4 &floatColor) { } +GLColor::GLColor(const GLColor16 &color16) + : R(static_cast(color16.R)), + G(static_cast(color16.G)), + B(static_cast(color16.B)), + A(static_cast(color16.A)) +{ +} + GLColor::GLColor(GLuint colorValue) : R(0), G(0), B(0), A(0) { memcpy(&R, &colorValue, sizeof(GLuint)); @@ -167,6 +177,35 @@ std::ostream &operator<<(std::ostream &ostream, const GLColor &color) return ostream; } +GLColor16::GLColor16() : R(0), G(0), B(0), A(0) +{ +} + +GLColor16::GLColor16(GLushort r, GLushort g, GLushort b, GLushort a) : R(r), G(g), B(b), A(a) +{ +} + +GLColor16 ReadColor16(GLint x, GLint y) +{ + GLColor16 actual; + glReadPixels((x), (y), 1, 1, GL_RGBA, GL_UNSIGNED_SHORT, &actual.R); + EXPECT_GL_NO_ERROR(); + return actual; +} + +bool operator==(const GLColor16 &a, const GLColor16 &b) +{ + return a.R == b.R && a.G == b.G && a.B == b.B && a.A == b.A; +} + +std::ostream &operator<<(std::ostream &ostream, const GLColor16 &color) +{ + ostream << "(" << static_cast(color.R) << ", " + << static_cast(color.G) << ", " << static_cast(color.B) + << ", " << static_cast(color.A) << ")"; + return ostream; +} + } // namespace angle // static @@ -549,14 +588,6 @@ bool ANGLETest::eglClientExtensionEnabled(const std::string &extName) return checkExtensionExists(eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS), extName); } -bool ANGLETest::eglDeviceExtensionEnabled(EGLDeviceEXT device, const std::string &extName) -{ - PFNEGLQUERYDEVICESTRINGEXTPROC eglQueryDeviceStringEXT = - reinterpret_cast( - eglGetProcAddress("eglQueryDeviceStringEXT")); - return checkExtensionExists(eglQueryDeviceStringEXT(device, EGL_EXTENSIONS), extName); -} - void ANGLETest::setWindowWidth(int width) { mWidth = width; @@ -612,16 +643,6 @@ void ANGLETest::setNoErrorEnabled(bool enabled) mEGLWindow->setNoErrorEnabled(enabled); } -void ANGLETest::setWebGLCompatibilityEnabled(bool webglCompatibility) -{ - mEGLWindow->setWebGLCompatibilityEnabled(webglCompatibility); -} - -void ANGLETest::setBindGeneratesResource(bool bindGeneratesResource) -{ - mEGLWindow->setBindGeneratesResource(bindGeneratesResource); -} - int ANGLETest::getClientMajorVersion() const { return mEGLWindow->getClientMajorVersion(); @@ -794,20 +815,6 @@ bool IsWindows() #endif } -bool IsDebug() -{ -#if !defined(NDEBUG) - return true; -#else - return false; -#endif -} - -bool IsRelease() -{ - return !IsDebug(); -} - EGLint ANGLETest::getPlatformRenderer() const { assert(mEGLWindow); -- cgit v1.2.3