xref: /aosp_15_r20/external/deqp/modules/gles3/functional/es3fDitheringTests.cpp (revision 35238bce31c2a825756842865a792f8cf7f89930)
1*35238bceSAndroid Build Coastguard Worker /*-------------------------------------------------------------------------
2*35238bceSAndroid Build Coastguard Worker  * drawElements Quality Program OpenGL ES 3.0 Module
3*35238bceSAndroid Build Coastguard Worker  * -------------------------------------------------
4*35238bceSAndroid Build Coastguard Worker  *
5*35238bceSAndroid Build Coastguard Worker  * Copyright 2014 The Android Open Source Project
6*35238bceSAndroid Build Coastguard Worker  *
7*35238bceSAndroid Build Coastguard Worker  * Licensed under the Apache License, Version 2.0 (the "License");
8*35238bceSAndroid Build Coastguard Worker  * you may not use this file except in compliance with the License.
9*35238bceSAndroid Build Coastguard Worker  * You may obtain a copy of the License at
10*35238bceSAndroid Build Coastguard Worker  *
11*35238bceSAndroid Build Coastguard Worker  *      http://www.apache.org/licenses/LICENSE-2.0
12*35238bceSAndroid Build Coastguard Worker  *
13*35238bceSAndroid Build Coastguard Worker  * Unless required by applicable law or agreed to in writing, software
14*35238bceSAndroid Build Coastguard Worker  * distributed under the License is distributed on an "AS IS" BASIS,
15*35238bceSAndroid Build Coastguard Worker  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16*35238bceSAndroid Build Coastguard Worker  * See the License for the specific language governing permissions and
17*35238bceSAndroid Build Coastguard Worker  * limitations under the License.
18*35238bceSAndroid Build Coastguard Worker  *
19*35238bceSAndroid Build Coastguard Worker  *//*!
20*35238bceSAndroid Build Coastguard Worker  * \file
21*35238bceSAndroid Build Coastguard Worker  * \brief Dithering tests.
22*35238bceSAndroid Build Coastguard Worker  *//*--------------------------------------------------------------------*/
23*35238bceSAndroid Build Coastguard Worker 
24*35238bceSAndroid Build Coastguard Worker #include "es3fDitheringTests.hpp"
25*35238bceSAndroid Build Coastguard Worker #include "gluRenderContext.hpp"
26*35238bceSAndroid Build Coastguard Worker #include "gluDefs.hpp"
27*35238bceSAndroid Build Coastguard Worker #include "glsFragmentOpUtil.hpp"
28*35238bceSAndroid Build Coastguard Worker #include "gluPixelTransfer.hpp"
29*35238bceSAndroid Build Coastguard Worker #include "tcuRenderTarget.hpp"
30*35238bceSAndroid Build Coastguard Worker #include "tcuRGBA.hpp"
31*35238bceSAndroid Build Coastguard Worker #include "tcuVector.hpp"
32*35238bceSAndroid Build Coastguard Worker #include "tcuPixelFormat.hpp"
33*35238bceSAndroid Build Coastguard Worker #include "tcuTestLog.hpp"
34*35238bceSAndroid Build Coastguard Worker #include "tcuSurface.hpp"
35*35238bceSAndroid Build Coastguard Worker #include "tcuCommandLine.hpp"
36*35238bceSAndroid Build Coastguard Worker #include "deRandom.hpp"
37*35238bceSAndroid Build Coastguard Worker #include "deStringUtil.hpp"
38*35238bceSAndroid Build Coastguard Worker #include "deString.h"
39*35238bceSAndroid Build Coastguard Worker #include "deMath.h"
40*35238bceSAndroid Build Coastguard Worker 
41*35238bceSAndroid Build Coastguard Worker #include <string>
42*35238bceSAndroid Build Coastguard Worker #include <algorithm>
43*35238bceSAndroid Build Coastguard Worker 
44*35238bceSAndroid Build Coastguard Worker #include "glw.h"
45*35238bceSAndroid Build Coastguard Worker 
46*35238bceSAndroid Build Coastguard Worker namespace deqp
47*35238bceSAndroid Build Coastguard Worker {
48*35238bceSAndroid Build Coastguard Worker 
49*35238bceSAndroid Build Coastguard Worker using de::Random;
50*35238bceSAndroid Build Coastguard Worker using gls::FragmentOpUtil::Quad;
51*35238bceSAndroid Build Coastguard Worker using gls::FragmentOpUtil::QuadRenderer;
52*35238bceSAndroid Build Coastguard Worker using std::string;
53*35238bceSAndroid Build Coastguard Worker using std::vector;
54*35238bceSAndroid Build Coastguard Worker using tcu::IVec4;
55*35238bceSAndroid Build Coastguard Worker using tcu::PixelFormat;
56*35238bceSAndroid Build Coastguard Worker using tcu::Surface;
57*35238bceSAndroid Build Coastguard Worker using tcu::TestLog;
58*35238bceSAndroid Build Coastguard Worker using tcu::Vec4;
59*35238bceSAndroid Build Coastguard Worker 
60*35238bceSAndroid Build Coastguard Worker namespace gles3
61*35238bceSAndroid Build Coastguard Worker {
62*35238bceSAndroid Build Coastguard Worker namespace Functional
63*35238bceSAndroid Build Coastguard Worker {
64*35238bceSAndroid Build Coastguard Worker 
65*35238bceSAndroid Build Coastguard Worker static const char *const s_channelNames[4] = {"red", "green", "blue", "alpha"};
66*35238bceSAndroid Build Coastguard Worker 
pixelFormatToIVec4(const PixelFormat & format)67*35238bceSAndroid Build Coastguard Worker static inline IVec4 pixelFormatToIVec4(const PixelFormat &format)
68*35238bceSAndroid Build Coastguard Worker {
69*35238bceSAndroid Build Coastguard Worker     return IVec4(format.redBits, format.greenBits, format.blueBits, format.alphaBits);
70*35238bceSAndroid Build Coastguard Worker }
71*35238bceSAndroid Build Coastguard Worker 
72*35238bceSAndroid Build Coastguard Worker template <typename T>
choiceListStr(const vector<T> & choices)73*35238bceSAndroid Build Coastguard Worker static inline string choiceListStr(const vector<T> &choices)
74*35238bceSAndroid Build Coastguard Worker {
75*35238bceSAndroid Build Coastguard Worker     string result;
76*35238bceSAndroid Build Coastguard Worker     for (int i = 0; i < (int)choices.size(); i++)
77*35238bceSAndroid Build Coastguard Worker     {
78*35238bceSAndroid Build Coastguard Worker         if (i == (int)choices.size() - 1)
79*35238bceSAndroid Build Coastguard Worker             result += " or ";
80*35238bceSAndroid Build Coastguard Worker         else if (i > 0)
81*35238bceSAndroid Build Coastguard Worker             result += ", ";
82*35238bceSAndroid Build Coastguard Worker         result += de::toString(choices[i]);
83*35238bceSAndroid Build Coastguard Worker     }
84*35238bceSAndroid Build Coastguard Worker     return result;
85*35238bceSAndroid Build Coastguard Worker }
86*35238bceSAndroid Build Coastguard Worker 
87*35238bceSAndroid Build Coastguard Worker class DitheringCase : public tcu::TestCase
88*35238bceSAndroid Build Coastguard Worker {
89*35238bceSAndroid Build Coastguard Worker public:
90*35238bceSAndroid Build Coastguard Worker     enum PatternType
91*35238bceSAndroid Build Coastguard Worker     {
92*35238bceSAndroid Build Coastguard Worker         PATTERNTYPE_GRADIENT = 0,
93*35238bceSAndroid Build Coastguard Worker         PATTERNTYPE_UNICOLORED_QUAD,
94*35238bceSAndroid Build Coastguard Worker 
95*35238bceSAndroid Build Coastguard Worker         PATTERNTYPE_LAST
96*35238bceSAndroid Build Coastguard Worker     };
97*35238bceSAndroid Build Coastguard Worker 
98*35238bceSAndroid Build Coastguard Worker     DitheringCase(tcu::TestContext &testCtx, glu::RenderContext &renderCtx, const char *name, const char *description,
99*35238bceSAndroid Build Coastguard Worker                   bool isEnabled, PatternType patternType, const tcu::Vec4 &color);
100*35238bceSAndroid Build Coastguard Worker     ~DitheringCase(void);
101*35238bceSAndroid Build Coastguard Worker 
102*35238bceSAndroid Build Coastguard Worker     IterateResult iterate(void);
103*35238bceSAndroid Build Coastguard Worker     void init(void);
104*35238bceSAndroid Build Coastguard Worker     void deinit(void);
105*35238bceSAndroid Build Coastguard Worker 
106*35238bceSAndroid Build Coastguard Worker     static const char *getPatternTypeName(PatternType type);
107*35238bceSAndroid Build Coastguard Worker 
108*35238bceSAndroid Build Coastguard Worker private:
109*35238bceSAndroid Build Coastguard Worker     bool checkColor(const tcu::Vec4 &inputClr, const tcu::RGBA &renderedClr, bool logErrors, const bool incTol) const;
110*35238bceSAndroid Build Coastguard Worker 
111*35238bceSAndroid Build Coastguard Worker     bool drawAndCheckGradient(bool isVerticallyIncreasing, const tcu::Vec4 &highColor) const;
112*35238bceSAndroid Build Coastguard Worker     bool drawAndCheckUnicoloredQuad(const tcu::Vec4 &color) const;
113*35238bceSAndroid Build Coastguard Worker 
114*35238bceSAndroid Build Coastguard Worker     const glu::RenderContext &m_renderCtx;
115*35238bceSAndroid Build Coastguard Worker 
116*35238bceSAndroid Build Coastguard Worker     const bool m_ditheringEnabled;
117*35238bceSAndroid Build Coastguard Worker     const PatternType m_patternType;
118*35238bceSAndroid Build Coastguard Worker     const tcu::Vec4 m_color;
119*35238bceSAndroid Build Coastguard Worker 
120*35238bceSAndroid Build Coastguard Worker     const tcu::PixelFormat m_renderFormat;
121*35238bceSAndroid Build Coastguard Worker 
122*35238bceSAndroid Build Coastguard Worker     const QuadRenderer *m_renderer;
123*35238bceSAndroid Build Coastguard Worker     int m_iteration;
124*35238bceSAndroid Build Coastguard Worker };
125*35238bceSAndroid Build Coastguard Worker 
getPatternTypeName(const PatternType type)126*35238bceSAndroid Build Coastguard Worker const char *DitheringCase::getPatternTypeName(const PatternType type)
127*35238bceSAndroid Build Coastguard Worker {
128*35238bceSAndroid Build Coastguard Worker     switch (type)
129*35238bceSAndroid Build Coastguard Worker     {
130*35238bceSAndroid Build Coastguard Worker     case PATTERNTYPE_GRADIENT:
131*35238bceSAndroid Build Coastguard Worker         return "gradient";
132*35238bceSAndroid Build Coastguard Worker     case PATTERNTYPE_UNICOLORED_QUAD:
133*35238bceSAndroid Build Coastguard Worker         return "unicolored_quad";
134*35238bceSAndroid Build Coastguard Worker     default:
135*35238bceSAndroid Build Coastguard Worker         DE_ASSERT(false);
136*35238bceSAndroid Build Coastguard Worker         return DE_NULL;
137*35238bceSAndroid Build Coastguard Worker     }
138*35238bceSAndroid Build Coastguard Worker }
139*35238bceSAndroid Build Coastguard Worker 
DitheringCase(tcu::TestContext & testCtx,glu::RenderContext & renderCtx,const char * const name,const char * const description,const bool ditheringEnabled,const PatternType patternType,const Vec4 & color)140*35238bceSAndroid Build Coastguard Worker DitheringCase::DitheringCase(tcu::TestContext &testCtx, glu::RenderContext &renderCtx, const char *const name,
141*35238bceSAndroid Build Coastguard Worker                              const char *const description, const bool ditheringEnabled, const PatternType patternType,
142*35238bceSAndroid Build Coastguard Worker                              const Vec4 &color)
143*35238bceSAndroid Build Coastguard Worker     : TestCase(testCtx, name, description)
144*35238bceSAndroid Build Coastguard Worker     , m_renderCtx(renderCtx)
145*35238bceSAndroid Build Coastguard Worker     , m_ditheringEnabled(ditheringEnabled)
146*35238bceSAndroid Build Coastguard Worker     , m_patternType(patternType)
147*35238bceSAndroid Build Coastguard Worker     , m_color(color)
148*35238bceSAndroid Build Coastguard Worker     , m_renderFormat(renderCtx.getRenderTarget().getPixelFormat())
149*35238bceSAndroid Build Coastguard Worker     , m_renderer(DE_NULL)
150*35238bceSAndroid Build Coastguard Worker     , m_iteration(0)
151*35238bceSAndroid Build Coastguard Worker {
152*35238bceSAndroid Build Coastguard Worker }
153*35238bceSAndroid Build Coastguard Worker 
~DitheringCase(void)154*35238bceSAndroid Build Coastguard Worker DitheringCase::~DitheringCase(void)
155*35238bceSAndroid Build Coastguard Worker {
156*35238bceSAndroid Build Coastguard Worker     DitheringCase::deinit();
157*35238bceSAndroid Build Coastguard Worker }
158*35238bceSAndroid Build Coastguard Worker 
init(void)159*35238bceSAndroid Build Coastguard Worker void DitheringCase::init(void)
160*35238bceSAndroid Build Coastguard Worker {
161*35238bceSAndroid Build Coastguard Worker     DE_ASSERT(!m_renderer);
162*35238bceSAndroid Build Coastguard Worker     m_renderer  = new QuadRenderer(m_renderCtx, glu::GLSL_VERSION_300_ES);
163*35238bceSAndroid Build Coastguard Worker     m_iteration = 0;
164*35238bceSAndroid Build Coastguard Worker }
165*35238bceSAndroid Build Coastguard Worker 
deinit(void)166*35238bceSAndroid Build Coastguard Worker void DitheringCase::deinit(void)
167*35238bceSAndroid Build Coastguard Worker {
168*35238bceSAndroid Build Coastguard Worker     delete m_renderer;
169*35238bceSAndroid Build Coastguard Worker     m_renderer = DE_NULL;
170*35238bceSAndroid Build Coastguard Worker }
171*35238bceSAndroid Build Coastguard Worker 
checkColor(const Vec4 & inputClr,const tcu::RGBA & renderedClr,const bool logErrors,const bool incTol) const172*35238bceSAndroid Build Coastguard Worker bool DitheringCase::checkColor(const Vec4 &inputClr, const tcu::RGBA &renderedClr, const bool logErrors,
173*35238bceSAndroid Build Coastguard Worker                                const bool incTol) const
174*35238bceSAndroid Build Coastguard Worker {
175*35238bceSAndroid Build Coastguard Worker     const IVec4 channelBits = pixelFormatToIVec4(m_renderFormat);
176*35238bceSAndroid Build Coastguard Worker     bool allChannelsOk      = true;
177*35238bceSAndroid Build Coastguard Worker 
178*35238bceSAndroid Build Coastguard Worker     for (int chanNdx = 0; chanNdx < 4; chanNdx++)
179*35238bceSAndroid Build Coastguard Worker     {
180*35238bceSAndroid Build Coastguard Worker         if (channelBits[chanNdx] == 0)
181*35238bceSAndroid Build Coastguard Worker             continue;
182*35238bceSAndroid Build Coastguard Worker 
183*35238bceSAndroid Build Coastguard Worker         const int channelMax         = (1 << channelBits[chanNdx]) - 1;
184*35238bceSAndroid Build Coastguard Worker         const float scaledInput      = inputClr[chanNdx] * (float)channelMax;
185*35238bceSAndroid Build Coastguard Worker         const bool useRoundingMargin = deFloatAbs(scaledInput - deFloatRound(scaledInput)) < 0.0001f;
186*35238bceSAndroid Build Coastguard Worker         vector<int> channelChoices;
187*35238bceSAndroid Build Coastguard Worker 
188*35238bceSAndroid Build Coastguard Worker         channelChoices.push_back(de::min(channelMax, (int)deFloatCeil(scaledInput)));
189*35238bceSAndroid Build Coastguard Worker         channelChoices.push_back(de::max(0, (int)deFloatCeil(scaledInput) - 1));
190*35238bceSAndroid Build Coastguard Worker         // Allow for more tolerance for small dimension render targets
191*35238bceSAndroid Build Coastguard Worker         if (incTol)
192*35238bceSAndroid Build Coastguard Worker         {
193*35238bceSAndroid Build Coastguard Worker             channelChoices.push_back(de::max(0, (int)deFloatCeil(scaledInput) - 2));
194*35238bceSAndroid Build Coastguard Worker             channelChoices.push_back(de::max(0, (int)deFloatCeil(scaledInput) + 1));
195*35238bceSAndroid Build Coastguard Worker         }
196*35238bceSAndroid Build Coastguard Worker 
197*35238bceSAndroid Build Coastguard Worker         // If the input color results in a scaled value that is very close to an integer, account for a little bit of possible inaccuracy.
198*35238bceSAndroid Build Coastguard Worker         if (useRoundingMargin)
199*35238bceSAndroid Build Coastguard Worker         {
200*35238bceSAndroid Build Coastguard Worker             if (scaledInput > deFloatRound(scaledInput))
201*35238bceSAndroid Build Coastguard Worker                 channelChoices.push_back((int)deFloatCeil(scaledInput) - 2);
202*35238bceSAndroid Build Coastguard Worker             else
203*35238bceSAndroid Build Coastguard Worker                 channelChoices.push_back((int)deFloatCeil(scaledInput) + 1);
204*35238bceSAndroid Build Coastguard Worker         }
205*35238bceSAndroid Build Coastguard Worker 
206*35238bceSAndroid Build Coastguard Worker         std::sort(channelChoices.begin(), channelChoices.end());
207*35238bceSAndroid Build Coastguard Worker 
208*35238bceSAndroid Build Coastguard Worker         {
209*35238bceSAndroid Build Coastguard Worker             const int renderedClrInFormat =
210*35238bceSAndroid Build Coastguard Worker                 (int)deFloatRound((float)(renderedClr.toIVec()[chanNdx] * channelMax) / 255.0f);
211*35238bceSAndroid Build Coastguard Worker             bool goodChannel = false;
212*35238bceSAndroid Build Coastguard Worker 
213*35238bceSAndroid Build Coastguard Worker             for (int i = 0; i < (int)channelChoices.size(); i++)
214*35238bceSAndroid Build Coastguard Worker             {
215*35238bceSAndroid Build Coastguard Worker                 if (renderedClrInFormat == channelChoices[i])
216*35238bceSAndroid Build Coastguard Worker                 {
217*35238bceSAndroid Build Coastguard Worker                     goodChannel = true;
218*35238bceSAndroid Build Coastguard Worker                     break;
219*35238bceSAndroid Build Coastguard Worker                 }
220*35238bceSAndroid Build Coastguard Worker             }
221*35238bceSAndroid Build Coastguard Worker 
222*35238bceSAndroid Build Coastguard Worker             if (!goodChannel)
223*35238bceSAndroid Build Coastguard Worker             {
224*35238bceSAndroid Build Coastguard Worker                 if (logErrors)
225*35238bceSAndroid Build Coastguard Worker                 {
226*35238bceSAndroid Build Coastguard Worker                     m_testCtx.getLog() << TestLog::Message << "Failure: " << channelBits[chanNdx] << "-bit "
227*35238bceSAndroid Build Coastguard Worker                                        << s_channelNames[chanNdx] << " channel is " << renderedClrInFormat
228*35238bceSAndroid Build Coastguard Worker                                        << ", should be " << choiceListStr(channelChoices)
229*35238bceSAndroid Build Coastguard Worker                                        << " (corresponding fragment color channel is " << inputClr[chanNdx] << ")"
230*35238bceSAndroid Build Coastguard Worker                                        << TestLog::EndMessage << TestLog::Message << "Note: " << inputClr[chanNdx]
231*35238bceSAndroid Build Coastguard Worker                                        << " * (" << channelMax + 1 << "-1) = " << scaledInput << TestLog::EndMessage;
232*35238bceSAndroid Build Coastguard Worker 
233*35238bceSAndroid Build Coastguard Worker                     if (useRoundingMargin)
234*35238bceSAndroid Build Coastguard Worker                     {
235*35238bceSAndroid Build Coastguard Worker                         m_testCtx.getLog() << TestLog::Message
236*35238bceSAndroid Build Coastguard Worker                                            << "Note: one extra color candidate was allowed because "
237*35238bceSAndroid Build Coastguard Worker                                               "fragmentColorChannel * (2^bits-1) is close to an integer"
238*35238bceSAndroid Build Coastguard Worker                                            << TestLog::EndMessage;
239*35238bceSAndroid Build Coastguard Worker                     }
240*35238bceSAndroid Build Coastguard Worker                 }
241*35238bceSAndroid Build Coastguard Worker 
242*35238bceSAndroid Build Coastguard Worker                 allChannelsOk = false;
243*35238bceSAndroid Build Coastguard Worker             }
244*35238bceSAndroid Build Coastguard Worker         }
245*35238bceSAndroid Build Coastguard Worker     }
246*35238bceSAndroid Build Coastguard Worker 
247*35238bceSAndroid Build Coastguard Worker     return allChannelsOk;
248*35238bceSAndroid Build Coastguard Worker }
249*35238bceSAndroid Build Coastguard Worker 
drawAndCheckGradient(const bool isVerticallyIncreasing,const Vec4 & highColor) const250*35238bceSAndroid Build Coastguard Worker bool DitheringCase::drawAndCheckGradient(const bool isVerticallyIncreasing, const Vec4 &highColor) const
251*35238bceSAndroid Build Coastguard Worker {
252*35238bceSAndroid Build Coastguard Worker     TestLog &log = m_testCtx.getLog();
253*35238bceSAndroid Build Coastguard Worker     Random rnd(deStringHash(getName()));
254*35238bceSAndroid Build Coastguard Worker     const int maxViewportWid = 256;
255*35238bceSAndroid Build Coastguard Worker     const int maxViewportHei = 256;
256*35238bceSAndroid Build Coastguard Worker     const int viewportWid    = de::min(m_renderCtx.getRenderTarget().getWidth(), maxViewportWid);
257*35238bceSAndroid Build Coastguard Worker     const int viewportHei    = de::min(m_renderCtx.getRenderTarget().getHeight(), maxViewportHei);
258*35238bceSAndroid Build Coastguard Worker     const int viewportX      = rnd.getInt(0, m_renderCtx.getRenderTarget().getWidth() - viewportWid);
259*35238bceSAndroid Build Coastguard Worker     const int viewportY      = rnd.getInt(0, m_renderCtx.getRenderTarget().getHeight() - viewportHei);
260*35238bceSAndroid Build Coastguard Worker     const Vec4 quadClr0(0.0f, 0.0f, 0.0f, 0.0f);
261*35238bceSAndroid Build Coastguard Worker     const Vec4 &quadClr1 = highColor;
262*35238bceSAndroid Build Coastguard Worker     Quad quad;
263*35238bceSAndroid Build Coastguard Worker     Surface renderedImg(viewportWid, viewportHei);
264*35238bceSAndroid Build Coastguard Worker 
265*35238bceSAndroid Build Coastguard Worker     GLU_CHECK_CALL(glViewport(viewportX, viewportY, viewportWid, viewportHei));
266*35238bceSAndroid Build Coastguard Worker 
267*35238bceSAndroid Build Coastguard Worker     log << TestLog::Message << "Dithering is " << (m_ditheringEnabled ? "enabled" : "disabled") << TestLog::EndMessage;
268*35238bceSAndroid Build Coastguard Worker 
269*35238bceSAndroid Build Coastguard Worker     if (m_ditheringEnabled)
270*35238bceSAndroid Build Coastguard Worker         GLU_CHECK_CALL(glEnable(GL_DITHER));
271*35238bceSAndroid Build Coastguard Worker     else
272*35238bceSAndroid Build Coastguard Worker         GLU_CHECK_CALL(glDisable(GL_DITHER));
273*35238bceSAndroid Build Coastguard Worker 
274*35238bceSAndroid Build Coastguard Worker     log << TestLog::Message << "Drawing a " << (isVerticallyIncreasing ? "vertically" : "horizontally")
275*35238bceSAndroid Build Coastguard Worker         << " increasing gradient" << TestLog::EndMessage;
276*35238bceSAndroid Build Coastguard Worker 
277*35238bceSAndroid Build Coastguard Worker     quad.color[0] = quadClr0;
278*35238bceSAndroid Build Coastguard Worker     quad.color[1] = isVerticallyIncreasing ? quadClr1 : quadClr0;
279*35238bceSAndroid Build Coastguard Worker     quad.color[2] = isVerticallyIncreasing ? quadClr0 : quadClr1;
280*35238bceSAndroid Build Coastguard Worker     quad.color[3] = quadClr1;
281*35238bceSAndroid Build Coastguard Worker 
282*35238bceSAndroid Build Coastguard Worker     m_renderer->render(quad);
283*35238bceSAndroid Build Coastguard Worker 
284*35238bceSAndroid Build Coastguard Worker     glu::readPixels(m_renderCtx, viewportX, viewportY, renderedImg.getAccess());
285*35238bceSAndroid Build Coastguard Worker     GLU_CHECK_MSG("glReadPixels()");
286*35238bceSAndroid Build Coastguard Worker 
287*35238bceSAndroid Build Coastguard Worker     log << TestLog::Image(isVerticallyIncreasing ? "VerGradient" : "HorGradient",
288*35238bceSAndroid Build Coastguard Worker                           isVerticallyIncreasing ? "Vertical gradient" : "Horizontal gradient", renderedImg);
289*35238bceSAndroid Build Coastguard Worker 
290*35238bceSAndroid Build Coastguard Worker     // Validate, at each pixel, that each color channel is one of its two allowed values.
291*35238bceSAndroid Build Coastguard Worker 
292*35238bceSAndroid Build Coastguard Worker     {
293*35238bceSAndroid Build Coastguard Worker         Surface errorMask(viewportWid, viewportHei);
294*35238bceSAndroid Build Coastguard Worker         bool colorChoicesOk = true;
295*35238bceSAndroid Build Coastguard Worker 
296*35238bceSAndroid Build Coastguard Worker         for (int y = 0; y < renderedImg.getHeight(); y++)
297*35238bceSAndroid Build Coastguard Worker         {
298*35238bceSAndroid Build Coastguard Worker             for (int x = 0; x < renderedImg.getWidth(); x++)
299*35238bceSAndroid Build Coastguard Worker             {
300*35238bceSAndroid Build Coastguard Worker                 const float inputF = ((float)(isVerticallyIncreasing ? y : x) + 0.5f) /
301*35238bceSAndroid Build Coastguard Worker                                      (float)(isVerticallyIncreasing ? renderedImg.getHeight() : renderedImg.getWidth());
302*35238bceSAndroid Build Coastguard Worker                 const Vec4 inputClr = (1.0f - inputF) * quadClr0 + inputF * quadClr1;
303*35238bceSAndroid Build Coastguard Worker                 const bool increaseTol =
304*35238bceSAndroid Build Coastguard Worker                     ((renderedImg.getWidth() < 300) || (renderedImg.getHeight() < 300)) ? true : false;
305*35238bceSAndroid Build Coastguard Worker 
306*35238bceSAndroid Build Coastguard Worker                 if (!checkColor(inputClr, renderedImg.getPixel(x, y), colorChoicesOk, increaseTol))
307*35238bceSAndroid Build Coastguard Worker                 {
308*35238bceSAndroid Build Coastguard Worker                     errorMask.setPixel(x, y, tcu::RGBA::red());
309*35238bceSAndroid Build Coastguard Worker 
310*35238bceSAndroid Build Coastguard Worker                     if (colorChoicesOk)
311*35238bceSAndroid Build Coastguard Worker                     {
312*35238bceSAndroid Build Coastguard Worker                         log << TestLog::Message << "First failure at pixel (" << x << ", " << y
313*35238bceSAndroid Build Coastguard Worker                             << ") (not printing further errors)" << TestLog::EndMessage;
314*35238bceSAndroid Build Coastguard Worker                         colorChoicesOk = false;
315*35238bceSAndroid Build Coastguard Worker                     }
316*35238bceSAndroid Build Coastguard Worker                 }
317*35238bceSAndroid Build Coastguard Worker                 else
318*35238bceSAndroid Build Coastguard Worker                     errorMask.setPixel(x, y, tcu::RGBA::green());
319*35238bceSAndroid Build Coastguard Worker             }
320*35238bceSAndroid Build Coastguard Worker         }
321*35238bceSAndroid Build Coastguard Worker 
322*35238bceSAndroid Build Coastguard Worker         if (!colorChoicesOk)
323*35238bceSAndroid Build Coastguard Worker         {
324*35238bceSAndroid Build Coastguard Worker             log << TestLog::Image("ColorChoiceErrorMask", "Error mask for color choices", errorMask);
325*35238bceSAndroid Build Coastguard Worker             return false;
326*35238bceSAndroid Build Coastguard Worker         }
327*35238bceSAndroid Build Coastguard Worker     }
328*35238bceSAndroid Build Coastguard Worker 
329*35238bceSAndroid Build Coastguard Worker     // When dithering is disabled, the color selection must be coordinate-independent - i.e. the colors must be constant in the gradient's constant direction.
330*35238bceSAndroid Build Coastguard Worker 
331*35238bceSAndroid Build Coastguard Worker     if (!m_ditheringEnabled)
332*35238bceSAndroid Build Coastguard Worker     {
333*35238bceSAndroid Build Coastguard Worker         const int increasingDirectionSize = isVerticallyIncreasing ? renderedImg.getHeight() : renderedImg.getWidth();
334*35238bceSAndroid Build Coastguard Worker         const int constantDirectionSize   = isVerticallyIncreasing ? renderedImg.getWidth() : renderedImg.getHeight();
335*35238bceSAndroid Build Coastguard Worker 
336*35238bceSAndroid Build Coastguard Worker         for (int incrPos = 0; incrPos < increasingDirectionSize; incrPos++)
337*35238bceSAndroid Build Coastguard Worker         {
338*35238bceSAndroid Build Coastguard Worker             bool colorHasChanged = false;
339*35238bceSAndroid Build Coastguard Worker             tcu::RGBA prevConstantDirectionPix;
340*35238bceSAndroid Build Coastguard Worker 
341*35238bceSAndroid Build Coastguard Worker             for (int constPos = 0; constPos < constantDirectionSize; constPos++)
342*35238bceSAndroid Build Coastguard Worker             {
343*35238bceSAndroid Build Coastguard Worker                 const int x         = isVerticallyIncreasing ? constPos : incrPos;
344*35238bceSAndroid Build Coastguard Worker                 const int y         = isVerticallyIncreasing ? incrPos : constPos;
345*35238bceSAndroid Build Coastguard Worker                 const tcu::RGBA clr = renderedImg.getPixel(x, y);
346*35238bceSAndroid Build Coastguard Worker 
347*35238bceSAndroid Build Coastguard Worker                 if (constPos > 0 && clr != prevConstantDirectionPix)
348*35238bceSAndroid Build Coastguard Worker                 {
349*35238bceSAndroid Build Coastguard Worker                     if (colorHasChanged)
350*35238bceSAndroid Build Coastguard Worker                     {
351*35238bceSAndroid Build Coastguard Worker                         log << TestLog::Message << "Failure: colors should be constant per "
352*35238bceSAndroid Build Coastguard Worker                             << (isVerticallyIncreasing ? "row" : "column")
353*35238bceSAndroid Build Coastguard Worker                             << " (since dithering is disabled), but the color at position (" << x << ", " << y
354*35238bceSAndroid Build Coastguard Worker                             << ") is " << clr << " and does not equal the color at ("
355*35238bceSAndroid Build Coastguard Worker                             << (isVerticallyIncreasing ? x - 1 : x) << ", " << (isVerticallyIncreasing ? y : y - 1)
356*35238bceSAndroid Build Coastguard Worker                             << "), which is " << prevConstantDirectionPix << TestLog::EndMessage;
357*35238bceSAndroid Build Coastguard Worker 
358*35238bceSAndroid Build Coastguard Worker                         return false;
359*35238bceSAndroid Build Coastguard Worker                     }
360*35238bceSAndroid Build Coastguard Worker                     else
361*35238bceSAndroid Build Coastguard Worker                         colorHasChanged = true;
362*35238bceSAndroid Build Coastguard Worker                 }
363*35238bceSAndroid Build Coastguard Worker 
364*35238bceSAndroid Build Coastguard Worker                 prevConstantDirectionPix = clr;
365*35238bceSAndroid Build Coastguard Worker             }
366*35238bceSAndroid Build Coastguard Worker         }
367*35238bceSAndroid Build Coastguard Worker     }
368*35238bceSAndroid Build Coastguard Worker 
369*35238bceSAndroid Build Coastguard Worker     return true;
370*35238bceSAndroid Build Coastguard Worker }
371*35238bceSAndroid Build Coastguard Worker 
drawAndCheckUnicoloredQuad(const Vec4 & quadColor) const372*35238bceSAndroid Build Coastguard Worker bool DitheringCase::drawAndCheckUnicoloredQuad(const Vec4 &quadColor) const
373*35238bceSAndroid Build Coastguard Worker {
374*35238bceSAndroid Build Coastguard Worker     TestLog &log = m_testCtx.getLog();
375*35238bceSAndroid Build Coastguard Worker     Random rnd(deStringHash(getName()));
376*35238bceSAndroid Build Coastguard Worker     const int maxViewportWid = 32;
377*35238bceSAndroid Build Coastguard Worker     const int maxViewportHei = 32;
378*35238bceSAndroid Build Coastguard Worker     const int viewportWid    = de::min(m_renderCtx.getRenderTarget().getWidth(), maxViewportWid);
379*35238bceSAndroid Build Coastguard Worker     const int viewportHei    = de::min(m_renderCtx.getRenderTarget().getHeight(), maxViewportHei);
380*35238bceSAndroid Build Coastguard Worker     const int viewportX      = rnd.getInt(0, m_renderCtx.getRenderTarget().getWidth() - viewportWid);
381*35238bceSAndroid Build Coastguard Worker     const int viewportY      = rnd.getInt(0, m_renderCtx.getRenderTarget().getHeight() - viewportHei);
382*35238bceSAndroid Build Coastguard Worker     Quad quad;
383*35238bceSAndroid Build Coastguard Worker     Surface renderedImg(viewportWid, viewportHei);
384*35238bceSAndroid Build Coastguard Worker 
385*35238bceSAndroid Build Coastguard Worker     GLU_CHECK_CALL(glViewport(viewportX, viewportY, viewportWid, viewportHei));
386*35238bceSAndroid Build Coastguard Worker 
387*35238bceSAndroid Build Coastguard Worker     log << TestLog::Message << "Dithering is " << (m_ditheringEnabled ? "enabled" : "disabled") << TestLog::EndMessage;
388*35238bceSAndroid Build Coastguard Worker 
389*35238bceSAndroid Build Coastguard Worker     if (m_ditheringEnabled)
390*35238bceSAndroid Build Coastguard Worker         GLU_CHECK_CALL(glEnable(GL_DITHER));
391*35238bceSAndroid Build Coastguard Worker     else
392*35238bceSAndroid Build Coastguard Worker         GLU_CHECK_CALL(glDisable(GL_DITHER));
393*35238bceSAndroid Build Coastguard Worker 
394*35238bceSAndroid Build Coastguard Worker     log << TestLog::Message << "Drawing an unicolored quad with color " << quadColor << TestLog::EndMessage;
395*35238bceSAndroid Build Coastguard Worker 
396*35238bceSAndroid Build Coastguard Worker     quad.color[0] = quadColor;
397*35238bceSAndroid Build Coastguard Worker     quad.color[1] = quadColor;
398*35238bceSAndroid Build Coastguard Worker     quad.color[2] = quadColor;
399*35238bceSAndroid Build Coastguard Worker     quad.color[3] = quadColor;
400*35238bceSAndroid Build Coastguard Worker 
401*35238bceSAndroid Build Coastguard Worker     m_renderer->render(quad);
402*35238bceSAndroid Build Coastguard Worker 
403*35238bceSAndroid Build Coastguard Worker     glu::readPixels(m_renderCtx, viewportX, viewportY, renderedImg.getAccess());
404*35238bceSAndroid Build Coastguard Worker     GLU_CHECK_MSG("glReadPixels()");
405*35238bceSAndroid Build Coastguard Worker 
406*35238bceSAndroid Build Coastguard Worker     log << TestLog::Image(("Quad" + de::toString(m_iteration)).c_str(), ("Quad " + de::toString(m_iteration)).c_str(),
407*35238bceSAndroid Build Coastguard Worker                           renderedImg);
408*35238bceSAndroid Build Coastguard Worker 
409*35238bceSAndroid Build Coastguard Worker     // Validate, at each pixel, that each color channel is one of its two allowed values.
410*35238bceSAndroid Build Coastguard Worker 
411*35238bceSAndroid Build Coastguard Worker     {
412*35238bceSAndroid Build Coastguard Worker         Surface errorMask(viewportWid, viewportHei);
413*35238bceSAndroid Build Coastguard Worker         bool colorChoicesOk = true;
414*35238bceSAndroid Build Coastguard Worker 
415*35238bceSAndroid Build Coastguard Worker         for (int y = 0; y < renderedImg.getHeight(); y++)
416*35238bceSAndroid Build Coastguard Worker         {
417*35238bceSAndroid Build Coastguard Worker             for (int x = 0; x < renderedImg.getWidth(); x++)
418*35238bceSAndroid Build Coastguard Worker             {
419*35238bceSAndroid Build Coastguard Worker                 if (!checkColor(quadColor, renderedImg.getPixel(x, y), colorChoicesOk, false))
420*35238bceSAndroid Build Coastguard Worker                 {
421*35238bceSAndroid Build Coastguard Worker                     errorMask.setPixel(x, y, tcu::RGBA::red());
422*35238bceSAndroid Build Coastguard Worker 
423*35238bceSAndroid Build Coastguard Worker                     if (colorChoicesOk)
424*35238bceSAndroid Build Coastguard Worker                     {
425*35238bceSAndroid Build Coastguard Worker                         log << TestLog::Message << "First failure at pixel (" << x << ", " << y
426*35238bceSAndroid Build Coastguard Worker                             << ") (not printing further errors)" << TestLog::EndMessage;
427*35238bceSAndroid Build Coastguard Worker                         colorChoicesOk = false;
428*35238bceSAndroid Build Coastguard Worker                     }
429*35238bceSAndroid Build Coastguard Worker                 }
430*35238bceSAndroid Build Coastguard Worker                 else
431*35238bceSAndroid Build Coastguard Worker                     errorMask.setPixel(x, y, tcu::RGBA::green());
432*35238bceSAndroid Build Coastguard Worker             }
433*35238bceSAndroid Build Coastguard Worker         }
434*35238bceSAndroid Build Coastguard Worker 
435*35238bceSAndroid Build Coastguard Worker         if (!colorChoicesOk)
436*35238bceSAndroid Build Coastguard Worker         {
437*35238bceSAndroid Build Coastguard Worker             log << TestLog::Image("ColorChoiceErrorMask", "Error mask for color choices", errorMask);
438*35238bceSAndroid Build Coastguard Worker             return false;
439*35238bceSAndroid Build Coastguard Worker         }
440*35238bceSAndroid Build Coastguard Worker     }
441*35238bceSAndroid Build Coastguard Worker 
442*35238bceSAndroid Build Coastguard Worker     // When dithering is disabled, the color selection must be coordinate-independent - i.e. the entire rendered image must be unicolored.
443*35238bceSAndroid Build Coastguard Worker 
444*35238bceSAndroid Build Coastguard Worker     if (!m_ditheringEnabled)
445*35238bceSAndroid Build Coastguard Worker     {
446*35238bceSAndroid Build Coastguard Worker         const tcu::RGBA renderedClr00 = renderedImg.getPixel(0, 0);
447*35238bceSAndroid Build Coastguard Worker 
448*35238bceSAndroid Build Coastguard Worker         for (int y = 0; y < renderedImg.getHeight(); y++)
449*35238bceSAndroid Build Coastguard Worker         {
450*35238bceSAndroid Build Coastguard Worker             for (int x = 0; x < renderedImg.getWidth(); x++)
451*35238bceSAndroid Build Coastguard Worker             {
452*35238bceSAndroid Build Coastguard Worker                 const tcu::RGBA curClr = renderedImg.getPixel(x, y);
453*35238bceSAndroid Build Coastguard Worker 
454*35238bceSAndroid Build Coastguard Worker                 if (curClr != renderedClr00)
455*35238bceSAndroid Build Coastguard Worker                 {
456*35238bceSAndroid Build Coastguard Worker                     log << TestLog::Message << "Failure: color at (" << x << ", " << y << ") is " << curClr
457*35238bceSAndroid Build Coastguard Worker                         << " and does not equal the color at (0, 0), which is " << renderedClr00 << TestLog::EndMessage;
458*35238bceSAndroid Build Coastguard Worker 
459*35238bceSAndroid Build Coastguard Worker                     return false;
460*35238bceSAndroid Build Coastguard Worker                 }
461*35238bceSAndroid Build Coastguard Worker             }
462*35238bceSAndroid Build Coastguard Worker         }
463*35238bceSAndroid Build Coastguard Worker     }
464*35238bceSAndroid Build Coastguard Worker 
465*35238bceSAndroid Build Coastguard Worker     return true;
466*35238bceSAndroid Build Coastguard Worker }
467*35238bceSAndroid Build Coastguard Worker 
iterate(void)468*35238bceSAndroid Build Coastguard Worker DitheringCase::IterateResult DitheringCase::iterate(void)
469*35238bceSAndroid Build Coastguard Worker {
470*35238bceSAndroid Build Coastguard Worker     if (m_patternType == PATTERNTYPE_GRADIENT)
471*35238bceSAndroid Build Coastguard Worker     {
472*35238bceSAndroid Build Coastguard Worker         // Draw horizontal and vertical gradients.
473*35238bceSAndroid Build Coastguard Worker 
474*35238bceSAndroid Build Coastguard Worker         DE_ASSERT(m_iteration < 2);
475*35238bceSAndroid Build Coastguard Worker 
476*35238bceSAndroid Build Coastguard Worker         const bool success = drawAndCheckGradient(m_iteration == 1, m_color);
477*35238bceSAndroid Build Coastguard Worker 
478*35238bceSAndroid Build Coastguard Worker         if (!success)
479*35238bceSAndroid Build Coastguard Worker         {
480*35238bceSAndroid Build Coastguard Worker             m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail");
481*35238bceSAndroid Build Coastguard Worker             return STOP;
482*35238bceSAndroid Build Coastguard Worker         }
483*35238bceSAndroid Build Coastguard Worker 
484*35238bceSAndroid Build Coastguard Worker         if (m_iteration == 1)
485*35238bceSAndroid Build Coastguard Worker         {
486*35238bceSAndroid Build Coastguard Worker             m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
487*35238bceSAndroid Build Coastguard Worker             return STOP;
488*35238bceSAndroid Build Coastguard Worker         }
489*35238bceSAndroid Build Coastguard Worker     }
490*35238bceSAndroid Build Coastguard Worker     else if (m_patternType == PATTERNTYPE_UNICOLORED_QUAD)
491*35238bceSAndroid Build Coastguard Worker     {
492*35238bceSAndroid Build Coastguard Worker         const int numQuads = m_testCtx.getCommandLine().getTestIterationCount() > 0 ?
493*35238bceSAndroid Build Coastguard Worker                                  m_testCtx.getCommandLine().getTestIterationCount() :
494*35238bceSAndroid Build Coastguard Worker                                  30;
495*35238bceSAndroid Build Coastguard Worker 
496*35238bceSAndroid Build Coastguard Worker         DE_ASSERT(m_iteration < numQuads);
497*35238bceSAndroid Build Coastguard Worker 
498*35238bceSAndroid Build Coastguard Worker         const Vec4 quadColor = (float)m_iteration / (float)(numQuads - 1) * m_color;
499*35238bceSAndroid Build Coastguard Worker         const bool success   = drawAndCheckUnicoloredQuad(quadColor);
500*35238bceSAndroid Build Coastguard Worker 
501*35238bceSAndroid Build Coastguard Worker         if (!success)
502*35238bceSAndroid Build Coastguard Worker         {
503*35238bceSAndroid Build Coastguard Worker             m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Fail");
504*35238bceSAndroid Build Coastguard Worker             return STOP;
505*35238bceSAndroid Build Coastguard Worker         }
506*35238bceSAndroid Build Coastguard Worker 
507*35238bceSAndroid Build Coastguard Worker         if (m_iteration == numQuads - 1)
508*35238bceSAndroid Build Coastguard Worker         {
509*35238bceSAndroid Build Coastguard Worker             m_testCtx.setTestResult(QP_TEST_RESULT_PASS, "Pass");
510*35238bceSAndroid Build Coastguard Worker             return STOP;
511*35238bceSAndroid Build Coastguard Worker         }
512*35238bceSAndroid Build Coastguard Worker     }
513*35238bceSAndroid Build Coastguard Worker     else
514*35238bceSAndroid Build Coastguard Worker         DE_ASSERT(false);
515*35238bceSAndroid Build Coastguard Worker 
516*35238bceSAndroid Build Coastguard Worker     m_iteration++;
517*35238bceSAndroid Build Coastguard Worker 
518*35238bceSAndroid Build Coastguard Worker     return CONTINUE;
519*35238bceSAndroid Build Coastguard Worker }
520*35238bceSAndroid Build Coastguard Worker 
DitheringTests(Context & context)521*35238bceSAndroid Build Coastguard Worker DitheringTests::DitheringTests(Context &context) : TestCaseGroup(context, "dither", "Dithering tests")
522*35238bceSAndroid Build Coastguard Worker {
523*35238bceSAndroid Build Coastguard Worker }
524*35238bceSAndroid Build Coastguard Worker 
~DitheringTests(void)525*35238bceSAndroid Build Coastguard Worker DitheringTests::~DitheringTests(void)
526*35238bceSAndroid Build Coastguard Worker {
527*35238bceSAndroid Build Coastguard Worker }
528*35238bceSAndroid Build Coastguard Worker 
init(void)529*35238bceSAndroid Build Coastguard Worker void DitheringTests::init(void)
530*35238bceSAndroid Build Coastguard Worker {
531*35238bceSAndroid Build Coastguard Worker     static const struct
532*35238bceSAndroid Build Coastguard Worker     {
533*35238bceSAndroid Build Coastguard Worker         const char *name;
534*35238bceSAndroid Build Coastguard Worker         Vec4 color;
535*35238bceSAndroid Build Coastguard Worker     } caseColors[] = {{"white", Vec4(1.0f, 1.0f, 1.0f, 1.0f)},
536*35238bceSAndroid Build Coastguard Worker                       {"red", Vec4(1.0f, 0.0f, 0.0f, 1.0f)},
537*35238bceSAndroid Build Coastguard Worker                       {"green", Vec4(0.0f, 1.0f, 0.0f, 1.0f)},
538*35238bceSAndroid Build Coastguard Worker                       {"blue", Vec4(0.0f, 0.0f, 1.0f, 1.0f)},
539*35238bceSAndroid Build Coastguard Worker                       {"alpha", Vec4(0.0f, 0.0f, 0.0f, 1.0f)}};
540*35238bceSAndroid Build Coastguard Worker 
541*35238bceSAndroid Build Coastguard Worker     for (int ditheringEnabledI = 0; ditheringEnabledI <= 1; ditheringEnabledI++)
542*35238bceSAndroid Build Coastguard Worker     {
543*35238bceSAndroid Build Coastguard Worker         const bool ditheringEnabled = ditheringEnabledI != 0;
544*35238bceSAndroid Build Coastguard Worker         TestCaseGroup *const group  = new TestCaseGroup(m_context, ditheringEnabled ? "enabled" : "disabled", "");
545*35238bceSAndroid Build Coastguard Worker         addChild(group);
546*35238bceSAndroid Build Coastguard Worker 
547*35238bceSAndroid Build Coastguard Worker         for (int patternTypeI = 0; patternTypeI < DitheringCase::PATTERNTYPE_LAST; patternTypeI++)
548*35238bceSAndroid Build Coastguard Worker         {
549*35238bceSAndroid Build Coastguard Worker             for (int caseColorNdx = 0; caseColorNdx < DE_LENGTH_OF_ARRAY(caseColors); caseColorNdx++)
550*35238bceSAndroid Build Coastguard Worker             {
551*35238bceSAndroid Build Coastguard Worker                 const DitheringCase::PatternType patternType = (DitheringCase::PatternType)patternTypeI;
552*35238bceSAndroid Build Coastguard Worker                 const string caseName =
553*35238bceSAndroid Build Coastguard Worker                     string("") + DitheringCase::getPatternTypeName(patternType) + "_" + caseColors[caseColorNdx].name;
554*35238bceSAndroid Build Coastguard Worker 
555*35238bceSAndroid Build Coastguard Worker                 group->addChild(new DitheringCase(m_context.getTestContext(), m_context.getRenderContext(),
556*35238bceSAndroid Build Coastguard Worker                                                   caseName.c_str(), "", ditheringEnabled, patternType,
557*35238bceSAndroid Build Coastguard Worker                                                   caseColors[caseColorNdx].color));
558*35238bceSAndroid Build Coastguard Worker             }
559*35238bceSAndroid Build Coastguard Worker         }
560*35238bceSAndroid Build Coastguard Worker     }
561*35238bceSAndroid Build Coastguard Worker }
562*35238bceSAndroid Build Coastguard Worker 
563*35238bceSAndroid Build Coastguard Worker } // namespace Functional
564*35238bceSAndroid Build Coastguard Worker } // namespace gles3
565*35238bceSAndroid Build Coastguard Worker } // namespace deqp
566