summaryrefslogtreecommitdiffstats
path: root/gfx/angle/src/tests/test_utils/ANGLETest.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-07-18 08:24:24 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-07-18 08:24:24 +0200
commitfc61780b35af913801d72086456f493f63197da6 (patch)
treef85891288a7bd988da9f0f15ae64e5c63f00d493 /gfx/angle/src/tests/test_utils/ANGLETest.cpp
parent69f7f9e5f1475891ce11cc4f431692f965b0cd30 (diff)
parent50d3e596bbe89c95615f96eb71f6bc5be737a1db (diff)
downloadUXP-2018.07.18.tar
UXP-2018.07.18.tar.gz
UXP-2018.07.18.tar.lz
UXP-2018.07.18.tar.xz
UXP-2018.07.18.zip
Merge commit '50d3e596bbe89c95615f96eb71f6bc5be737a1db' into Basilisk-releasev2018.07.18
# Conflicts: # browser/app/profile/firefox.js # browser/components/preferences/jar.mn
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);