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
34namespace deqp
35{
36namespace egl
37{
38
39class SimpleConfigCase : public TestCase
40{
41public:
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
48private:
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
59class NamedConfigIdSet
60{
61public:
62								NamedConfigIdSet		(void) {}
63								NamedConfigIdSet		(const char* name, const char* description) : m_name(name), m_description(description) {}
64								NamedConfigIdSet		(const char* name, const char* description, const std::vector<EGLint>& configIds) : m_name(name), m_description(description), m_configIds(configIds) {}
65
66	const char*					getName					(void) const	{ return m_name.c_str();		}
67	const char*					getDescription			(void) const	{ return m_description.c_str();	}
68	const std::vector<EGLint>	getConfigIds			(void) const	{ return m_configIds;			}
69
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
74private:
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