1 /*-------------------------------------------------------------------------
2 * OpenGL Conformance Test Suite
3 * -----------------------------
5 * Copyright (c) 2016 Google Inc.
6 * Copyright (c) 2016 The Khronos Group Inc.
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
23 *//*--------------------------------------------------------------------*/
25 #include "tcuNullWSPlatform.hpp"
26 #include "eglwEnums.hpp"
27 #include "eglwLibrary.hpp"
28 #include "egluGLContextFactory.hpp"
35 class Window: public eglu::NativeWindow
38 static const Capability CAPABILITIES = CAPABILITY_CREATE_SURFACE_LEGACY;
40 Window(eglu::NativeDisplay* nativeDisplay, const eglu::WindowParams& params)
41 : NativeWindow(CAPABILITIES)
45 eglw::EGLNativeWindowType getLegacyNative ()
51 class WindowFactory: public eglu::NativeWindowFactory
55 : NativeWindowFactory("nullws", "NullWS Window", Window::CAPABILITIES)
59 eglu::NativeWindow* createWindow(eglu::NativeDisplay* nativeDisplay, const eglu::WindowParams& params) const
61 return new Window(nativeDisplay, params);
65 class Pixmap: public eglu::NativePixmap
68 static const Capability CAPABILITIES = CAPABILITY_CREATE_SURFACE_LEGACY;
71 : NativePixmap(CAPABILITIES)
75 eglw::EGLNativePixmapType getLegacyNative ()
81 class PixmapFactory: public eglu::NativePixmapFactory
85 : NativePixmapFactory("nullws", "NullWS Pixmap", Pixmap::CAPABILITIES)
89 eglu::NativePixmap* createPixmap (eglu::NativeDisplay*, int, int) const
95 class Display: public eglu::NativeDisplay
98 static const Capability CAPABILITIES = CAPABILITY_GET_DISPLAY_LEGACY;
101 : eglu::NativeDisplay(CAPABILITIES)
105 eglw::EGLNativeDisplayType getLegacyNative()
107 return EGL_DEFAULT_DISPLAY;
110 const eglw::Library& getLibrary() const
116 eglw::DefaultLibrary m_library;
120 class DisplayFactory: public eglu::NativeDisplayFactory
124 : eglu::NativeDisplayFactory ("nullws", "NullWS Display", Display::CAPABILITIES)
126 m_nativeWindowRegistry.registerFactory(new WindowFactory());
127 m_nativePixmapRegistry.registerFactory(new PixmapFactory());
130 eglu::NativeDisplay* createDisplay (const eglw::EGLAttrib* attribList = DE_NULL) const
132 return new Display();
136 Platform::Platform ()
138 m_nativeDisplayFactoryRegistry.registerFactory(new DisplayFactory());
139 m_contextFactoryRegistry.registerFactory(new eglu::GLContextFactory(m_nativeDisplayFactoryRegistry));
142 Platform::~Platform ()
149 tcu::Platform* createPlatform ()
151 return new tcu::nullws::Platform();