summaryrefslogtreecommitdiffstats
path: root/gfx/angle/src/tests/test_utils/ANGLETest.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-07-11 18:11:13 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-07-11 18:11:13 +0200
commit4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0 (patch)
treef000dd831240707a03b8c806db292c2a15cde3ce /gfx/angle/src/tests/test_utils/ANGLETest.cpp
parent3b7ffb477eec078c7036c92c6a51bb5de6de4f28 (diff)
downloadUXP-4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0.tar
UXP-4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0.tar.gz
UXP-4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0.tar.lz
UXP-4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0.tar.xz
UXP-4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0.zip
Roll back to ANGLE/2845
Diffstat (limited to 'gfx/angle/src/tests/test_utils/ANGLETest.cpp')
-rwxr-xr-xgfx/angle/src/tests/test_utils/ANGLETest.cpp71
1 files changed, 39 insertions, 32 deletions
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<GLubyte>(color16.R)),
+ G(static_cast<GLubyte>(color16.G)),
+ B(static_cast<GLubyte>(color16.B)),
+ A(static_cast<GLubyte>(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<unsigned int>(color.R) << ", "
+ << static_cast<unsigned int>(color.G) << ", " << static_cast<unsigned int>(color.B)
+ << ", " << static_cast<unsigned int>(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<PFNEGLQUERYDEVICESTRINGEXTPROC>(
- 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);