Add stub EGL support to null platform
authorPyry Haulos <phaulos@google.com>
Fri, 3 Apr 2015 22:46:20 +0000 (15:46 -0700)
committerPyry Haulos <phaulos@google.com>
Fri, 3 Apr 2015 22:46:20 +0000 (15:46 -0700)
This adds basic eglu::NativeDisplayFactory and eglu::NativeDisplay that
is enough to get --deqp-runmode=*-caselist working.

Change-Id: I1bca2690f648b884a5cfe3182d40e9c3680ca392

framework/platform/null/tcuNullPlatform.cpp
framework/platform/null/tcuNullPlatform.hpp
targets/null/null.cmake

index 80f0a7e..8bb9568 100644 (file)
 
 #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)
index 11d6a14..81ff514 100644 (file)
 #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<const glu::Platform&>(*this); }
+       virtual const eglu::Platform&   getEGLPlatform  (void) const { return static_cast<const eglu::Platform&>(*this); }
 };
 
 } // null
index 45ac19b..d86ef46 100644 (file)
@@ -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)