13c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#ifndef _EGLUUTIL_HPP
23c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#define _EGLUUTIL_HPP
33c827367444ee418f129b2c238299f49d3264554Jarkko Poyry/*-------------------------------------------------------------------------
43c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * drawElements Quality Program Tester Core
53c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * ----------------------------------------
63c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
73c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * Copyright 2014 The Android Open Source Project
83c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
93c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * Licensed under the Apache License, Version 2.0 (the "License");
103c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * you may not use this file except in compliance with the License.
113c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * You may obtain a copy of the License at
123c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
133c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *      http://www.apache.org/licenses/LICENSE-2.0
143c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
153c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * Unless required by applicable law or agreed to in writing, software
163c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * distributed under the License is distributed on an "AS IS" BASIS,
173c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
183c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * See the License for the specific language governing permissions and
193c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * limitations under the License.
203c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
213c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *//*!
223c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * \file
233c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * \brief EGL utilities
243c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *//*--------------------------------------------------------------------*/
253c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
263c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "tcuDefs.hpp"
2753365959f2740e7b9ed59c51adbb73372f908a09Mika Isojärvi#include "egluDefs.hpp"
283c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "egluNativeWindow.hpp"
293c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Haulos#include "egluNativeDisplay.hpp"
303c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Haulos#include "eglwDefs.hpp"
313c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
323c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include <vector>
333c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include <map>
343c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include <string>
353c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
363c827367444ee418f129b2c238299f49d3264554Jarkko Poyrynamespace tcu
373c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
383c827367444ee418f129b2c238299f49d3264554Jarkko Poyryclass CommandLine;
393c827367444ee418f129b2c238299f49d3264554Jarkko Poyry}
403c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
413c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Haulosnamespace eglw
423c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Haulos{
433c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Haulosclass Library;
443c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Haulos}
453c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Haulos
463c827367444ee418f129b2c238299f49d3264554Jarkko Poyrynamespace eglu
473c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
483c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
493c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Haulosclass NativePixmapFactory;
503c827367444ee418f129b2c238299f49d3264554Jarkko Poyryclass NativePixmap;
513c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Haulosclass FilterList;
523c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Haulos
533c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Haulostypedef std::map<eglw::EGLint, eglw::EGLint> AttribMap;
543c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Haulos
553c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Haulosstd::vector<eglw::EGLint>		attribMapToList				(const AttribMap& map);
563c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Haulos
573c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry HaulosVersion							getVersion					(const eglw::Library& egl, eglw::EGLDisplay display);
583c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Haulos
592f4e6d98746307432f4d82b8d4885116805d7f98Mika Isojärvistd::vector<std::string>		getClientExtensions			(const eglw::Library& egl);
602f4e6d98746307432f4d82b8d4885116805d7f98Mika Isojärvistd::vector<std::string>		getDisplayExtensions		(const eglw::Library& egl, eglw::EGLDisplay display);
613c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Haulosbool							hasExtension				(const eglw::Library& egl, eglw::EGLDisplay display, const std::string& extName);
623c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Haulos
633c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Haulosstd::vector<eglw::EGLConfig>	getConfigs					(const eglw::Library& egl, eglw::EGLDisplay display);
643c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Haulosstd::vector<eglw::EGLConfig>	chooseConfigs				(const eglw::Library& egl, eglw::EGLDisplay display, const AttribMap& attribs);
653c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Haulosstd::vector<eglw::EGLConfig>	chooseConfigs				(const eglw::Library& egl, eglw::EGLDisplay display, const FilterList& filters);
663c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Haulosstd::vector<eglw::EGLConfig>	chooseConfigs				(const eglw::Library& egl, eglw::EGLDisplay display, const eglw::EGLint* attribs);
673c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Hauloseglw::EGLConfig					chooseSingleConfig			(const eglw::Library& egl, eglw::EGLDisplay display, const AttribMap& attribs);
683c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Hauloseglw::EGLConfig					chooseSingleConfig			(const eglw::Library& egl, eglw::EGLDisplay display, const eglw::EGLint* attribs);
693c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Hauloseglw::EGLConfig					chooseSingleConfig			(const eglw::Library& egl, eglw::EGLDisplay display, const FilterList& filters);
703c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Hauloseglw::EGLConfig					chooseConfigByID			(const eglw::Library& egl, eglw::EGLDisplay display, eglw::EGLint id);
713c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Hauloseglw::EGLint					getConfigAttribInt			(const eglw::Library& egl, eglw::EGLDisplay display, eglw::EGLConfig config, eglw::EGLint attrib);
723c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Hauloseglw::EGLint					getConfigID					(const eglw::Library& egl, eglw::EGLDisplay display, eglw::EGLConfig config);
733c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Haulos
743c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Hauloseglw::EGLint					querySurfaceInt				(const eglw::Library& egl, eglw::EGLDisplay display, eglw::EGLSurface surface, eglw::EGLint attrib);
753c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Haulostcu::IVec2						getSurfaceSize				(const eglw::Library& egl, eglw::EGLDisplay display, eglw::EGLSurface surface);
763c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Haulostcu::IVec2						getSurfaceResolution		(const eglw::Library& egl, eglw::EGLDisplay display, eglw::EGLSurface surface);
773c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Haulos
783c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Hauloseglw::EGLDisplay				getDisplay					(NativeDisplay& nativeDisplay);
793c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Hauloseglw::EGLDisplay				getAndInitDisplay			(NativeDisplay& nativeDisplay, Version* version = DE_NULL);
803c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Hauloseglw::EGLSurface				createWindowSurface			(NativeDisplay& nativeDisplay, NativeWindow& window, eglw::EGLDisplay display, eglw::EGLConfig config, const eglw::EGLAttrib* attribList);
813c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Hauloseglw::EGLSurface				createPixmapSurface			(NativeDisplay& nativeDisplay, NativePixmap& pixmap, eglw::EGLDisplay display, eglw::EGLConfig config, const eglw::EGLAttrib* attribList);
823c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Haulos
83485844e764f2821545146b832726a36012f86238Mika Isojärviconst NativeDisplayFactory&		selectNativeDisplayFactory	(const NativeDisplayFactoryRegistry& registry, const tcu::CommandLine& cmdLine);
84485844e764f2821545146b832726a36012f86238Mika Isojärviconst NativeWindowFactory&		selectNativeWindowFactory	(const NativeDisplayFactory& factory, const tcu::CommandLine& cmdLine);
85485844e764f2821545146b832726a36012f86238Mika Isojärviconst NativePixmapFactory&		selectNativePixmapFactory	(const NativeDisplayFactory& factory, const tcu::CommandLine& cmdLine);
863c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Haulos
873c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry HaulosWindowParams::Visibility		parseWindowVisibility		(const tcu::CommandLine& commandLine);
883c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Hauloseglw::EGLenum					parseClientAPI				(const std::string& api);
893c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Haulosstd::vector<eglw::EGLenum>		parseClientAPIs				(const std::string& apiList);
903c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Haulosstd::vector<eglw::EGLenum>		getClientAPIs				(const eglw::Library& egl, eglw::EGLDisplay display);
913c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Haulos
923c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Hauloseglw::EGLint					getRenderableAPIsMask		(const eglw::Library& egl, eglw::EGLDisplay display);
933c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
943c67e4f0ec73f9c30c6b2ed2adfbfe7faaf576a4Pyry Haulosstd::vector<eglw::EGLint>		toLegacyAttribList			(const eglw::EGLAttrib* attribs);
953c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
963c827367444ee418f129b2c238299f49d3264554Jarkko Poyry} // eglu
973c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
983c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#endif // _EGLUUTIL_HPP
99