xref: /aosp_15_r20/external/deqp/modules/egl/teglTestCase.hpp (revision 35238bce31c2a825756842865a792f8cf7f89930)
1*35238bceSAndroid Build Coastguard Worker #ifndef _TEGLTESTCASE_HPP
2*35238bceSAndroid Build Coastguard Worker #define _TEGLTESTCASE_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 EGL Test Case
24*35238bceSAndroid Build Coastguard Worker  *//*--------------------------------------------------------------------*/
25*35238bceSAndroid Build Coastguard Worker 
26*35238bceSAndroid Build Coastguard Worker #include "tcuDefs.hpp"
27*35238bceSAndroid Build Coastguard Worker #include "tcuTestCase.hpp"
28*35238bceSAndroid Build Coastguard Worker #include "tcuFunctionLibrary.hpp"
29*35238bceSAndroid Build Coastguard Worker 
30*35238bceSAndroid Build Coastguard Worker #include "egluNativeDisplay.hpp"
31*35238bceSAndroid Build Coastguard Worker #include "egluGLFunctionLoader.hpp"
32*35238bceSAndroid Build Coastguard Worker #include "egluConfigInfo.hpp"
33*35238bceSAndroid Build Coastguard Worker 
34*35238bceSAndroid Build Coastguard Worker #include "eglwDefs.hpp"
35*35238bceSAndroid Build Coastguard Worker 
36*35238bceSAndroid Build Coastguard Worker #include "gluRenderContext.hpp"
37*35238bceSAndroid Build Coastguard Worker 
38*35238bceSAndroid Build Coastguard Worker #include "deUniquePtr.hpp"
39*35238bceSAndroid Build Coastguard Worker 
40*35238bceSAndroid Build Coastguard Worker namespace eglu
41*35238bceSAndroid Build Coastguard Worker {
42*35238bceSAndroid Build Coastguard Worker class NativeDisplay;
43*35238bceSAndroid Build Coastguard Worker class NativeWindow;
44*35238bceSAndroid Build Coastguard Worker class NativePixmap;
45*35238bceSAndroid Build Coastguard Worker class NativeDisplayFactory;
46*35238bceSAndroid Build Coastguard Worker class NativeWindowFactory;
47*35238bceSAndroid Build Coastguard Worker class NativePixmapFactory;
48*35238bceSAndroid Build Coastguard Worker } // namespace eglu
49*35238bceSAndroid Build Coastguard Worker 
50*35238bceSAndroid Build Coastguard Worker namespace eglw
51*35238bceSAndroid Build Coastguard Worker {
52*35238bceSAndroid Build Coastguard Worker class Library;
53*35238bceSAndroid Build Coastguard Worker }
54*35238bceSAndroid Build Coastguard Worker 
55*35238bceSAndroid Build Coastguard Worker namespace deqp
56*35238bceSAndroid Build Coastguard Worker {
57*35238bceSAndroid Build Coastguard Worker namespace egl
58*35238bceSAndroid Build Coastguard Worker {
59*35238bceSAndroid Build Coastguard Worker 
60*35238bceSAndroid Build Coastguard Worker class EglTestContext
61*35238bceSAndroid Build Coastguard Worker {
62*35238bceSAndroid Build Coastguard Worker public:
63*35238bceSAndroid Build Coastguard Worker     EglTestContext(tcu::TestContext &testCtx, const eglu::NativeDisplayFactory &displayFactory);
64*35238bceSAndroid Build Coastguard Worker     ~EglTestContext(void);
65*35238bceSAndroid Build Coastguard Worker 
getTestContext(void) const66*35238bceSAndroid Build Coastguard Worker     tcu::TestContext &getTestContext(void) const
67*35238bceSAndroid Build Coastguard Worker     {
68*35238bceSAndroid Build Coastguard Worker         return m_testCtx;
69*35238bceSAndroid Build Coastguard Worker     }
getNativeDisplayFactory(void) const70*35238bceSAndroid Build Coastguard Worker     const eglu::NativeDisplayFactory &getNativeDisplayFactory(void) const
71*35238bceSAndroid Build Coastguard Worker     {
72*35238bceSAndroid Build Coastguard Worker         return m_nativeDisplayFactory;
73*35238bceSAndroid Build Coastguard Worker     }
getNativeDisplay(void) const74*35238bceSAndroid Build Coastguard Worker     eglu::NativeDisplay &getNativeDisplay(void) const
75*35238bceSAndroid Build Coastguard Worker     {
76*35238bceSAndroid Build Coastguard Worker         return *m_nativeDisplay;
77*35238bceSAndroid Build Coastguard Worker     }
78*35238bceSAndroid Build Coastguard Worker     const eglw::Library &getLibrary(void) const;
79*35238bceSAndroid Build Coastguard Worker 
80*35238bceSAndroid Build Coastguard Worker     void initGLFunctions(glw::Functions *dst, glu::ApiType apiType) const;
81*35238bceSAndroid Build Coastguard Worker     void initGLFunctions(glw::Functions *dst, glu::ApiType apiType, int numExtensions,
82*35238bceSAndroid Build Coastguard Worker                          const char *const *extensions) const;
83*35238bceSAndroid Build Coastguard Worker 
84*35238bceSAndroid Build Coastguard Worker private:
85*35238bceSAndroid Build Coastguard Worker     EglTestContext(const EglTestContext &);
86*35238bceSAndroid Build Coastguard Worker     EglTestContext &operator=(const EglTestContext &);
87*35238bceSAndroid Build Coastguard Worker 
88*35238bceSAndroid Build Coastguard Worker     tcu::TestContext &m_testCtx;
89*35238bceSAndroid Build Coastguard Worker     const eglu::NativeDisplayFactory &m_nativeDisplayFactory;
90*35238bceSAndroid Build Coastguard Worker     de::UniquePtr<eglu::NativeDisplay> m_nativeDisplay;
91*35238bceSAndroid Build Coastguard Worker     mutable eglu::GLLibraryCache m_glLibraryCache;
92*35238bceSAndroid Build Coastguard Worker };
93*35238bceSAndroid Build Coastguard Worker 
94*35238bceSAndroid Build Coastguard Worker class TestCaseGroup : public tcu::TestCaseGroup
95*35238bceSAndroid Build Coastguard Worker {
96*35238bceSAndroid Build Coastguard Worker public:
97*35238bceSAndroid Build Coastguard Worker     TestCaseGroup(EglTestContext &eglTestCtx, const char *name, const char *description);
98*35238bceSAndroid Build Coastguard Worker     virtual ~TestCaseGroup(void);
99*35238bceSAndroid Build Coastguard Worker 
100*35238bceSAndroid Build Coastguard Worker protected:
101*35238bceSAndroid Build Coastguard Worker     EglTestContext &m_eglTestCtx;
102*35238bceSAndroid Build Coastguard Worker };
103*35238bceSAndroid Build Coastguard Worker 
104*35238bceSAndroid Build Coastguard Worker class TestCase : public tcu::TestCase
105*35238bceSAndroid Build Coastguard Worker {
106*35238bceSAndroid Build Coastguard Worker public:
107*35238bceSAndroid Build Coastguard Worker     TestCase(EglTestContext &eglTestCtx, const char *name, const char *description);
108*35238bceSAndroid Build Coastguard Worker     TestCase(EglTestContext &eglTestCtx, tcu::TestNodeType type, const char *name, const char *description);
109*35238bceSAndroid Build Coastguard Worker     virtual ~TestCase(void);
110*35238bceSAndroid Build Coastguard Worker 
111*35238bceSAndroid Build Coastguard Worker protected:
112*35238bceSAndroid Build Coastguard Worker     EglTestContext &m_eglTestCtx;
113*35238bceSAndroid Build Coastguard Worker };
114*35238bceSAndroid Build Coastguard Worker 
115*35238bceSAndroid Build Coastguard Worker } // namespace egl
116*35238bceSAndroid Build Coastguard Worker } // namespace deqp
117*35238bceSAndroid Build Coastguard Worker 
118*35238bceSAndroid Build Coastguard Worker #endif // _TEGLTESTCASE_HPP
119