1 /*-------------------------------------------------------------------------
2 * drawElements Quality Program Tester Core
3 * ----------------------------------------
5 * Copyright 2014 The Android Open Source Project
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
21 * \brief X11 Platform.
22 *//*--------------------------------------------------------------------*/
24 #include "tcuX11Platform.hpp"
25 #include "vkWsiPlatform.hpp"
27 #include "deUniquePtr.hpp"
28 #include "gluPlatform.hpp"
29 #include "vkPlatform.hpp"
31 #include "tcuFunctionLibrary.hpp"
33 #include "tcuX11VulkanPlatform.hpp"
34 #include "tcuX11EglPlatform.hpp"
36 #if defined (DEQP_SUPPORT_GLX)
37 # include "tcuX11GlxPlatform.hpp"
40 #include <sys/utsname.h>
50 class X11GLPlatform : public glu::Platform
53 void registerFactory (de::MovePtr<glu::ContextFactory> factory)
55 m_contextFactoryRegistry.registerFactory(factory.release());
59 class X11Platform : public tcu::Platform
63 bool processEvents (void) { return !m_eventState.getQuitFlag(); }
65 const vk::Platform& getVulkanPlatform (void) const { return m_vkPlatform; }
66 const eglu::Platform& getEGLPlatform (void) const { return m_eglPlatform; }
67 const glu::Platform& getGLPlatform (void) const { return m_glPlatform; }
70 EventState m_eventState;
71 x11::VulkanPlatform m_vkPlatform;
72 x11::egl::Platform m_eglPlatform;
73 X11GLPlatform m_glPlatform;
76 X11Platform::X11Platform (void)
77 : m_vkPlatform (m_eventState)
78 , m_eglPlatform (m_eventState)
80 #if defined (DEQP_SUPPORT_GLX)
81 m_glPlatform.registerFactory(glx::createContextFactory(m_eventState));
82 #endif // DEQP_SUPPORT_GLX
84 m_glPlatform.registerFactory(m_eglPlatform.createContextFactory());
90 tcu::Platform* createPlatform (void)
92 return new tcu::x11::X11Platform();