Add more structure constructor tests.
[piglit/hramrach.git] / tests / glean / tpixelformats.h
blobfaffc327b06e4b2184e401d89cceb869da4d4755
1 // BEGIN_COPYRIGHT -*- glean -*-
2 //
3 // Copyright (C) 1999 Allen Akin All Rights Reserved.
4 //
5 // Permission is hereby granted, free of charge, to any person
6 // obtaining a copy of this software and associated documentation
7 // files (the "Software"), to deal in the Software without
8 // restriction, including without limitation the rights to use,
9 // copy, modify, merge, publish, distribute, sublicense, and/or
10 // sell copies of the Software, and to permit persons to whom the
11 // Software is furnished to do so, subject to the following
12 // conditions:
13 //
14 // The above copyright notice and this permission notice shall be
15 // included in all copies or substantial portions of the
16 // Software.
17 //
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
19 // KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
20 // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
21 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ALLEN AKIN BE
22 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 // AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
24 // OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 // DEALINGS IN THE SOFTWARE.
26 //
27 // END_COPYRIGHT
29 // Brian Paul September 2006
31 #ifndef __tpixelformats_h__
32 #define __tpixelformats_h__
34 #include "tmultitest.h"
36 namespace GLEAN {
38 #define windowSize 100
41 class PixelFormatsTest: public MultiTest
43 public:
44 PixelFormatsTest(const char* testName, const char* filter,
45 const char *extensions, const char* description)
46 : MultiTest(testName, filter, extensions, description)
50 virtual void runOne(MultiTestResult &r, Window &w);
52 private:
53 int alphaBits;
54 int defaultAlpha; // depends on texture env mode
55 // extensions
56 bool haveHalfFloat;
57 bool haveABGR;
58 bool haveSRGB;
59 bool haveCombine;
61 bool CheckError(const char *where) const;
63 bool CompatibleFormatAndType(GLenum format, GLenum datatype) const;
65 bool SupportedIntFormat(GLint intFormat) const;
67 bool DrawImage(int width, int height,
68 GLenum format, GLenum type, GLint intFormat,
69 const GLubyte *image) const;
71 void ComputeExpected(GLenum srcFormat, int testChan,
72 GLint intFormat, GLubyte exp[4]) const;
74 bool CheckRendering(int width, int height, int color,
75 GLenum format, GLint intFormat) const;
77 bool TestCombination(GLenum format, GLenum type, GLint intFormat);
79 void setup(void);
82 } // namespace GLEAN
84 #endif // __tpixelformats_h__