1 /*-------------------------------------------------------------------------
2 * drawElements Quality Program EGL Module
3 * ---------------------------------------
5 * Copyright 2014 The Android Open Source Project
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 * \brief EGL Test Case
22 *//*--------------------------------------------------------------------*/
24 #include "teglTestCase.hpp"
26 #include "tcuPlatform.hpp"
28 #include "egluUtil.hpp"
29 #include "egluGLFunctionLoader.hpp"
30 #include "egluPlatform.hpp"
32 #include "eglwLibrary.hpp"
33 #include "eglwEnums.hpp"
35 #include "gluRenderContext.hpp"
36 #include "glwInitFunctions.hpp"
45 EglTestContext::EglTestContext (tcu::TestContext& testCtx, const eglu::NativeDisplayFactory& displayFactory)
47 , m_nativeDisplayFactory (displayFactory)
48 , m_nativeDisplay (m_nativeDisplayFactory.createDisplay())
49 , m_glLibraryCache (testCtx.getPlatform().getEGLPlatform(), testCtx.getCommandLine())
53 EglTestContext::~EglTestContext (void)
57 const eglw::Library& EglTestContext::getLibrary (void) const
59 return m_nativeDisplay->getLibrary();
62 void EglTestContext::initGLFunctions (glw::Functions* dst, glu::ApiType apiType) const
64 initGLFunctions(dst, apiType, 0, DE_NULL);
67 void EglTestContext::initGLFunctions (glw::Functions* dst, glu::ApiType apiType, int numExtensions, const char* const* extensions) const
69 const tcu::FunctionLibrary* platformLib = m_glLibraryCache.getLibrary(apiType);
70 const eglu::GLFunctionLoader loader (getLibrary(), platformLib);
72 glu::initCoreFunctions(dst, &loader, apiType);
73 glu::initExtensionFunctions(dst, &loader, apiType, numExtensions, extensions);
76 TestCaseGroup::TestCaseGroup (EglTestContext& eglTestCtx, const char* name, const char* description)
77 : tcu::TestCaseGroup (eglTestCtx.getTestContext(), name, description)
78 , m_eglTestCtx (eglTestCtx)
82 TestCaseGroup::~TestCaseGroup (void)
86 TestCase::TestCase (EglTestContext& eglTestCtx, const char* name, const char* description)
87 : tcu::TestCase (eglTestCtx.getTestContext(), name, description)
88 , m_eglTestCtx (eglTestCtx)
92 TestCase::TestCase (EglTestContext& eglTestCtx, tcu::TestNodeType type, const char* name, const char* description)
93 : tcu::TestCase (eglTestCtx.getTestContext(), type, name, description)
94 , m_eglTestCtx (eglTestCtx)
98 TestCase::~TestCase (void)