3 /*-------------------------------------------------------------------------
4 * drawElements Quality Program Tester Core
5 * ----------------------------------------
7 * Copyright 2014 The Android Open Source Project
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 EGL utilities
24 *//*--------------------------------------------------------------------*/
26 #include "tcuDefs.hpp"
27 #include "egluDefs.hpp"
28 #include "egluNativeWindow.hpp"
29 #include "egluNativeDisplay.hpp"
30 #include "eglwDefs.hpp"
49 class NativePixmapFactory;
53 typedef std::map<eglw::EGLint, eglw::EGLint> AttribMap;
55 std::vector<eglw::EGLint> attribMapToList (const AttribMap& map);
57 Version getVersion (const eglw::Library& egl, eglw::EGLDisplay display);
59 std::vector<std::string> getPlatformExtensions (const eglw::Library& egl);
60 std::vector<std::string> getClientExtensions (const eglw::Library& egl, eglw::EGLDisplay display);
61 bool hasExtension (const eglw::Library& egl, eglw::EGLDisplay display, const std::string& extName);
63 std::vector<eglw::EGLConfig> getConfigs (const eglw::Library& egl, eglw::EGLDisplay display);
64 std::vector<eglw::EGLConfig> chooseConfigs (const eglw::Library& egl, eglw::EGLDisplay display, const AttribMap& attribs);
65 std::vector<eglw::EGLConfig> chooseConfigs (const eglw::Library& egl, eglw::EGLDisplay display, const FilterList& filters);
66 std::vector<eglw::EGLConfig> chooseConfigs (const eglw::Library& egl, eglw::EGLDisplay display, const eglw::EGLint* attribs);
67 eglw::EGLConfig chooseSingleConfig (const eglw::Library& egl, eglw::EGLDisplay display, const AttribMap& attribs);
68 eglw::EGLConfig chooseSingleConfig (const eglw::Library& egl, eglw::EGLDisplay display, const eglw::EGLint* attribs);
69 eglw::EGLConfig chooseSingleConfig (const eglw::Library& egl, eglw::EGLDisplay display, const FilterList& filters);
70 eglw::EGLConfig chooseConfigByID (const eglw::Library& egl, eglw::EGLDisplay display, eglw::EGLint id);
71 eglw::EGLint getConfigAttribInt (const eglw::Library& egl, eglw::EGLDisplay display, eglw::EGLConfig config, eglw::EGLint attrib);
72 eglw::EGLint getConfigID (const eglw::Library& egl, eglw::EGLDisplay display, eglw::EGLConfig config);
74 eglw::EGLint querySurfaceInt (const eglw::Library& egl, eglw::EGLDisplay display, eglw::EGLSurface surface, eglw::EGLint attrib);
75 tcu::IVec2 getSurfaceSize (const eglw::Library& egl, eglw::EGLDisplay display, eglw::EGLSurface surface);
76 tcu::IVec2 getSurfaceResolution (const eglw::Library& egl, eglw::EGLDisplay display, eglw::EGLSurface surface);
78 eglw::EGLDisplay getDisplay (NativeDisplay& nativeDisplay);
79 eglw::EGLDisplay getAndInitDisplay (NativeDisplay& nativeDisplay, Version* version = DE_NULL);
80 eglw::EGLSurface createWindowSurface (NativeDisplay& nativeDisplay, NativeWindow& window, eglw::EGLDisplay display, eglw::EGLConfig config, const eglw::EGLAttrib* attribList);
81 eglw::EGLSurface createPixmapSurface (NativeDisplay& nativeDisplay, NativePixmap& pixmap, eglw::EGLDisplay display, eglw::EGLConfig config, const eglw::EGLAttrib* attribList);
83 const NativeDisplayFactory& selectNativeDisplayFactory (const NativeDisplayFactoryRegistry& registry, const tcu::CommandLine& cmdLine);
84 const NativeWindowFactory& selectNativeWindowFactory (const NativeDisplayFactory& factory, const tcu::CommandLine& cmdLine);
85 const NativePixmapFactory& selectNativePixmapFactory (const NativeDisplayFactory& factory, const tcu::CommandLine& cmdLine);
87 WindowParams::Visibility parseWindowVisibility (const tcu::CommandLine& commandLine);
88 eglw::EGLenum parseClientAPI (const std::string& api);
89 std::vector<eglw::EGLenum> parseClientAPIs (const std::string& apiList);
90 std::vector<eglw::EGLenum> getClientAPIs (const eglw::Library& egl, eglw::EGLDisplay display);
92 eglw::EGLint getRenderableAPIsMask (const eglw::Library& egl, eglw::EGLDisplay display);
94 std::vector<eglw::EGLint> toLegacyAttribList (const eglw::EGLAttrib* attribs);
98 #endif // _EGLUUTIL_HPP