dEQP-EGL.functional.create_surface.pbuffer.rgba8888_depth_no_stencil
dEQP-EGL.functional.create_surface.pbuffer.rgba8888_depth_stencil
dEQP-EGL.functional.create_surface.pbuffer.other
+dEQP-EGL.functional.create_surface.platform_ext_window.rgb565_no_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgb565_no_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgb565_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgb565_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgb888_no_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgb888_no_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgb888_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgb888_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba4444_no_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba4444_no_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba4444_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba4444_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba5551_no_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba5551_no_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba5551_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba5551_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba8888_no_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba8888_no_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba8888_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba8888_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.other
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgb565_no_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgb565_no_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgb565_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgb565_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgb888_no_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgb888_no_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgb888_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgb888_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba4444_no_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba4444_no_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba4444_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba4444_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba5551_no_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba5551_no_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba5551_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba5551_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba8888_no_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba8888_no_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba8888_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba8888_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.other
dEQP-EGL.functional.create_surface.platform_window.rgb565_no_depth_no_stencil
dEQP-EGL.functional.create_surface.platform_window.rgb565_no_depth_stencil
dEQP-EGL.functional.create_surface.platform_window.rgb565_depth_no_stencil
dEQP-EGL.functional.create_surface.pbuffer.rgba8888_depth_no_stencil
dEQP-EGL.functional.create_surface.pbuffer.rgba8888_depth_stencil
dEQP-EGL.functional.create_surface.pbuffer.other
+dEQP-EGL.functional.create_surface.platform_ext_window.rgb565_no_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgb565_no_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgb565_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgb565_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgb888_no_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgb888_no_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgb888_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgb888_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba4444_no_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba4444_no_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba4444_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba4444_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba5551_no_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba5551_no_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba5551_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba5551_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba8888_no_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba8888_no_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba8888_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba8888_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.other
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgb565_no_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgb565_no_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgb565_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgb565_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgb888_no_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgb888_no_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgb888_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgb888_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba4444_no_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba4444_no_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba4444_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba4444_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba5551_no_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba5551_no_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba5551_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba5551_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba8888_no_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba8888_no_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba8888_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba8888_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.other
dEQP-EGL.functional.create_surface.platform_window.rgb565_no_depth_no_stencil
dEQP-EGL.functional.create_surface.platform_window.rgb565_no_depth_stencil
dEQP-EGL.functional.create_surface.platform_window.rgb565_depth_no_stencil
dEQP-EGL.functional.create_surface.pbuffer.rgba8888_depth_no_stencil
dEQP-EGL.functional.create_surface.pbuffer.rgba8888_depth_stencil
dEQP-EGL.functional.create_surface.pbuffer.other
+dEQP-EGL.functional.create_surface.platform_ext_window.rgb565_no_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgb565_no_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgb565_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgb565_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgb888_no_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgb888_no_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgb888_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgb888_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba4444_no_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba4444_no_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba4444_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba4444_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba5551_no_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba5551_no_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba5551_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba5551_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba8888_no_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba8888_no_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba8888_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.rgba8888_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_window.other
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgb565_no_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgb565_no_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgb565_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgb565_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgb888_no_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgb888_no_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgb888_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgb888_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba4444_no_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba4444_no_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba4444_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba4444_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba5551_no_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba5551_no_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba5551_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba5551_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba8888_no_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba8888_no_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba8888_depth_no_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.rgba8888_depth_stencil
+dEQP-EGL.functional.create_surface.platform_ext_pixmap.other
dEQP-EGL.functional.create_surface.platform_window.rgb565_no_depth_no_stencil
dEQP-EGL.functional.create_surface.platform_window.rgb565_no_depth_stencil
dEQP-EGL.functional.create_surface.platform_window.rgb565_depth_no_stencil
throw tcu::NotSupportedError("eglu::NativePixmap doesn't support eglCreatePlatformPixmapSurfaceEXT()", DE_NULL, __FILE__, __LINE__);
}
+void* NativePixmap::getPlatformNative (void)
+{
+ TCU_CHECK_INTERNAL((m_capabilities & CAPABILITY_CREATE_SURFACE_PLATFORM) == 0);
+ throw tcu::NotSupportedError("eglu::NativePixmap doesn't support eglCreatePlatformPixmapSurface()", DE_NULL, __FILE__, __LINE__);
+}
+
void NativePixmap::readPixels (tcu::TextureLevel*)
{
TCU_CHECK_INTERNAL((m_capabilities & CAPABILITY_READ_PIXELS) == 0);
enum Capability
{
CAPABILITY_CREATE_SURFACE_LEGACY = (1<<0), //!< EGL surface can be created with eglCreatePixmapSurface()
- CAPABILITY_CREATE_SURFACE_PLATFORM_EXTENSION = (1<<1), //!< EGL surface can be created with eglCreatePlatformPixmapSurfaceEXT()
- CAPABILITY_READ_PIXELS = (1<<2)
+ CAPABILITY_CREATE_SURFACE_PLATFORM = (1<<1), //!< EGL surface can be created with eglCreatePlatformPixmapSurface()
+ CAPABILITY_CREATE_SURFACE_PLATFORM_EXTENSION = (1<<2), //!< EGL surface can be created with eglCreatePlatformPixmapSurfaceEXT()
+ CAPABILITY_READ_PIXELS = (1<<3)
};
virtual ~NativePixmap (void) {}
//! Return EGLNativePixmapType that can be used with eglCreatePixmapSurface(). Default implementation throws tcu::NotSupportedError().
virtual eglw::EGLNativePixmapType getLegacyNative (void);
+ //! Return native pointer that can be used with eglCreatePlatformPixmapSurface(). Default implementation throws tcu::NotSupportedError().
+ virtual void* getPlatformNative (void);
+
//! Return native pointer that can be used with eglCreatePlatformPixmapSurfaceEXT(). Default implementation throws tcu::NotSupportedError().
virtual void* getPlatformExtension (void);
throw tcu::NotSupportedError("eglu::NativeWindow doesn't support eglCreatePlatformWindowSurfaceEXT()", DE_NULL, __FILE__, __LINE__);
}
+void* NativeWindow::getPlatformNative (void)
+{
+ TCU_CHECK_INTERNAL((m_capabilities & CAPABILITY_CREATE_SURFACE_PLATFORM) == 0);
+ throw tcu::NotSupportedError("eglu::NativeWindow doesn't support eglCreatePlatformWindowSurface()", DE_NULL, __FILE__, __LINE__);
+}
+
tcu::IVec2 NativeWindow::getSurfaceSize (void) const
{
TCU_CHECK_INTERNAL((m_capabilities & CAPABILITY_GET_SURFACE_SIZE) == 0);
{
CAPABILITY_CREATE_SURFACE_LEGACY = (1<<0), //!< EGL surface can be created with eglCreateWindowSurface()
CAPABILITY_CREATE_SURFACE_PLATFORM_EXTENSION = (1<<1), //!< EGL surface can be created with eglCreatePlatformWindowSurfaceEXT()
- CAPABILITY_GET_SURFACE_SIZE = (1<<2),
- CAPABILITY_SET_SURFACE_SIZE = (1<<3),
- CAPABILITY_GET_SCREEN_SIZE = (1<<4),
- CAPABILITY_READ_SCREEN_PIXELS = (1<<5),
- CAPABILITY_CHANGE_VISIBILITY = (1<<6)
+ CAPABILITY_CREATE_SURFACE_PLATFORM = (1<<2), //!< EGL surface can be created with eglCreatePlatformWindowSurface()
+ CAPABILITY_GET_SURFACE_SIZE = (1<<3),
+ CAPABILITY_SET_SURFACE_SIZE = (1<<4),
+ CAPABILITY_GET_SCREEN_SIZE = (1<<5),
+ CAPABILITY_READ_SCREEN_PIXELS = (1<<6),
+ CAPABILITY_CHANGE_VISIBILITY = (1<<7)
};
virtual ~NativeWindow (void) {}
//! Return native pointer that can be used with eglCreatePlatformWindowSurfaceEXT(). Default implementation throws tcu::NotSupportedError().
virtual void* getPlatformExtension (void);
+ //! Return native pointer that can be used with eglCreatePlatformWindowSurface(). Default implementation throws tcu::NotSupportedError().
+ virtual void* getPlatformNative (void);
+
// Process window events. Defaults to dummy implementation, that does nothing.
virtual void processEvents (void) {}
vector<string> getClientExtensions (const Library& egl)
{
- return getExtensions(egl, EGL_NO_DISPLAY);
+ const char* const extensionStr = egl.queryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
+ const EGLint eglError = egl.getError();
+ if (eglError == EGL_BAD_DISPLAY && extensionStr == DE_NULL) {
+ // We do not support client extensions
+ TCU_THROW(NotSupportedError, "EGL_EXT_client_extensions not supported");
+ }
+
+ EGLU_CHECK_MSG(egl, "Querying extensions failed");
+
+ return de::splitString(extensionStr, ' ');
}
vector<string> getDisplayExtensions (const Library& egl, EGLDisplay display)
EGLU_CHECK_CALL(egl, terminate(display));
}
-//! Create EGL window surface using eglCreateWindowSurface() or eglCreatePlatformWindowSurfaceEXT()
+//! Create EGL window surface using eglCreatePlatformWindowSurface, eglCreateWindowSurface() or eglCreatePlatformWindowSurfaceEXT()
EGLSurface createWindowSurface (NativeDisplay& nativeDisplay, NativeWindow& window, EGLDisplay display, EGLConfig config, const EGLAttrib* attribList)
{
const Library& egl = nativeDisplay.getLibrary();
const bool supportsLegacyCreate = (window.getCapabilities() & NativeWindow::CAPABILITY_CREATE_SURFACE_LEGACY) != 0;
+ const bool supportsPlatformCreate = ((window.getCapabilities() & NativeWindow::CAPABILITY_CREATE_SURFACE_PLATFORM) != 0
+ && eglu::getVersion(egl, display) >= eglu::Version(1, 5));
const bool supportsPlatformCreateExtension = (window.getCapabilities() & NativeWindow::CAPABILITY_CREATE_SURFACE_PLATFORM_EXTENSION) != 0;
bool usePlatformExt = false;
EGLSurface surface = EGL_NO_SURFACE;
- TCU_CHECK_INTERNAL(supportsLegacyCreate || supportsPlatformCreateExtension);
+ TCU_CHECK_INTERNAL(supportsLegacyCreate || supportsPlatformCreateExtension || supportsPlatformCreate);
if (supportsPlatformCreateExtension)
{
de::contains(platformExts.begin(), platformExts.end(), string(nativeDisplay.getPlatformExtensionName()));
}
- // \todo [2014-03-13 pyry] EGL 1.5 core support
- if (usePlatformExt)
+ if (supportsPlatformCreate)
+ {
+ surface = egl.createPlatformWindowSurface(display, config, window.getPlatformNative(), attribList);
+ EGLU_CHECK_MSG(egl, "eglCreatePlatformWindowSurface()");
+ TCU_CHECK(surface != EGL_NO_SURFACE);
+ }
+ else if (usePlatformExt)
{
const vector<EGLint> legacyAttribs = toLegacyAttribList(attribList);
-
surface = egl.createPlatformWindowSurfaceEXT(display, config, window.getPlatformExtension(), &legacyAttribs[0]);
EGLU_CHECK_MSG(egl, "eglCreatePlatformWindowSurfaceEXT()");
TCU_CHECK(surface != EGL_NO_SURFACE);
const Library& egl = nativeDisplay.getLibrary();
const bool supportsLegacyCreate = (pixmap.getCapabilities() & NativePixmap::CAPABILITY_CREATE_SURFACE_LEGACY) != 0;
const bool supportsPlatformCreateExtension = (pixmap.getCapabilities() & NativePixmap::CAPABILITY_CREATE_SURFACE_PLATFORM_EXTENSION) != 0;
+ const bool supportsPlatformCreate = ((pixmap.getCapabilities() & NativePixmap::CAPABILITY_CREATE_SURFACE_PLATFORM) != 0
+ && eglu::getVersion(egl, display) >= eglu::Version(1, 5));
bool usePlatformExt = false;
EGLSurface surface = EGL_NO_SURFACE;
- TCU_CHECK_INTERNAL(supportsLegacyCreate || supportsPlatformCreateExtension);
+ TCU_CHECK_INTERNAL(supportsLegacyCreate || supportsPlatformCreateExtension || supportsPlatformCreate);
if (supportsPlatformCreateExtension)
{
de::contains(platformExts.begin(), platformExts.end(), string(nativeDisplay.getPlatformExtensionName()));
}
- if (usePlatformExt)
+ if (supportsPlatformCreate)
+ {
+ surface = egl.createPlatformPixmapSurface(display, config, pixmap.getPlatformNative(), attribList);
+ EGLU_CHECK_MSG(egl, "eglCreatePlatformPixmapSurface()");
+ TCU_CHECK(surface != EGL_NO_SURFACE);
+ }
+ else if (usePlatformExt)
{
const vector<EGLint> legacyAttribs = toLegacyAttribList(attribList);
static const eglu::NativeDisplay::Capability DISPLAY_CAPABILITIES = eglu::NativeDisplay::CAPABILITY_GET_DISPLAY_LEGACY;
static const eglu::NativeWindow::Capability WINDOW_CAPABILITIES = (eglu::NativeWindow::Capability)(eglu::NativeWindow::CAPABILITY_CREATE_SURFACE_LEGACY |
+ eglu::NativeWindow::CAPABILITY_CREATE_SURFACE_PLATFORM |
+ eglu::NativeWindow::CAPABILITY_CREATE_SURFACE_PLATFORM_EXTENSION |
eglu::NativeWindow::CAPABILITY_SET_SURFACE_SIZE |
eglu::NativeWindow::CAPABILITY_GET_SCREEN_SIZE);
virtual ~NativeWindow (void);
virtual EGLNativeWindowType getLegacyNative (void) { return m_window->getNativeWindow(); }
+ virtual EGLNativeWindowType getPlatformExtension (void) { return m_window->getNativeWindow(); }
+ virtual EGLNativeWindowType getPlatformNative (void) { return m_window->getNativeWindow(); }
IVec2 getScreenSize (void) const { return m_window->getSize(); }
void setSurfaceSize (IVec2 size);
, m_display (x11Display) {}
void* getPlatformNative (void) { return m_display->getXDisplay(); }
+ eglw::EGLNativeDisplayType getPlatformExtension (void) { return reinterpret_cast<eglw::EGLNativeDisplayType>(m_display->getXDisplay()); }
eglw::EGLNativeDisplayType getLegacyNative (void) { return reinterpret_cast<eglw::EGLNativeDisplayType>(m_display->getXDisplay()); }
XlibDisplay& getX11Display (void) { return *m_display; }
{
public:
static const Capability CAPABILITIES = Capability(CAPABILITY_CREATE_SURFACE_LEGACY |
+ CAPABILITY_CREATE_SURFACE_PLATFORM |
CAPABILITY_CREATE_SURFACE_PLATFORM_EXTENSION |
CAPABILITY_GET_SURFACE_SIZE |
CAPABILITY_SET_SURFACE_SIZE |
const WindowParams& params,
Visual* visual);
- eglw::EGLNativeWindowType getLegacyNative (void) { return reinterpret_cast<eglw::EGLNativeWindowType>(m_window.getXID()); }
- void* getPlatformNative (void) { return &m_window.getXID(); }
+ eglw::EGLNativeWindowType getLegacyNative (void) { return reinterpret_cast<eglw::EGLNativeWindowType>(m_window.getXID()); }
+ void* getPlatformExtension (void) { return &m_window.getXID(); }
+ void* getPlatformNative (void) { return &m_window.getXID(); }
IVec2 getSurfaceSize (void) const;
void setSurfaceSize (IVec2 size);
#include "tcuCommandLine.hpp"
#include "tcuTestLog.hpp"
+#include "deStringUtil.hpp"
#include "deSTLUtil.hpp"
#include "deUniquePtr.hpp"
namespace
{
-void checkEGLPlatformSupport (const Library& egl, const char* platformExt)
+#define EGL_MAKE_VERSION(major, minor) (((major) << 12) | (minor))
+
+enum ApiType
+{
+ LEGACY,
+ EXTENSION,
+ EGL15
+};
+
+void checkEGLPlatformSupport (const Library& egl)
{
- std::vector<std::string> extensions = eglu::getClientExtensions(egl);
+ const vector<std::string> extensions = eglu::getClientExtensions(egl);
+ if (!de::contains(extensions.begin(), extensions.end(), "EGL_EXT_platform_base"))
+ throw tcu::NotSupportedError("Platform extension 'EGL_EXT_platform_base' not supported", "", __FILE__, __LINE__);
+}
- if (!de::contains(extensions.begin(), extensions.end(), platformExt))
- throw tcu::NotSupportedError((std::string("Platform extension '") + platformExt + "' not supported").c_str(), "", __FILE__, __LINE__);
+void checkEGL15Support (const Library& egl, EGLDisplay display)
+{
+ // The EGL_VERSION string is laid out as follows:
+ // major_version.minor_version space vendor_specific_info
+ // Split version from vendor_specific_info
+ std::vector<std::string> tokens = de::splitString(egl.queryString(display, EGL_VERSION), ' ');
+ // split version into major & minor
+ std::vector<std::string> values = de::splitString(tokens[0], '.');
+ EGLint eglVersion = EGL_MAKE_VERSION(atoi(values[0].c_str()), atoi(values[1].c_str()));
+ if (eglVersion < EGL_MAKE_VERSION(1, 5))
+ throw tcu::NotSupportedError("EGL 1.5 not supported", "", __FILE__, __LINE__);
}
-EGLSurface createWindowSurface (EGLDisplay display, EGLConfig config, eglu::NativeDisplay& nativeDisplay, eglu::NativeWindow& window, bool useLegacyCreate)
+EGLSurface createWindowSurface (EGLDisplay display, EGLConfig config, eglu::NativeDisplay& nativeDisplay, eglu::NativeWindow& window, ApiType createType)
{
const Library& egl = nativeDisplay.getLibrary();
EGLSurface surface = EGL_NO_SURFACE;
- if (useLegacyCreate)
- {
- surface = egl.createWindowSurface(display, config, window.getLegacyNative(), DE_NULL);
- EGLU_CHECK_MSG(egl, "eglCreateWindowSurface() failed");
- }
- else
+ switch (createType)
{
- checkEGLPlatformSupport(egl, nativeDisplay.getPlatformExtensionName());
-
- surface = egl.createPlatformWindowSurfaceEXT(display, config, window.getPlatformExtension(), DE_NULL);
- EGLU_CHECK_MSG(egl, "eglCreatePlatformWindowSurfaceEXT() failed");
+ case LEGACY:
+ {
+ surface = egl.createWindowSurface(display, config, window.getLegacyNative(), DE_NULL);
+ EGLU_CHECK_MSG(egl, "eglCreateWindowSurface() failed");
+ }
+ break;
+ case EXTENSION:
+ {
+ checkEGLPlatformSupport(egl);
+ void *nativeWindow = window.getPlatformExtension();
+ surface = egl.createPlatformWindowSurfaceEXT(display, config, nativeWindow, DE_NULL);
+ EGLU_CHECK_MSG(egl, "eglCreatePlatformWindowSurfaceEXT() failed");
+ }
+ break;
+ case EGL15:
+ {
+ checkEGL15Support(egl, display);
+ surface = egl.createPlatformWindowSurface(display, config, window.getPlatformNative(), DE_NULL);
+ EGLU_CHECK_MSG(egl, "eglCreatePlatformWindowSurface() failed");
+ }
}
return surface;
}
-EGLSurface createPixmapSurface (EGLDisplay display, EGLConfig config, eglu::NativeDisplay& nativeDisplay, eglu::NativePixmap& pixmap, bool useLegacyCreate)
+EGLSurface createPixmapSurface (EGLDisplay display, EGLConfig config, eglu::NativeDisplay& nativeDisplay, eglu::NativePixmap& pixmap, ApiType createType)
{
const Library& egl = nativeDisplay.getLibrary();
EGLSurface surface = EGL_NO_SURFACE;
- if (useLegacyCreate)
+ switch (createType)
{
- surface = egl.createPixmapSurface(display, config, pixmap.getLegacyNative(), DE_NULL);
- EGLU_CHECK_MSG(egl, "eglCreatePixmapSurface() failed");
- }
- else
- {
- checkEGLPlatformSupport(egl, nativeDisplay.getPlatformExtensionName());
-
- surface = egl.createPlatformPixmapSurfaceEXT(display, config, pixmap.getPlatformExtension(), DE_NULL);
- EGLU_CHECK_MSG(egl, "eglCreatePlatformPixmapSurfaceEXT() failed");
+ case LEGACY:
+ surface = egl.createPixmapSurface(display, config, pixmap.getLegacyNative(), DE_NULL);
+ EGLU_CHECK_MSG(egl, "eglCreatePixmapSurface() failed");
+ break;
+ case EXTENSION:
+ checkEGLPlatformSupport(egl);
+ surface = egl.createPlatformPixmapSurfaceEXT(display, config, pixmap.getPlatformExtension(), DE_NULL);
+ EGLU_CHECK_MSG(egl, "eglCreatePlatformPixmapSurfaceEXT() failed");
+ break;
+ case EGL15:
+ surface = egl.createPlatformPixmapSurface(display, config, pixmap.getPlatformNative(), DE_NULL);
+ EGLU_CHECK_MSG(egl, "eglCreatePlatformPixmapSurface() failed");
+ break;
}
return surface;
class CreateWindowSurfaceCase : public SimpleConfigCase
{
public:
- CreateWindowSurfaceCase (EglTestContext& eglTestCtx, const char* name, const char* description, bool useLegacyCreate, const eglu::FilterList& filters)
+ CreateWindowSurfaceCase (EglTestContext& eglTestCtx, const char* name, const char* description, ApiType createType, const eglu::FilterList& filters)
: SimpleConfigCase (eglTestCtx, name, description, filters)
- , m_useLegacyCreate (useLegacyCreate)
+ , m_createType (createType)
{
}
// \todo [2011-03-23 pyry] Iterate thru all possible combinations of EGL_RENDER_BUFFER, EGL_VG_COLORSPACE and EGL_VG_ALPHA_FORMAT
- if (m_useLegacyCreate)
- {
- if ((windowFactory.getCapabilities() & eglu::NativeWindow::CAPABILITY_CREATE_SURFACE_LEGACY) == 0)
- TCU_THROW(NotSupportedError, "Native window doesn't support legacy eglCreateWindowSurface()");
- }
- else
+ switch (m_createType)
{
- if ((windowFactory.getCapabilities() & eglu::NativeWindow::CAPABILITY_CREATE_SURFACE_PLATFORM_EXTENSION) == 0)
- TCU_THROW(NotSupportedError, "Native window doesn't support eglCreatePlatformWindowSurfaceEXT()");
+ case LEGACY:
+ {
+ if ((windowFactory.getCapabilities() & eglu::NativeWindow::CAPABILITY_CREATE_SURFACE_LEGACY) == 0)
+ TCU_THROW(NotSupportedError, "Native window doesn't support legacy eglCreateWindowSurface()");
+ }
+ break;
+ case EXTENSION:
+ {
+ if ((windowFactory.getCapabilities() & eglu::NativeWindow::CAPABILITY_CREATE_SURFACE_PLATFORM_EXTENSION) == 0)
+ TCU_THROW(NotSupportedError, "Native window doesn't support eglCreatePlatformWindowSurfaceEXT()");
+ }
+ break;
+ case EGL15:
+ {
+ if ((windowFactory.getCapabilities() & eglu::NativeWindow::CAPABILITY_CREATE_SURFACE_PLATFORM) == 0)
+ TCU_THROW(NotSupportedError, "Native window doesn't support eglCreatePlatformWindowSurface()");
+ }
+ break;
}
log << TestLog::Message << "Creating window surface with config ID " << id << TestLog::EndMessage;
const int width = 64;
const int height = 64;
de::UniquePtr<eglu::NativeWindow> window (windowFactory.createWindow(&m_eglTestCtx.getNativeDisplay(), display, config, DE_NULL, eglu::WindowParams(width, height, eglu::parseWindowVisibility(m_testCtx.getCommandLine()))));
- eglu::UniqueSurface surface (egl, display, createWindowSurface(display, config, m_eglTestCtx.getNativeDisplay(), *window, m_useLegacyCreate));
+ eglu::UniqueSurface surface (egl, display, createWindowSurface(display, config, m_eglTestCtx.getNativeDisplay(), *window, m_createType));
EGLint windowWidth = 0;
EGLint windowHeight = 0;
}
private:
- bool m_useLegacyCreate;
+ ApiType m_createType;
};
class CreatePixmapSurfaceCase : public SimpleConfigCase
{
public:
- CreatePixmapSurfaceCase (EglTestContext& eglTestCtx, const char* name, const char* description, bool useLegacyCreate, const eglu::FilterList& filters)
+ CreatePixmapSurfaceCase (EglTestContext& eglTestCtx, const char* name, const char* description, ApiType createType, const eglu::FilterList& filters)
: SimpleConfigCase(eglTestCtx, name, description, filters)
- , m_useLegacyCreate (useLegacyCreate)
+ , m_createType (createType)
{
}
// \todo [2011-03-23 pyry] Iterate thru all possible combinations of EGL_RENDER_BUFFER, EGL_VG_COLORSPACE and EGL_VG_ALPHA_FORMAT
- if (m_useLegacyCreate)
+ switch (m_createType)
{
- if ((pixmapFactory.getCapabilities() & eglu::NativePixmap::CAPABILITY_CREATE_SURFACE_LEGACY) == 0)
- TCU_THROW(NotSupportedError, "Native pixmap doesn't support legacy eglCreatePixmapSurface()");
- }
- else
- {
- if ((pixmapFactory.getCapabilities() & eglu::NativePixmap::CAPABILITY_CREATE_SURFACE_PLATFORM_EXTENSION) == 0)
- TCU_THROW(NotSupportedError, "Native pixmap doesn't support eglCreatePlatformPixmapSurfaceEXT()");
- }
+ case LEGACY:
+ {
+ if ((pixmapFactory.getCapabilities() & eglu::NativePixmap::CAPABILITY_CREATE_SURFACE_LEGACY) == 0)
+ TCU_THROW(NotSupportedError, "Native pixmap doesn't support legacy eglCreatePixmapSurface()");
+ }
+ break;
+ case EXTENSION:
+ {
+ if ((pixmapFactory.getCapabilities() & eglu::NativePixmap::CAPABILITY_CREATE_SURFACE_PLATFORM_EXTENSION) == 0)
+ TCU_THROW(NotSupportedError, "Native pixmap doesn't support eglCreatePlatformPixmapSurfaceEXT()");
+ }
+ break;
+ case EGL15:
+ {
+ if ((pixmapFactory.getCapabilities() & eglu::NativePixmap::CAPABILITY_CREATE_SURFACE_PLATFORM) == 0)
+ TCU_THROW(NotSupportedError, "Native pixmap doesn't support eglCreatePlatformPixmapSurface()");
+ }
+ break;
+ };
log << TestLog::Message << "Creating pixmap surface with config ID " << id << TestLog::EndMessage;
EGLU_CHECK_MSG(egl, "init");
const int width = 64;
const int height = 64;
de::UniquePtr<eglu::NativePixmap> pixmap (pixmapFactory.createPixmap(&m_eglTestCtx.getNativeDisplay(), display, config, DE_NULL, width, height));
- eglu::UniqueSurface surface (egl, display, createPixmapSurface(display, config, m_eglTestCtx.getNativeDisplay(), *pixmap, m_useLegacyCreate));
+ eglu::UniqueSurface surface (egl, display, createPixmapSurface(display, config, m_eglTestCtx.getNativeDisplay(), *pixmap, m_createType));
EGLint pixmapWidth = 0;
EGLint pixmapHeight = 0;
}
private:
- bool m_useLegacyCreate;
+ ApiType m_createType;
};
class CreatePbufferSurfaceCase : public SimpleConfigCase
getDefaultFilterLists(filterLists, baseFilters);
for (vector<NamedFilterList>::iterator i = filterLists.begin(); i != filterLists.end(); i++)
- windowGroup->addChild(new CreateWindowSurfaceCase(m_eglTestCtx, i->getName(), i->getDescription(), true, *i));
+ windowGroup->addChild(new CreateWindowSurfaceCase(m_eglTestCtx, i->getName(), i->getDescription(), LEGACY, *i));
}
// Pixmap surfaces
getDefaultFilterLists(filterLists, baseFilters);
for (vector<NamedFilterList>::iterator i = filterLists.begin(); i != filterLists.end(); i++)
- pixmapGroup->addChild(new CreatePixmapSurfaceCase(m_eglTestCtx, i->getName(), i->getDescription(), true, *i));
+ pixmapGroup->addChild(new CreatePixmapSurfaceCase(m_eglTestCtx, i->getName(), i->getDescription(), LEGACY, *i));
}
// Pbuffer surfaces
// Window surfaces with new platform extension
{
- tcu::TestCaseGroup* windowGroup = new tcu::TestCaseGroup(m_testCtx, "platform_window", "Window surfaces with platform extension");
+ tcu::TestCaseGroup* windowGroup = new tcu::TestCaseGroup(m_testCtx, "platform_ext_window", "Window surfaces with platform extension");
addChild(windowGroup);
eglu::FilterList baseFilters;
getDefaultFilterLists(filterLists, baseFilters);
for (vector<NamedFilterList>::iterator i = filterLists.begin(); i != filterLists.end(); i++)
- windowGroup->addChild(new CreateWindowSurfaceCase(m_eglTestCtx, i->getName(), i->getDescription(), false, *i));
+ windowGroup->addChild(new CreateWindowSurfaceCase(m_eglTestCtx, i->getName(), i->getDescription(), EXTENSION, *i));
}
// Pixmap surfaces with new platform extension
{
- tcu::TestCaseGroup* pixmapGroup = new tcu::TestCaseGroup(m_testCtx, "platform_pixmap", "Pixmap surfaces with platform extension");
+ tcu::TestCaseGroup* pixmapGroup = new tcu::TestCaseGroup(m_testCtx, "platform_ext_pixmap", "Pixmap surfaces with platform extension");
+ addChild(pixmapGroup);
+
+ eglu::FilterList baseFilters;
+ baseFilters << surfaceType<EGL_PIXMAP_BIT>;
+
+ vector<NamedFilterList> filterLists;
+ getDefaultFilterLists(filterLists, baseFilters);
+
+ for (vector<NamedFilterList>::iterator i = filterLists.begin(); i != filterLists.end(); i++)
+ pixmapGroup->addChild(new CreatePixmapSurfaceCase(m_eglTestCtx, i->getName(), i->getDescription(), EXTENSION, *i));
+ }
+ //
+ // Window surfaces with EGL 1.5 CreateWindowSurface
+ {
+ tcu::TestCaseGroup* windowGroup = new tcu::TestCaseGroup(m_testCtx, "platform_window", "Window surfaces with EGL 1.5");
+ addChild(windowGroup);
+
+ eglu::FilterList baseFilters;
+ baseFilters << surfaceType<EGL_WINDOW_BIT>;
+
+ vector<NamedFilterList> filterLists;
+ getDefaultFilterLists(filterLists, baseFilters);
+
+ for (vector<NamedFilterList>::iterator i = filterLists.begin(); i != filterLists.end(); i++)
+ windowGroup->addChild(new CreateWindowSurfaceCase(m_eglTestCtx, i->getName(), i->getDescription(), EGL15, *i));
+ }
+
+ // Pixmap surfaces with EGL 1.5 CreateWindowSurface
+ {
+ tcu::TestCaseGroup* pixmapGroup = new tcu::TestCaseGroup(m_testCtx, "platform_pixmap", "Pixmap surfaces with EGL 1.5");
addChild(pixmapGroup);
eglu::FilterList baseFilters;
getDefaultFilterLists(filterLists, baseFilters);
for (vector<NamedFilterList>::iterator i = filterLists.begin(); i != filterLists.end(); i++)
- pixmapGroup->addChild(new CreatePixmapSurfaceCase(m_eglTestCtx, i->getName(), i->getDescription(), false, *i));
+ pixmapGroup->addChild(new CreatePixmapSurfaceCase(m_eglTestCtx, i->getName(), i->getDescription(), EGL15, *i));
}
}
{
m_supported = eglu::getClientExtensions(m_eglTestCtx.getLibrary());
}
- catch (const eglu::Error& error)
+ catch (const tcu::NotSupportedError& error)
{
- // EGL_BAD_DISPLAY is generated if client extensions are not supported.
- if (error.getError() != EGL_BAD_DISPLAY)
- throw;
+ // Ignore case where EGL client extensions are not supported
+ // that's okay for these tests.
}
DE_ASSERT(m_display == EGL_NO_DISPLAY);