From: Pyry Haulos Date: Fri, 3 Apr 2015 22:46:20 +0000 (-0700) Subject: Add stub EGL support to null platform X-Git-Tag: upstream/0.1.0~1802^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=40598136780579fa4b5538bc484d4866ada926c6;p=platform%2Fupstream%2FVK-GL-CTS.git Add stub EGL support to null platform This adds basic eglu::NativeDisplayFactory and eglu::NativeDisplay that is enough to get --deqp-runmode=*-caselist working. Change-Id: I1bca2690f648b884a5cfe3182d40e9c3680ca392 --- diff --git a/framework/platform/null/tcuNullPlatform.cpp b/framework/platform/null/tcuNullPlatform.cpp index 80f0a7e..8bb9568 100644 --- a/framework/platform/null/tcuNullPlatform.cpp +++ b/framework/platform/null/tcuNullPlatform.cpp @@ -23,16 +23,18 @@ #include "tcuNullPlatform.hpp" #include "tcuNullRenderContext.hpp" +#include "egluNativeDisplay.hpp" +#include "eglwLibrary.hpp" namespace tcu { namespace null { -class NullContextFactory : public glu::ContextFactory +class NullGLContextFactory : public glu::ContextFactory { public: - NullContextFactory (void) + NullGLContextFactory (void) : glu::ContextFactory("null", "Null Render Context") { } @@ -43,9 +45,42 @@ public: } }; +class NullEGLDisplay : public eglu::NativeDisplay +{ +public: + NullEGLDisplay (void) + : eglu::NativeDisplay(CAPABILITY_GET_DISPLAY_LEGACY) + { + // \note All functions in library are null + } + + const eglw::Library& getLibrary (void) const + { + return m_library; + } + +private: + eglw::FuncPtrLibrary m_library; +}; + +class NullEGLDisplayFactory : public eglu::NativeDisplayFactory +{ +public: + NullEGLDisplayFactory (void) + : eglu::NativeDisplayFactory("null", "Null EGL Display", eglu::NativeDisplay::CAPABILITY_GET_DISPLAY_LEGACY) + { + } + + eglu::NativeDisplay* createDisplay (const eglw::EGLAttrib*) const + { + return new NullEGLDisplay(); + } +}; + Platform::Platform (void) { - m_contextFactoryRegistry.registerFactory(new NullContextFactory()); + m_contextFactoryRegistry.registerFactory(new NullGLContextFactory()); + m_nativeDisplayFactoryRegistry.registerFactory(new NullEGLDisplayFactory()); } Platform::~Platform (void) diff --git a/framework/platform/null/tcuNullPlatform.hpp b/framework/platform/null/tcuNullPlatform.hpp index 11d6a14..81ff514 100644 --- a/framework/platform/null/tcuNullPlatform.hpp +++ b/framework/platform/null/tcuNullPlatform.hpp @@ -26,19 +26,21 @@ #include "tcuDefs.hpp" #include "tcuPlatform.hpp" #include "gluPlatform.hpp" +#include "egluPlatform.hpp" namespace tcu { namespace null { -class Platform : public tcu::Platform, private glu::Platform +class Platform : public tcu::Platform, private glu::Platform, private eglu::Platform { public: Platform (void); virtual ~Platform (void); virtual const glu::Platform& getGLPlatform (void) const { return static_cast(*this); } + virtual const eglu::Platform& getEGLPlatform (void) const { return static_cast(*this); } }; } // null diff --git a/targets/null/null.cmake b/targets/null/null.cmake index 45ac19b..d86ef46 100644 --- a/targets/null/null.cmake +++ b/targets/null/null.cmake @@ -2,6 +2,7 @@ message("*** Using null context target") set(DEQP_TARGET_NAME "Null") +set(DEQP_SUPPORT_EGL ON) set(DEQP_SUPPORT_GLES2 ON) set(DEQP_SUPPORT_GLES3 ON) set(DEQP_SUPPORT_OPENGL ON)