throw tcu::NotSupportedError("eglu::NativePixmap doesn't support eglCreatePixmapSurface()", DE_NULL, __FILE__, __LINE__);
}
-void* NativePixmap::getPlatformNative (void)
+void* NativePixmap::getPlatformExtension (void)
{
- TCU_CHECK_INTERNAL((m_capabilities & CAPABILITY_CREATE_SURFACE_PLATFORM) == 0);
- throw tcu::NotSupportedError("eglu::NativePixmap doesn't support eglCreatePlatformPixmapSurface()", DE_NULL, __FILE__, __LINE__);
+ TCU_CHECK_INTERNAL((m_capabilities & CAPABILITY_CREATE_SURFACE_PLATFORM_EXTENSION) == 0);
+ throw tcu::NotSupportedError("eglu::NativePixmap doesn't support eglCreatePlatformPixmapSurfaceEXT()", DE_NULL, __FILE__, __LINE__);
}
void NativePixmap::readPixels (tcu::TextureLevel*)
public:
enum Capability
{
- CAPABILITY_CREATE_SURFACE_LEGACY = (1<<0), //!< EGL surface can be created with eglCreatePixmapSurface()
- CAPABILITY_CREATE_SURFACE_PLATFORM = (1<<1), //!< EGL surface can be created with eglCreatePlatformPixmapSurface()
- CAPABILITY_READ_PIXELS = (1<<2)
+ 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)
};
virtual ~NativePixmap (void) {}
virtual eglw::EGLNativePixmapType getLegacyNative (void);
//! Return native pointer that can be used with eglCreatePlatformPixmapSurfaceEXT(). Default implementation throws tcu::NotSupportedError().
- virtual void* getPlatformNative (void);
+ virtual void* getPlatformExtension (void);
// Read pixels from pixmap. Default implementation throws tcu::NotSupportedError()
virtual void readPixels (tcu::TextureLevel* dst);
throw tcu::NotSupportedError("eglu::NativeWindow doesn't support eglCreateWindowSurface()", DE_NULL, __FILE__, __LINE__);
}
-void* NativeWindow::getPlatformNative (void)
+void* NativeWindow::getPlatformExtension (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_CHECK_INTERNAL((m_capabilities & CAPABILITY_CREATE_SURFACE_PLATFORM_EXTENSION) == 0);
+ throw tcu::NotSupportedError("eglu::NativeWindow doesn't support eglCreatePlatformWindowSurfaceEXT()", DE_NULL, __FILE__, __LINE__);
}
tcu::IVec2 NativeWindow::getSurfaceSize (void) const
public:
enum Capability
{
- CAPABILITY_CREATE_SURFACE_LEGACY = (1<<0), //!< EGL surface can be created with eglCreateWindowSurface()
- CAPABILITY_CREATE_SURFACE_PLATFORM = (1<<1), //!< EGL surface can be created with eglCreatePlatformWindowSurface()
- 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_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)
};
virtual ~NativeWindow (void) {}
//! Return EGLNativeWindowType that can be used with eglCreateWindowSurface(). Default implementation throws tcu::NotSupportedError().
virtual eglw::EGLNativeWindowType getLegacyNative (void);
- //! Return native pointer that can be used with eglCreatePlatformWindowSurface(). Default implementation throws tcu::NotSupportedError().
- virtual void* getPlatformNative (void);
+ //! Return native pointer that can be used with eglCreatePlatformWindowSurfaceEXT(). Default implementation throws tcu::NotSupportedError().
+ virtual void* getPlatformExtension (void);
// Process window events. Defaults to dummy implementation, that does nothing.
virtual void processEvents (void) {}
//! Create EGL window surface using 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;
- bool usePlatformExt = false;
- EGLSurface surface = EGL_NO_SURFACE;
+ const Library& egl = nativeDisplay.getLibrary();
+ const bool supportsLegacyCreate = (window.getCapabilities() & NativeWindow::CAPABILITY_CREATE_SURFACE_LEGACY) != 0;
+ const bool supportsPlatformCreateExtension = (window.getCapabilities() & NativeWindow::CAPABILITY_CREATE_SURFACE_PLATFORM_EXTENSION) != 0;
+ bool usePlatformExt = false;
+ EGLSurface surface = EGL_NO_SURFACE;
- TCU_CHECK_INTERNAL(supportsLegacyCreate || supportsPlatformCreate);
+ TCU_CHECK_INTERNAL(supportsLegacyCreate || supportsPlatformCreateExtension);
- if (supportsPlatformCreate)
+ if (supportsPlatformCreateExtension)
{
const vector<string> platformExts = getClientExtensions(egl);
usePlatformExt = de::contains(platformExts.begin(), platformExts.end(), string("EGL_EXT_platform_base")) &&
{
const vector<EGLint> legacyAttribs = toLegacyAttribList(attribList);
- surface = egl.createPlatformWindowSurfaceEXT(display, config, window.getPlatformNative(), &legacyAttribs[0]);
+ surface = egl.createPlatformWindowSurfaceEXT(display, config, window.getPlatformExtension(), &legacyAttribs[0]);
EGLU_CHECK_MSG(egl, "eglCreatePlatformWindowSurfaceEXT()");
TCU_CHECK(surface != EGL_NO_SURFACE);
}
//! Create EGL pixmap surface using eglCreatePixmapSurface() or eglCreatePlatformPixmapSurfaceEXT()
EGLSurface createPixmapSurface (NativeDisplay& nativeDisplay, NativePixmap& pixmap, EGLDisplay display, EGLConfig config, const EGLAttrib* attribList)
{
- const Library& egl = nativeDisplay.getLibrary();
- const bool supportsLegacyCreate = (pixmap.getCapabilities() & NativePixmap::CAPABILITY_CREATE_SURFACE_LEGACY) != 0;
- const bool supportsPlatformCreate = (pixmap.getCapabilities() & NativePixmap::CAPABILITY_CREATE_SURFACE_PLATFORM) != 0;
- bool usePlatformExt = false;
- EGLSurface 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;
+ bool usePlatformExt = false;
+ EGLSurface surface = EGL_NO_SURFACE;
- TCU_CHECK_INTERNAL(supportsLegacyCreate || supportsPlatformCreate);
+ TCU_CHECK_INTERNAL(supportsLegacyCreate || supportsPlatformCreateExtension);
- if (supportsPlatformCreate)
+ if (supportsPlatformCreateExtension)
{
const vector<string> platformExts = getClientExtensions(egl);
usePlatformExt = de::contains(platformExts.begin(), platformExts.end(), string("EGL_EXT_platform_base")) &&
{
const vector<EGLint> legacyAttribs = toLegacyAttribList(attribList);
- surface = egl.createPlatformPixmapSurfaceEXT(display, config, pixmap.getPlatformNative(), &legacyAttribs[0]);
+ surface = egl.createPlatformPixmapSurfaceEXT(display, config, pixmap.getPlatformExtension(), &legacyAttribs[0]);
EGLU_CHECK_MSG(egl, "eglCreatePlatformPixmapSurfaceEXT()");
TCU_CHECK(surface != EGL_NO_SURFACE);
}
{
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 |
CAPABILITY_GET_SCREEN_SIZE);
public:
enum {
CAPABILITIES = (CAPABILITY_CREATE_SURFACE_LEGACY |
- CAPABILITY_CREATE_SURFACE_PLATFORM |
+ CAPABILITY_CREATE_SURFACE_PLATFORM_EXTENSION |
CAPABILITY_READ_PIXELS)
};
{
checkEGLPlatformSupport(egl, nativeDisplay.getPlatformExtensionName());
- surface = egl.createPlatformWindowSurfaceEXT(display, config, window.getPlatformNative(), DE_NULL);
+ surface = egl.createPlatformWindowSurfaceEXT(display, config, window.getPlatformExtension(), DE_NULL);
EGLU_CHECK_MSG(egl, "eglCreatePlatformWindowSurfaceEXT() failed");
}
{
checkEGLPlatformSupport(egl, nativeDisplay.getPlatformExtensionName());
- surface = egl.createPlatformPixmapSurfaceEXT(display, config, pixmap.getPlatformNative(), DE_NULL);
+ surface = egl.createPlatformPixmapSurfaceEXT(display, config, pixmap.getPlatformExtension(), DE_NULL);
EGLU_CHECK_MSG(egl, "eglCreatePlatformPixmapSurfaceEXT() failed");
}
}
else
{
- if ((windowFactory.getCapabilities() & eglu::NativeWindow::CAPABILITY_CREATE_SURFACE_PLATFORM) == 0)
+ if ((windowFactory.getCapabilities() & eglu::NativeWindow::CAPABILITY_CREATE_SURFACE_PLATFORM_EXTENSION) == 0)
TCU_THROW(NotSupportedError, "Native window doesn't support eglCreatePlatformWindowSurfaceEXT()");
}
}
else
{
- if ((pixmapFactory.getCapabilities() & eglu::NativePixmap::CAPABILITY_CREATE_SURFACE_PLATFORM) == 0)
+ if ((pixmapFactory.getCapabilities() & eglu::NativePixmap::CAPABILITY_CREATE_SURFACE_PLATFORM_EXTENSION) == 0)
TCU_THROW(NotSupportedError, "Native pixmap doesn't support eglCreatePlatformPixmapSurfaceEXT()");
}