1*35238bceSAndroid Build Coastguard Worker #ifndef _EGLUUTIL_HPP 2*35238bceSAndroid Build Coastguard Worker #define _EGLUUTIL_HPP 3*35238bceSAndroid Build Coastguard Worker /*------------------------------------------------------------------------- 4*35238bceSAndroid Build Coastguard Worker * drawElements Quality Program Tester Core 5*35238bceSAndroid Build Coastguard Worker * ---------------------------------------- 6*35238bceSAndroid Build Coastguard Worker * 7*35238bceSAndroid Build Coastguard Worker * Copyright 2014 The Android Open Source Project 8*35238bceSAndroid Build Coastguard Worker * 9*35238bceSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 10*35238bceSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 11*35238bceSAndroid Build Coastguard Worker * You may obtain a copy of the License at 12*35238bceSAndroid Build Coastguard Worker * 13*35238bceSAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 14*35238bceSAndroid Build Coastguard Worker * 15*35238bceSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 16*35238bceSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 17*35238bceSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18*35238bceSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 19*35238bceSAndroid Build Coastguard Worker * limitations under the License. 20*35238bceSAndroid Build Coastguard Worker * 21*35238bceSAndroid Build Coastguard Worker *//*! 22*35238bceSAndroid Build Coastguard Worker * \file 23*35238bceSAndroid Build Coastguard Worker * \brief EGL utilities 24*35238bceSAndroid Build Coastguard Worker *//*--------------------------------------------------------------------*/ 25*35238bceSAndroid Build Coastguard Worker 26*35238bceSAndroid Build Coastguard Worker #include "tcuDefs.hpp" 27*35238bceSAndroid Build Coastguard Worker #include "egluDefs.hpp" 28*35238bceSAndroid Build Coastguard Worker #include "egluNativeWindow.hpp" 29*35238bceSAndroid Build Coastguard Worker #include "egluNativeDisplay.hpp" 30*35238bceSAndroid Build Coastguard Worker #include "eglwDefs.hpp" 31*35238bceSAndroid Build Coastguard Worker 32*35238bceSAndroid Build Coastguard Worker #include <vector> 33*35238bceSAndroid Build Coastguard Worker #include <map> 34*35238bceSAndroid Build Coastguard Worker #include <string> 35*35238bceSAndroid Build Coastguard Worker 36*35238bceSAndroid Build Coastguard Worker namespace tcu 37*35238bceSAndroid Build Coastguard Worker { 38*35238bceSAndroid Build Coastguard Worker class CommandLine; 39*35238bceSAndroid Build Coastguard Worker } 40*35238bceSAndroid Build Coastguard Worker 41*35238bceSAndroid Build Coastguard Worker namespace eglw 42*35238bceSAndroid Build Coastguard Worker { 43*35238bceSAndroid Build Coastguard Worker class Library; 44*35238bceSAndroid Build Coastguard Worker } 45*35238bceSAndroid Build Coastguard Worker 46*35238bceSAndroid Build Coastguard Worker namespace eglu 47*35238bceSAndroid Build Coastguard Worker { 48*35238bceSAndroid Build Coastguard Worker 49*35238bceSAndroid Build Coastguard Worker class NativePixmapFactory; 50*35238bceSAndroid Build Coastguard Worker class NativePixmap; 51*35238bceSAndroid Build Coastguard Worker class FilterList; 52*35238bceSAndroid Build Coastguard Worker 53*35238bceSAndroid Build Coastguard Worker typedef std::map<eglw::EGLint, eglw::EGLint> AttribMap; 54*35238bceSAndroid Build Coastguard Worker 55*35238bceSAndroid Build Coastguard Worker std::vector<eglw::EGLint> attribMapToList(const AttribMap &map); 56*35238bceSAndroid Build Coastguard Worker 57*35238bceSAndroid Build Coastguard Worker Version getVersion(const eglw::Library &egl, eglw::EGLDisplay display); 58*35238bceSAndroid Build Coastguard Worker 59*35238bceSAndroid Build Coastguard Worker std::vector<std::string> getClientExtensions(const eglw::Library &egl); 60*35238bceSAndroid Build Coastguard Worker std::vector<std::string> getDisplayExtensions(const eglw::Library &egl, eglw::EGLDisplay display); 61*35238bceSAndroid Build Coastguard Worker bool hasExtension(const eglw::Library &egl, eglw::EGLDisplay display, const std::string &extName); 62*35238bceSAndroid Build Coastguard Worker 63*35238bceSAndroid Build Coastguard Worker std::vector<eglw::EGLConfig> getConfigs(const eglw::Library &egl, eglw::EGLDisplay display); 64*35238bceSAndroid Build Coastguard Worker std::vector<eglw::EGLConfig> chooseConfigs(const eglw::Library &egl, eglw::EGLDisplay display, 65*35238bceSAndroid Build Coastguard Worker const AttribMap &attribs); 66*35238bceSAndroid Build Coastguard Worker std::vector<eglw::EGLConfig> chooseConfigs(const eglw::Library &egl, eglw::EGLDisplay display, 67*35238bceSAndroid Build Coastguard Worker const FilterList &filters); 68*35238bceSAndroid Build Coastguard Worker std::vector<eglw::EGLConfig> chooseConfigs(const eglw::Library &egl, eglw::EGLDisplay display, 69*35238bceSAndroid Build Coastguard Worker const eglw::EGLint *attribs); 70*35238bceSAndroid Build Coastguard Worker eglw::EGLConfig chooseSingleConfig(const eglw::Library &egl, eglw::EGLDisplay display, const AttribMap &attribs); 71*35238bceSAndroid Build Coastguard Worker eglw::EGLConfig chooseSingleConfig(const eglw::Library &egl, eglw::EGLDisplay display, const eglw::EGLint *attribs); 72*35238bceSAndroid Build Coastguard Worker eglw::EGLConfig chooseSingleConfig(const eglw::Library &egl, eglw::EGLDisplay display, const FilterList &filters); 73*35238bceSAndroid Build Coastguard Worker eglw::EGLConfig chooseConfigByID(const eglw::Library &egl, eglw::EGLDisplay display, eglw::EGLint id); 74*35238bceSAndroid Build Coastguard Worker eglw::EGLint getConfigAttribInt(const eglw::Library &egl, eglw::EGLDisplay display, eglw::EGLConfig config, 75*35238bceSAndroid Build Coastguard Worker eglw::EGLint attrib); 76*35238bceSAndroid Build Coastguard Worker eglw::EGLint getConfigID(const eglw::Library &egl, eglw::EGLDisplay display, eglw::EGLConfig config); 77*35238bceSAndroid Build Coastguard Worker 78*35238bceSAndroid Build Coastguard Worker eglw::EGLint querySurfaceInt(const eglw::Library &egl, eglw::EGLDisplay display, eglw::EGLSurface surface, 79*35238bceSAndroid Build Coastguard Worker eglw::EGLint attrib); 80*35238bceSAndroid Build Coastguard Worker tcu::IVec2 getSurfaceSize(const eglw::Library &egl, eglw::EGLDisplay display, eglw::EGLSurface surface); 81*35238bceSAndroid Build Coastguard Worker tcu::IVec2 getSurfaceResolution(const eglw::Library &egl, eglw::EGLDisplay display, eglw::EGLSurface surface); 82*35238bceSAndroid Build Coastguard Worker 83*35238bceSAndroid Build Coastguard Worker eglw::EGLDisplay getDisplay(NativeDisplay &nativeDisplay); 84*35238bceSAndroid Build Coastguard Worker eglw::EGLDisplay getAndInitDisplay(NativeDisplay &nativeDisplay, Version *version = DE_NULL); 85*35238bceSAndroid Build Coastguard Worker void terminateDisplay(const eglw::Library &egl, eglw::EGLDisplay display); 86*35238bceSAndroid Build Coastguard Worker eglw::EGLSurface createWindowSurface(NativeDisplay &nativeDisplay, NativeWindow &window, eglw::EGLDisplay display, 87*35238bceSAndroid Build Coastguard Worker eglw::EGLConfig config, const eglw::EGLAttrib *attribList); 88*35238bceSAndroid Build Coastguard Worker eglw::EGLSurface createPixmapSurface(NativeDisplay &nativeDisplay, NativePixmap &pixmap, eglw::EGLDisplay display, 89*35238bceSAndroid Build Coastguard Worker eglw::EGLConfig config, const eglw::EGLAttrib *attribList); 90*35238bceSAndroid Build Coastguard Worker 91*35238bceSAndroid Build Coastguard Worker const NativeDisplayFactory &selectNativeDisplayFactory(const NativeDisplayFactoryRegistry ®istry, 92*35238bceSAndroid Build Coastguard Worker const tcu::CommandLine &cmdLine); 93*35238bceSAndroid Build Coastguard Worker const NativeWindowFactory &selectNativeWindowFactory(const NativeDisplayFactory &factory, 94*35238bceSAndroid Build Coastguard Worker const tcu::CommandLine &cmdLine); 95*35238bceSAndroid Build Coastguard Worker const NativePixmapFactory &selectNativePixmapFactory(const NativeDisplayFactory &factory, 96*35238bceSAndroid Build Coastguard Worker const tcu::CommandLine &cmdLine); 97*35238bceSAndroid Build Coastguard Worker 98*35238bceSAndroid Build Coastguard Worker WindowParams::Visibility parseWindowVisibility(const tcu::CommandLine &commandLine); 99*35238bceSAndroid Build Coastguard Worker eglw::EGLenum parseClientAPI(const std::string &api); 100*35238bceSAndroid Build Coastguard Worker std::vector<eglw::EGLenum> parseClientAPIs(const std::string &apiList); 101*35238bceSAndroid Build Coastguard Worker std::vector<eglw::EGLenum> getClientAPIs(const eglw::Library &egl, eglw::EGLDisplay display); 102*35238bceSAndroid Build Coastguard Worker 103*35238bceSAndroid Build Coastguard Worker eglw::EGLint getRenderableAPIsMask(const eglw::Library &egl, eglw::EGLDisplay display); 104*35238bceSAndroid Build Coastguard Worker 105*35238bceSAndroid Build Coastguard Worker std::vector<eglw::EGLint> toLegacyAttribList(const eglw::EGLAttrib *attribs); 106*35238bceSAndroid Build Coastguard Worker 107*35238bceSAndroid Build Coastguard Worker } // namespace eglu 108*35238bceSAndroid Build Coastguard Worker 109*35238bceSAndroid Build Coastguard Worker #endif // _EGLUUTIL_HPP 110