Home | History | Annotate | Download | only in egl
      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 
     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 
     53 EglTestContext::~EglTestContext (void)
     54 {
     55 }
     56 
     57 const eglw::Library& EglTestContext::getLibrary (void) const
     58 {
     59 	return m_nativeDisplay->getLibrary();
     60 }
     61 
     62 void EglTestContext::initGLFunctions (glw::Functions* dst, glu::ApiType apiType) const
     63 {
     64 	initGLFunctions(dst, apiType, 0, DE_NULL);
     65 }
     66 
     67 void EglTestContext::initGLFunctions (glw::Functions* dst, glu::ApiType apiType, int numExtensions, const char* const* extensions) const
     68 {
     69 	const tcu::FunctionLibrary*		platformLib		= m_glLibraryCache.getLibrary(apiType);
     70 	const eglu::GLFunctionLoader	loader			(getLibrary(), platformLib);
     71 
     72 	glu::initCoreFunctions(dst, &loader, apiType);
     73 	glu::initExtensionFunctions(dst, &loader, apiType, numExtensions, extensions);
     74 }
     75 
     76 TestCaseGroup::TestCaseGroup (EglTestContext& eglTestCtx, const char* name, const char* description)
     77 	: tcu::TestCaseGroup	(eglTestCtx.getTestContext(), name, description)
     78 	, m_eglTestCtx			(eglTestCtx)
     79 {
     80 }
     81 
     82 TestCaseGroup::~TestCaseGroup (void)
     83 {
     84 }
     85 
     86 TestCase::TestCase (EglTestContext& eglTestCtx, const char* name, const char* description)
     87 	: tcu::TestCase		(eglTestCtx.getTestContext(), name, description)
     88 	, m_eglTestCtx		(eglTestCtx)
     89 {
     90 }
     91 
     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)
     95 {
     96 }
     97 
     98 TestCase::~TestCase (void)
     99 {
    100 }
    101 
    102 } // egl
    103 } // deqp
    104