Split null context factory in to its own file.
authorJamie Madill <jmadill@google.com>
Fri, 15 May 2015 14:54:37 +0000 (10:54 -0400)
committerPyry Haulos <phaulos@google.com>
Fri, 15 May 2015 17:13:49 +0000 (10:13 -0700)
This allows the factory to be re-used in an application which
has another implementation of the createPlatform() function.

Change-Id: I186ee52d5832933e83ff8c6779aa2791fab89dbc

framework/platform/null/tcuNullContextFactory.cpp [new file with mode: 0644]
framework/platform/null/tcuNullContextFactory.hpp [new file with mode: 0644]
framework/platform/null/tcuNullPlatform.cpp
targets/null/null.cmake

diff --git a/framework/platform/null/tcuNullContextFactory.cpp b/framework/platform/null/tcuNullContextFactory.cpp
new file mode 100644 (file)
index 0000000..d466185
--- /dev/null
@@ -0,0 +1,43 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program Tester Core
+ * ----------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *//*!
+ * \file
+ * \brief Null GL Context Factory.
+ *//*--------------------------------------------------------------------*/
+
+#include "tcuNullContextFactory.hpp"
+#include "tcuNullRenderContext.hpp"
+
+namespace tcu
+{
+namespace null
+{
+
+NullGLContextFactory::NullGLContextFactory (void)
+       : glu::ContextFactory("null", "Null Render Context")
+{
+}
+
+glu::RenderContext* NullGLContextFactory::createContext (const glu::RenderConfig& config, const tcu::CommandLine&) const
+{
+       return new RenderContext(config);
+}
+
+} // null
+} // tcu
diff --git a/framework/platform/null/tcuNullContextFactory.hpp b/framework/platform/null/tcuNullContextFactory.hpp
new file mode 100644 (file)
index 0000000..3f0e975
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef _TCUNULLCONTEXTFACTORY_HPP
+#define _TCUNULLCONTEXTFACTORY_HPP
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program Tester Core
+ * ----------------------------------------
+ *
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *//*!
+ * \file
+ * \brief Null GL Context Factory.
+ *//*--------------------------------------------------------------------*/
+
+#include "tcuDefs.hpp"
+#include "gluContextFactory.hpp"
+
+namespace tcu
+{
+namespace null
+{
+
+class NullGLContextFactory : public glu::ContextFactory
+{
+public:
+                                               NullGLContextFactory    (void);
+       glu::RenderContext*     createContext                   (const glu::RenderConfig& config, const tcu::CommandLine&) const;
+};
+
+} // null
+} // tcu
+
+#endif // _TCUNULLCONTEXTFACTORY_HPP
index 8bb9568..ea790e5 100644 (file)
@@ -22,6 +22,7 @@
  *//*--------------------------------------------------------------------*/
 
 #include "tcuNullPlatform.hpp"
+#include "tcuNullContextFactory.hpp"
 #include "tcuNullRenderContext.hpp"
 #include "egluNativeDisplay.hpp"
 #include "eglwLibrary.hpp"
@@ -31,20 +32,6 @@ namespace tcu
 namespace null
 {
 
-class NullGLContextFactory : public glu::ContextFactory
-{
-public:
-       NullGLContextFactory (void)
-               : glu::ContextFactory("null", "Null Render Context")
-       {
-       }
-
-       glu::RenderContext* createContext (const glu::RenderConfig& config, const tcu::CommandLine&) const
-       {
-               return new RenderContext(config);
-       }
-};
-
 class NullEGLDisplay : public eglu::NativeDisplay
 {
 public:
index d86ef46..d12f177 100644 (file)
@@ -12,4 +12,6 @@ set(TCUTIL_PLATFORM_SRCS
        null/tcuNullPlatform.hpp
        null/tcuNullRenderContext.cpp
        null/tcuNullRenderContext.hpp
+       null/tcuNullContextFactory.cpp
+       null/tcuNullContextFactory.hpp
        )