• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef _TEGLSIMPLECONFIGCASE_HPP
2 #define _TEGLSIMPLECONFIGCASE_HPP
3 /*-------------------------------------------------------------------------
4  * drawElements Quality Program EGL Module
5  * ---------------------------------------
6  *
7  * Copyright 2014 The Android Open Source Project
8  *
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
12  *
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  *
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.
20  *
21  *//*!
22  * \file
23  * \brief Simple Context construction test.
24  *//*--------------------------------------------------------------------*/
25 
26 #include "tcuDefs.hpp"
27 #include "teglTestCase.hpp"
28 #include "tcuEgl.hpp"
29 #include "egluConfigFilter.hpp"
30 
31 #include <vector>
32 #include <string>
33 
34 namespace deqp
35 {
36 namespace egl
37 {
38 
39 class SimpleConfigCase : public TestCase
40 {
41 public:
42 							SimpleConfigCase			(EglTestContext& eglTestCtx, const char* name, const char* description, const std::vector<EGLint>& configIds);
43 	virtual					~SimpleConfigCase			(void);
44 
45 	void					init						(void);
46 	IterateResult			iterate						(void);
47 
48 private:
49 	virtual void			executeForConfig			(tcu::egl::Display& display, EGLConfig config)	= DE_NULL;
50 
51 							SimpleConfigCase			(const SimpleConfigCase& other);
52 	SimpleConfigCase&		operator=					(const SimpleConfigCase& other);
53 
54 	std::vector<EGLint>					m_configIds;
55 	std::vector<EGLConfig>				m_configs;
56 	std::vector<EGLConfig>::iterator	m_configIter;
57 };
58 
59 class NamedConfigIdSet
60 {
61 public:
NamedConfigIdSet(void)62 								NamedConfigIdSet		(void) {}
NamedConfigIdSet(const char * name,const char * description)63 								NamedConfigIdSet		(const char* name, const char* description) : m_name(name), m_description(description) {}
NamedConfigIdSet(const char * name,const char * description,const std::vector<EGLint> & configIds)64 								NamedConfigIdSet		(const char* name, const char* description, const std::vector<EGLint>& configIds) : m_name(name), m_description(description), m_configIds(configIds) {}
65 
getName(void) const66 	const char*					getName					(void) const	{ return m_name.c_str();		}
getDescription(void) const67 	const char*					getDescription			(void) const	{ return m_description.c_str();	}
getConfigIds(void) const68 	const std::vector<EGLint>	getConfigIds			(void) const	{ return m_configIds;			}
69 
getConfigIds(void)70 	std::vector<EGLint>&		getConfigIds			(void)			{ return m_configIds;			}
71 
72 	static void					getDefaultSets			(std::vector<NamedConfigIdSet>& configSets, const std::vector<eglu::ConfigInfo>& configInfos, const eglu::FilterList& baseFilters);
73 
74 private:
75 	std::string					m_name;
76 	std::string					m_description;
77 	std::vector<EGLint>			m_configIds;
78 };
79 
80 } // egl
81 } // deqp
82 
83 #endif // _TEGLSIMPLECONFIGCASE_HPP
84