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.
24 * \todo [2011-07-18 pyry] Uses currently gles2-specific RenderContext.
25 *//*--------------------------------------------------------------------*/
26
27#include "tcuDefs.hpp"
28#include "teglTestCase.hpp"
29#include "teglSimpleConfigCase.hpp"
30
31#include <vector>
32
33namespace deqp
34{
35namespace egl
36{
37
38class RenderCase : public SimpleConfigCase
39{
40public:
41					RenderCase				(EglTestContext& eglTestCtx, const char* name, const char* description, EGLint apiMask, EGLint surfaceTypeMask, const std::vector<EGLint>& configIds);
42	virtual			~RenderCase				(void);
43
44	static EGLint	getSupportedApis		(void);
45
46protected:
47	virtual void	executeForConfig		(tcu::egl::Display& display, EGLConfig config);
48
49	virtual void	executeForSurface		(tcu::egl::Display& display, tcu::egl::Surface& surface, EGLConfig config) = DE_NULL;
50
51	EGLint			m_apiMask;
52	EGLint			m_surfaceTypeMask;
53};
54
55class SingleContextRenderCase : public RenderCase
56{
57public:
58					SingleContextRenderCase		(EglTestContext& eglTestCtx, const char* name, const char* description, EGLint apiMask, EGLint surfaceTypeMask, const std::vector<EGLint>& configIds);
59	virtual			~SingleContextRenderCase	(void);
60
61protected:
62	virtual void	executeForSurface			(tcu::egl::Display& display, tcu::egl::Surface& surface, EGLConfig config);
63
64	virtual void	executeForContext			(const tcu::egl::Display& display, tcu::egl::Context& context, tcu::egl::Surface& surface, EGLint api) = DE_NULL;
65};
66
67class MultiContextRenderCase : public RenderCase
68{
69public:
70						MultiContextRenderCase		(EglTestContext& eglTestCtx, const char* name, const char* description, EGLint api, EGLint surfaceType, const std::vector<EGLint>& configIds, int numContextsPerApi);
71	virtual				~MultiContextRenderCase		(void);
72
73protected:
74	void				executeForSurface			(tcu::egl::Display& display, tcu::egl::Surface& surface, EGLConfig config);
75
76	virtual void		executeForContexts			(tcu::egl::Display& display, tcu::egl::Surface& surface, EGLConfig config, const std::vector<std::pair<EGLint, tcu::egl::Context*> >& contexts) = DE_NULL;
77
78	int					m_numContextsPerApi;
79};
80
81class RenderConfigIdSet : public NamedConfigIdSet
82{
83public:
84	RenderConfigIdSet (const char* name, const char* description, std::vector<EGLint> configIds, EGLint surfaceTypeMask)
85		: NamedConfigIdSet	(name, description, configIds)
86		, m_surfaceTypeMask	(surfaceTypeMask)
87	{
88	}
89
90	EGLint getSurfaceTypeMask (void) const
91	{
92		return m_surfaceTypeMask;
93	}
94
95private:
96	EGLint m_surfaceTypeMask;
97};
98
99void getDefaultRenderConfigIdSets (std::vector<RenderConfigIdSet>& configSets, const std::vector<eglu::ConfigInfo>& configInfos, const eglu::FilterList& baseFilters);
100
101} // egl
102} // deqp
103
104#endif // _TEGLRENDERCASE_HPP
105