attribs.push_back(128);
attribs.push_back(EGL_HEIGHT);
attribs.push_back(128);
- if (m_colorSpace)
+ if (m_colorSpace != EGL_NONE)
{
attribs.push_back(EGL_GL_COLORSPACE_KHR);
attribs.push_back(m_colorSpace);
de::UniquePtr<eglu::NativeWindow> window (windowFactory.createWindow(&nativeDisplay, m_eglDisplay, m_eglConfig, DE_NULL, eglu::WindowParams(128, 128, eglu::parseWindowVisibility(m_testCtx.getCommandLine()))));
std::vector<EGLAttrib> attribs;
- if (m_colorSpace)
+ if (m_colorSpace != EGL_NONE)
{
attribs.push_back(EGL_GL_COLORSPACE_KHR);
attribs.push_back(m_colorSpace);
attribs.push_back(EGL_NONE);
attribs.push_back(EGL_NONE);
- const EGLSurface surface = eglu::createWindowSurface(nativeDisplay, *window, m_eglDisplay, m_eglConfig, attribs.data());
+ EGLSurface surface;
+ try
+ {
+ surface = eglu::createWindowSurface(nativeDisplay, *window, m_eglDisplay, m_eglConfig, attribs.data());
+ }
+ catch (const eglu::Error& error)
+ {
+ if (error.getError() == EGL_BAD_MATCH)
+ TCU_THROW(NotSupportedError, "createWindowSurface is not supported for this config");
+
+ throw;
+ }
TCU_CHECK(surface != EGL_NO_SURFACE);
EGLU_CHECK_MSG(egl, "eglCreateWindowSurface()");