1 /*-------------------------------------------------------------------------
2 * drawElements Quality Program EGL Module
3 * ---------------------------------------
4 *
5 * Copyright 2014 The Android Open Source Project
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 *
19 *//*!
20 * \file
21 * \brief EGL Test Case
22 *//*--------------------------------------------------------------------*/
23
24 #include "teglTestCase.hpp"
25
26 #include "tcuPlatform.hpp"
27
28 #include "egluUtil.hpp"
29 #include "egluGLFunctionLoader.hpp"
30 #include "egluPlatform.hpp"
31
32 #include "eglwLibrary.hpp"
33 #include "eglwEnums.hpp"
34
35 #include "gluRenderContext.hpp"
36 #include "glwInitFunctions.hpp"
37
38 namespace deqp
39 {
40 namespace egl
41 {
42
43 using namespace eglw;
44
EglTestContext(tcu::TestContext & testCtx,const eglu::NativeDisplayFactory & displayFactory)45 EglTestContext::EglTestContext(tcu::TestContext &testCtx, const eglu::NativeDisplayFactory &displayFactory)
46 : m_testCtx(testCtx)
47 , m_nativeDisplayFactory(displayFactory)
48 , m_nativeDisplay(m_nativeDisplayFactory.createDisplay())
49 , m_glLibraryCache(testCtx.getPlatform().getEGLPlatform(), testCtx.getCommandLine())
50 {
51 }
52
~EglTestContext(void)53 EglTestContext::~EglTestContext(void)
54 {
55 }
56
getLibrary(void) const57 const eglw::Library &EglTestContext::getLibrary(void) const
58 {
59 return m_nativeDisplay->getLibrary();
60 }
61
initGLFunctions(glw::Functions * dst,glu::ApiType apiType) const62 void EglTestContext::initGLFunctions(glw::Functions *dst, glu::ApiType apiType) const
63 {
64 initGLFunctions(dst, apiType, 0, DE_NULL);
65 }
66
initGLFunctions(glw::Functions * dst,glu::ApiType apiType,int numExtensions,const char * const * extensions) const67 void EglTestContext::initGLFunctions(glw::Functions *dst, glu::ApiType apiType, int numExtensions,
68 const char *const *extensions) const
69 {
70 const tcu::FunctionLibrary *platformLib = m_glLibraryCache.getLibrary(apiType);
71 const eglu::GLFunctionLoader loader(getLibrary(), platformLib);
72
73 glu::initCoreFunctions(dst, &loader, apiType);
74 glu::initExtensionFunctions(dst, &loader, apiType, numExtensions, extensions);
75 }
76
TestCaseGroup(EglTestContext & eglTestCtx,const char * name,const char * description)77 TestCaseGroup::TestCaseGroup(EglTestContext &eglTestCtx, const char *name, const char *description)
78 : tcu::TestCaseGroup(eglTestCtx.getTestContext(), name, description)
79 , m_eglTestCtx(eglTestCtx)
80 {
81 }
82
~TestCaseGroup(void)83 TestCaseGroup::~TestCaseGroup(void)
84 {
85 }
86
TestCase(EglTestContext & eglTestCtx,const char * name,const char * description)87 TestCase::TestCase(EglTestContext &eglTestCtx, const char *name, const char *description)
88 : tcu::TestCase(eglTestCtx.getTestContext(), name, description)
89 , m_eglTestCtx(eglTestCtx)
90 {
91 }
92
TestCase(EglTestContext & eglTestCtx,tcu::TestNodeType type,const char * name,const char * description)93 TestCase::TestCase(EglTestContext &eglTestCtx, tcu::TestNodeType type, const char *name, const char *description)
94 : tcu::TestCase(eglTestCtx.getTestContext(), type, name, description)
95 , m_eglTestCtx(eglTestCtx)
96 {
97 }
98
~TestCase(void)99 TestCase::~TestCase(void)
100 {
101 }
102
103 } // namespace egl
104 } // namespace deqp
105