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