Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 1 | #ifndef _TEGLRENDERCASE_HPP |
| 2 | #define _TEGLRENDERCASE_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 Base class for rendering tests. |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 24 | *//*--------------------------------------------------------------------*/ |
| 25 | |
| 26 | #include "tcuDefs.hpp" |
| 27 | #include "teglTestCase.hpp" |
| 28 | #include "teglSimpleConfigCase.hpp" |
| 29 | |
| 30 | #include <vector> |
| 31 | |
| 32 | namespace deqp |
| 33 | { |
| 34 | namespace egl |
| 35 | { |
| 36 | |
| 37 | class RenderCase : public SimpleConfigCase |
| 38 | { |
| 39 | public: |
Mika Isojärvi | 43105a3 | 2015-04-14 11:52:21 -0700 | [diff] [blame] | 40 | RenderCase (EglTestContext& eglTestCtx, const char* name, const char* description, eglw::EGLint surfaceTypeMask, const eglu::FilterList& filters); |
Pyry Haulos | 3c67e4f | 2014-12-19 15:45:39 -0800 | [diff] [blame] | 41 | virtual ~RenderCase (void); |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 42 | |
| 43 | protected: |
Pyry Haulos | 3c67e4f | 2014-12-19 15:45:39 -0800 | [diff] [blame] | 44 | struct Config |
| 45 | { |
| 46 | eglw::EGLConfig config; |
| 47 | eglw::EGLint surfaceTypeBit; |
| 48 | eglw::EGLint apiBits; |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 49 | |
Pyry Haulos | 3c67e4f | 2014-12-19 15:45:39 -0800 | [diff] [blame] | 50 | Config (eglw::EGLConfig config_, eglw::EGLint surfaceTypeBit_, eglw::EGLint apiBits_) |
| 51 | : config (config_) |
| 52 | , surfaceTypeBit (surfaceTypeBit_) |
| 53 | , apiBits (apiBits_) |
| 54 | { |
| 55 | } |
| 56 | }; |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 57 | |
Pyry Haulos | 3c67e4f | 2014-12-19 15:45:39 -0800 | [diff] [blame] | 58 | virtual void executeForConfig (eglw::EGLDisplay display, eglw::EGLConfig config); |
Pyry Haulos | 3c67e4f | 2014-12-19 15:45:39 -0800 | [diff] [blame] | 59 | virtual void executeForSurface (eglw::EGLDisplay display, eglw::EGLSurface surface, const Config& config) = DE_NULL; |
| 60 | |
Pyry Haulos | 3c67e4f | 2014-12-19 15:45:39 -0800 | [diff] [blame] | 61 | eglw::EGLint m_surfaceTypeMask; |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 62 | }; |
| 63 | |
| 64 | class SingleContextRenderCase : public RenderCase |
| 65 | { |
| 66 | public: |
Pyry Haulos | 3c67e4f | 2014-12-19 15:45:39 -0800 | [diff] [blame] | 67 | SingleContextRenderCase (EglTestContext& eglTestCtx, const char* name, const char* description, eglw::EGLint apiMask, eglw::EGLint surfaceTypeMask, const eglu::FilterList& filters); |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 68 | virtual ~SingleContextRenderCase (void); |
| 69 | |
| 70 | protected: |
Pyry Haulos | 3c67e4f | 2014-12-19 15:45:39 -0800 | [diff] [blame] | 71 | virtual void executeForSurface (eglw::EGLDisplay display, eglw::EGLSurface surface, const Config& config); |
Pyry Haulos | 3c67e4f | 2014-12-19 15:45:39 -0800 | [diff] [blame] | 72 | virtual void executeForContext (eglw::EGLDisplay display, eglw::EGLContext context, eglw::EGLSurface surface, const Config& config) = DE_NULL; |
Mika Isojärvi | 43105a3 | 2015-04-14 11:52:21 -0700 | [diff] [blame] | 73 | |
| 74 | eglw::EGLint m_apiMask; |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 75 | }; |
| 76 | |
| 77 | class MultiContextRenderCase : public RenderCase |
| 78 | { |
| 79 | public: |
Pyry Haulos | 3c67e4f | 2014-12-19 15:45:39 -0800 | [diff] [blame] | 80 | MultiContextRenderCase (EglTestContext& eglTestCtx, const char* name, const char* description, eglw::EGLint api, eglw::EGLint surfaceType, const eglu::FilterList& filters, int numContextsPerApi); |
| 81 | virtual ~MultiContextRenderCase (void); |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 82 | |
| 83 | protected: |
Mika Isojärvi | 43105a3 | 2015-04-14 11:52:21 -0700 | [diff] [blame] | 84 | virtual void executeForSurface (eglw::EGLDisplay display, eglw::EGLSurface surface, const Config& config); |
Pyry Haulos | 3c67e4f | 2014-12-19 15:45:39 -0800 | [diff] [blame] | 85 | virtual void executeForContexts (eglw::EGLDisplay display, eglw::EGLSurface surface, const Config& config, const std::vector<std::pair<eglw::EGLint, eglw::EGLContext> >& contexts) = DE_NULL; |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 86 | |
Pyry Haulos | 3c67e4f | 2014-12-19 15:45:39 -0800 | [diff] [blame] | 87 | int m_numContextsPerApi; |
Mika Isojärvi | 43105a3 | 2015-04-14 11:52:21 -0700 | [diff] [blame] | 88 | eglw::EGLint m_apiMask; |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 89 | }; |
| 90 | |
Pyry Haulos | 3c67e4f | 2014-12-19 15:45:39 -0800 | [diff] [blame] | 91 | class RenderFilterList : public NamedFilterList |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 92 | { |
| 93 | public: |
Pyry Haulos | 3c67e4f | 2014-12-19 15:45:39 -0800 | [diff] [blame] | 94 | RenderFilterList (const char* name, const char* description, eglw::EGLint surfaceTypeMask) |
| 95 | : NamedFilterList (name, description) |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 96 | , m_surfaceTypeMask (surfaceTypeMask) |
| 97 | { |
| 98 | } |
| 99 | |
Pyry Haulos | 3c67e4f | 2014-12-19 15:45:39 -0800 | [diff] [blame] | 100 | eglw::EGLint getSurfaceTypeMask (void) const |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 101 | { |
| 102 | return m_surfaceTypeMask; |
| 103 | } |
| 104 | |
| 105 | private: |
Pyry Haulos | 3c67e4f | 2014-12-19 15:45:39 -0800 | [diff] [blame] | 106 | eglw::EGLint m_surfaceTypeMask; |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 107 | }; |
| 108 | |
Pyry Haulos | 3c67e4f | 2014-12-19 15:45:39 -0800 | [diff] [blame] | 109 | void getDefaultRenderFilterLists (std::vector<RenderFilterList>& configSets, const eglu::FilterList& baseFilters); |
| 110 | |
| 111 | //! Client APIs supported in current build |
| 112 | eglw::EGLint getBuildClientAPIMask (void); |
Jarkko Poyry | 3c82736 | 2014-09-02 11:48:52 +0300 | [diff] [blame] | 113 | |
| 114 | } // egl |
| 115 | } // deqp |
| 116 | |
| 117 | #endif // _TEGLRENDERCASE_HPP |