• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef _ES31FFBOTESTCASE_HPP
2 #define _ES31FFBOTESTCASE_HPP
3 /*-------------------------------------------------------------------------
4  * drawElements Quality Program OpenGL ES 3.1 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 FBO tests.
24  *//*--------------------------------------------------------------------*/
25 
26 #include "tcuDefs.hpp"
27 #include "tes31TestCase.hpp"
28 #include "sglrContextWrapper.hpp"
29 
30 namespace tcu
31 {
32 class Surface;
33 class TextureFormat;
34 }
35 
36 namespace deqp
37 {
38 namespace gles31
39 {
40 namespace Functional
41 {
42 
43 class FboTestCase : public TestCase, public sglr::ContextWrapper
44 {
45 public:
46 						FboTestCase				(Context& context, const char* name, const char* description, bool useScreenSizedViewport = false);
47 						~FboTestCase			(void);
48 
49 	IterateResult		iterate					(void);
50 
51 protected:
preCheck(void)52 	virtual void		preCheck				(void) {}
53 	virtual void		render					(tcu::Surface& dst) = DE_NULL;
54 	virtual bool		compare					(const tcu::Surface& reference, const tcu::Surface& result);
55 
56 	// Utilities.
57 	void				checkFormatSupport		(deUint32 sizedFormat);
58 	void				checkSampleCount		(deUint32 sizedFormat, int numSamples);
59 	void				readPixels				(tcu::Surface& dst, int x, int y, int width, int height, const tcu::TextureFormat& format, const tcu::Vec4& scale, const tcu::Vec4& bias);
60 	void				readPixels				(tcu::Surface& dst, int x, int y, int width, int height);
61 	void				checkFramebufferStatus	(deUint32 target);
62 	void				checkError				(void);
63 	void				clearColorBuffer		(const tcu::TextureFormat& format, const tcu::Vec4& value = tcu::Vec4(0.0f, 0.0f, 0.0f, 0.0f));
64 
65 	int					m_viewportWidth;
66 	int					m_viewportHeight;
67 
68 private:
69 						FboTestCase				(const FboTestCase& other);
70 	FboTestCase&		operator=				(const FboTestCase& other);
71 };
72 
73 } // Functional
74 } // gles31
75 } // deqp
76 
77 #endif // _ES31FFBOTESTCASE_HPP
78