xref: /aosp_15_r20/external/deqp/modules/egl/teglSimpleConfigCase.hpp (revision 35238bce31c2a825756842865a792f8cf7f89930)
1*35238bceSAndroid Build Coastguard Worker #ifndef _TEGLSIMPLECONFIGCASE_HPP
2*35238bceSAndroid Build Coastguard Worker #define _TEGLSIMPLECONFIGCASE_HPP
3*35238bceSAndroid Build Coastguard Worker /*-------------------------------------------------------------------------
4*35238bceSAndroid Build Coastguard Worker  * drawElements Quality Program EGL Module
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 Simple Context construction test.
24*35238bceSAndroid Build Coastguard Worker  *//*--------------------------------------------------------------------*/
25*35238bceSAndroid Build Coastguard Worker 
26*35238bceSAndroid Build Coastguard Worker #include "tcuDefs.hpp"
27*35238bceSAndroid Build Coastguard Worker #include "teglTestCase.hpp"
28*35238bceSAndroid Build Coastguard Worker #include "egluConfigFilter.hpp"
29*35238bceSAndroid Build Coastguard Worker 
30*35238bceSAndroid Build Coastguard Worker #include <vector>
31*35238bceSAndroid Build Coastguard Worker #include <string>
32*35238bceSAndroid Build Coastguard Worker 
33*35238bceSAndroid Build Coastguard Worker namespace deqp
34*35238bceSAndroid Build Coastguard Worker {
35*35238bceSAndroid Build Coastguard Worker namespace egl
36*35238bceSAndroid Build Coastguard Worker {
37*35238bceSAndroid Build Coastguard Worker 
38*35238bceSAndroid Build Coastguard Worker class SimpleConfigCase : public TestCase
39*35238bceSAndroid Build Coastguard Worker {
40*35238bceSAndroid Build Coastguard Worker public:
41*35238bceSAndroid Build Coastguard Worker     SimpleConfigCase(EglTestContext &eglTestCtx, const char *name, const char *description,
42*35238bceSAndroid Build Coastguard Worker                      const eglu::FilterList &filters);
43*35238bceSAndroid Build Coastguard Worker     virtual ~SimpleConfigCase(void);
44*35238bceSAndroid Build Coastguard Worker 
45*35238bceSAndroid Build Coastguard Worker     void init(void);
46*35238bceSAndroid Build Coastguard Worker     void deinit(void);
47*35238bceSAndroid Build Coastguard Worker     IterateResult iterate(void);
48*35238bceSAndroid Build Coastguard Worker 
49*35238bceSAndroid Build Coastguard Worker protected:
getDisplay(void)50*35238bceSAndroid Build Coastguard Worker     eglw::EGLDisplay getDisplay(void)
51*35238bceSAndroid Build Coastguard Worker     {
52*35238bceSAndroid Build Coastguard Worker         return m_display;
53*35238bceSAndroid Build Coastguard Worker     }
54*35238bceSAndroid Build Coastguard Worker 
55*35238bceSAndroid Build Coastguard Worker private:
56*35238bceSAndroid Build Coastguard Worker     virtual void executeForConfig(eglw::EGLDisplay display, eglw::EGLConfig config) = DE_NULL;
57*35238bceSAndroid Build Coastguard Worker 
58*35238bceSAndroid Build Coastguard Worker     SimpleConfigCase(const SimpleConfigCase &other);
59*35238bceSAndroid Build Coastguard Worker     SimpleConfigCase &operator=(const SimpleConfigCase &other);
60*35238bceSAndroid Build Coastguard Worker 
61*35238bceSAndroid Build Coastguard Worker     const eglu::FilterList m_filters;
62*35238bceSAndroid Build Coastguard Worker 
63*35238bceSAndroid Build Coastguard Worker     eglw::EGLDisplay m_display;
64*35238bceSAndroid Build Coastguard Worker     std::vector<eglw::EGLConfig> m_configs;
65*35238bceSAndroid Build Coastguard Worker     std::vector<eglw::EGLConfig>::iterator m_configIter;
66*35238bceSAndroid Build Coastguard Worker };
67*35238bceSAndroid Build Coastguard Worker 
68*35238bceSAndroid Build Coastguard Worker class NamedFilterList : public eglu::FilterList
69*35238bceSAndroid Build Coastguard Worker {
70*35238bceSAndroid Build Coastguard Worker public:
NamedFilterList(const char * name,const char * description)71*35238bceSAndroid Build Coastguard Worker     NamedFilterList(const char *name, const char *description) : m_name(name), m_description(description)
72*35238bceSAndroid Build Coastguard Worker     {
73*35238bceSAndroid Build Coastguard Worker     }
74*35238bceSAndroid Build Coastguard Worker 
getName(void) const75*35238bceSAndroid Build Coastguard Worker     const char *getName(void) const
76*35238bceSAndroid Build Coastguard Worker     {
77*35238bceSAndroid Build Coastguard Worker         return m_name.c_str();
78*35238bceSAndroid Build Coastguard Worker     }
getDescription(void) const79*35238bceSAndroid Build Coastguard Worker     const char *getDescription(void) const
80*35238bceSAndroid Build Coastguard Worker     {
81*35238bceSAndroid Build Coastguard Worker         return m_description.c_str();
82*35238bceSAndroid Build Coastguard Worker     }
83*35238bceSAndroid Build Coastguard Worker 
84*35238bceSAndroid Build Coastguard Worker private:
85*35238bceSAndroid Build Coastguard Worker     std::string m_name;
86*35238bceSAndroid Build Coastguard Worker     std::string m_description;
87*35238bceSAndroid Build Coastguard Worker };
88*35238bceSAndroid Build Coastguard Worker 
89*35238bceSAndroid Build Coastguard Worker void getDefaultFilterLists(std::vector<NamedFilterList> &lists, const eglu::FilterList &baseFilters);
90*35238bceSAndroid Build Coastguard Worker 
91*35238bceSAndroid Build Coastguard Worker } // namespace egl
92*35238bceSAndroid Build Coastguard Worker } // namespace deqp
93*35238bceSAndroid Build Coastguard Worker 
94*35238bceSAndroid Build Coastguard Worker #endif // _TEGLSIMPLECONFIGCASE_HPP
95