1 /*-------------------------------------------------------------------------
2 * drawElements Quality Program Tester Core
3 * ----------------------------------------
5 * Copyright (c) 2014 The Android Open Source Project
6 * Copyright (c) 2016 The Khronos Group Inc.
7 * Copyright (c) 2016 Mun Gwan-gyeong <elongbug@gmail.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
23 * \brief wayland Platform.
24 *//*--------------------------------------------------------------------*/
26 #include "tcuWaylandPlatform.hpp"
27 #include "tcuWaylandEglPlatform.hpp"
29 #include "deUniquePtr.hpp"
30 #include "gluPlatform.hpp"
31 #include "vkPlatform.hpp"
32 #include "tcuWayland.hpp"
33 #include "tcuWaylandVulkanPlatform.hpp"
34 #include "tcuFunctionLibrary.hpp"
37 #include <sys/utsname.h>
44 class WaylandGLPlatform : public glu::Platform
47 void registerFactory (de::MovePtr<glu::ContextFactory> factory)
49 m_contextFactoryRegistry.registerFactory(factory.release());
53 class WaylandPlatform : public tcu::Platform
56 WaylandPlatform (void);
57 bool processEvents (void) { return !m_eventState.getQuitFlag(); }
58 const glu::Platform& getGLPlatform (void) const { return m_glPlatform; }
59 const eglu::Platform& getEGLPlatform (void) const { return m_eglPlatform; }
60 const vk::Platform& getVulkanPlatform (void) const { return m_vkPlatform; }
64 EventState m_eventState;
65 wayland::egl::Platform m_eglPlatform;
66 WaylandGLPlatform m_glPlatform;
67 WaylandVulkanPlatform m_vkPlatform;
70 WaylandPlatform::WaylandPlatform (void)
71 : m_eglPlatform (m_eventState)
72 , m_vkPlatform (m_eventState)
74 m_glPlatform.registerFactory(m_eglPlatform.createContextFactory());
80 tcu::Platform* createPlatform (void)
82 return new tcu::wayland::WaylandPlatform();