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 } 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 { return m_testCtx; } getNativeDisplayFactory(void) const67 const eglu::NativeDisplayFactory& getNativeDisplayFactory (void) const { return m_nativeDisplayFactory; } getNativeDisplay(void) const68 eglu::NativeDisplay& getNativeDisplay (void) const { return *m_nativeDisplay; } 69 const eglw::Library& getLibrary (void) const; 70 71 void initGLFunctions (glw::Functions* dst, glu::ApiType apiType) const; 72 void initGLFunctions (glw::Functions* dst, glu::ApiType apiType, int numExtensions, const char* const* extensions) const; 73 74 private: 75 EglTestContext (const EglTestContext&); 76 EglTestContext& operator= (const EglTestContext&); 77 78 tcu::TestContext& m_testCtx; 79 const eglu::NativeDisplayFactory& m_nativeDisplayFactory; 80 de::UniquePtr<eglu::NativeDisplay> m_nativeDisplay; 81 mutable eglu::GLLibraryCache m_glLibraryCache; 82 }; 83 84 class TestCaseGroup : public tcu::TestCaseGroup 85 { 86 public: 87 TestCaseGroup (EglTestContext& eglTestCtx, const char* name, const char* description); 88 virtual ~TestCaseGroup (void); 89 90 protected: 91 EglTestContext& m_eglTestCtx; 92 }; 93 94 class TestCase : public tcu::TestCase 95 { 96 public: 97 TestCase (EglTestContext& eglTestCtx, const char* name, const char* description); 98 TestCase (EglTestContext& eglTestCtx, tcu::TestNodeType type, const char* name, const char* description); 99 virtual ~TestCase (void); 100 101 protected: 102 EglTestContext& m_eglTestCtx; 103 }; 104 105 } // egl 106 } // deqp 107 108 #endif // _TEGLTESTCASE_HPP 109