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