1*35238bceSAndroid Build Coastguard Worker /*-------------------------------------------------------------------------
2*35238bceSAndroid Build Coastguard Worker * drawElements Internal Test 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 Image comparison tests.
22*35238bceSAndroid Build Coastguard Worker *//*--------------------------------------------------------------------*/
23*35238bceSAndroid Build Coastguard Worker
24*35238bceSAndroid Build Coastguard Worker #include "ditImageCompareTests.hpp"
25*35238bceSAndroid Build Coastguard Worker #include "tcuResource.hpp"
26*35238bceSAndroid Build Coastguard Worker #include "tcuImageCompare.hpp"
27*35238bceSAndroid Build Coastguard Worker #include "tcuFuzzyImageCompare.hpp"
28*35238bceSAndroid Build Coastguard Worker #include "tcuImageIO.hpp"
29*35238bceSAndroid Build Coastguard Worker #include "tcuTexture.hpp"
30*35238bceSAndroid Build Coastguard Worker #include "tcuTestLog.hpp"
31*35238bceSAndroid Build Coastguard Worker #include "tcuTextureUtil.hpp"
32*35238bceSAndroid Build Coastguard Worker #include "tcuRGBA.hpp"
33*35238bceSAndroid Build Coastguard Worker #include "deFilePath.hpp"
34*35238bceSAndroid Build Coastguard Worker #include "deClock.h"
35*35238bceSAndroid Build Coastguard Worker
36*35238bceSAndroid Build Coastguard Worker namespace dit
37*35238bceSAndroid Build Coastguard Worker {
38*35238bceSAndroid Build Coastguard Worker
39*35238bceSAndroid Build Coastguard Worker using tcu::TestLog;
40*35238bceSAndroid Build Coastguard Worker
41*35238bceSAndroid Build Coastguard Worker static const char *BASE_DIR = "internal/data/imagecompare";
42*35238bceSAndroid Build Coastguard Worker
loadImageRGBA8(tcu::TextureLevel & dst,const tcu::Archive & archive,const char * path)43*35238bceSAndroid Build Coastguard Worker static void loadImageRGBA8(tcu::TextureLevel &dst, const tcu::Archive &archive, const char *path)
44*35238bceSAndroid Build Coastguard Worker {
45*35238bceSAndroid Build Coastguard Worker tcu::TextureLevel tmp;
46*35238bceSAndroid Build Coastguard Worker tcu::ImageIO::loadImage(tmp, archive, path);
47*35238bceSAndroid Build Coastguard Worker
48*35238bceSAndroid Build Coastguard Worker dst.setStorage(tcu::TextureFormat(tcu::TextureFormat::RGBA, tcu::TextureFormat::UNORM_INT8), tmp.getWidth(),
49*35238bceSAndroid Build Coastguard Worker tmp.getHeight());
50*35238bceSAndroid Build Coastguard Worker tcu::copy(dst, tmp);
51*35238bceSAndroid Build Coastguard Worker }
52*35238bceSAndroid Build Coastguard Worker
53*35238bceSAndroid Build Coastguard Worker class FuzzyComparisonMetricCase : public tcu::TestCase
54*35238bceSAndroid Build Coastguard Worker {
55*35238bceSAndroid Build Coastguard Worker public:
FuzzyComparisonMetricCase(tcu::TestContext & testCtx,const char * name,const char * refImg,const char * cmpImg,const float minBound,const float maxBound)56*35238bceSAndroid Build Coastguard Worker FuzzyComparisonMetricCase(tcu::TestContext &testCtx, const char *name, const char *refImg, const char *cmpImg,
57*35238bceSAndroid Build Coastguard Worker const float minBound, const float maxBound)
58*35238bceSAndroid Build Coastguard Worker : tcu::TestCase(testCtx, name, "")
59*35238bceSAndroid Build Coastguard Worker , m_refImg(refImg)
60*35238bceSAndroid Build Coastguard Worker , m_cmpImg(cmpImg)
61*35238bceSAndroid Build Coastguard Worker , m_minBound(minBound)
62*35238bceSAndroid Build Coastguard Worker , m_maxBound(maxBound)
63*35238bceSAndroid Build Coastguard Worker {
64*35238bceSAndroid Build Coastguard Worker }
65*35238bceSAndroid Build Coastguard Worker
iterate(void)66*35238bceSAndroid Build Coastguard Worker IterateResult iterate(void)
67*35238bceSAndroid Build Coastguard Worker {
68*35238bceSAndroid Build Coastguard Worker tcu::TextureLevel refImg;
69*35238bceSAndroid Build Coastguard Worker tcu::TextureLevel cmpImg;
70*35238bceSAndroid Build Coastguard Worker tcu::TextureLevel errorMask;
71*35238bceSAndroid Build Coastguard Worker tcu::FuzzyCompareParams params;
72*35238bceSAndroid Build Coastguard Worker float result = 0.0f;
73*35238bceSAndroid Build Coastguard Worker uint64_t compareTime = 0;
74*35238bceSAndroid Build Coastguard Worker
75*35238bceSAndroid Build Coastguard Worker params.maxSampleSkip = 0;
76*35238bceSAndroid Build Coastguard Worker
77*35238bceSAndroid Build Coastguard Worker tcu::ImageIO::loadImage(refImg, m_testCtx.getArchive(), de::FilePath::join(BASE_DIR, m_refImg).getPath());
78*35238bceSAndroid Build Coastguard Worker tcu::ImageIO::loadImage(cmpImg, m_testCtx.getArchive(), de::FilePath::join(BASE_DIR, m_cmpImg).getPath());
79*35238bceSAndroid Build Coastguard Worker
80*35238bceSAndroid Build Coastguard Worker errorMask.setStorage(refImg.getFormat(), refImg.getWidth(), refImg.getHeight(), refImg.getDepth());
81*35238bceSAndroid Build Coastguard Worker
82*35238bceSAndroid Build Coastguard Worker {
83*35238bceSAndroid Build Coastguard Worker const uint64_t startTime = deGetMicroseconds();
84*35238bceSAndroid Build Coastguard Worker result = tcu::fuzzyCompare(params, refImg, cmpImg, errorMask);
85*35238bceSAndroid Build Coastguard Worker compareTime = deGetMicroseconds() - startTime;
86*35238bceSAndroid Build Coastguard Worker }
87*35238bceSAndroid Build Coastguard Worker
88*35238bceSAndroid Build Coastguard Worker m_testCtx.getLog() << TestLog::Image("RefImage", "Reference Image", refImg)
89*35238bceSAndroid Build Coastguard Worker << TestLog::Image("CmpImage", "Compare Image", cmpImg)
90*35238bceSAndroid Build Coastguard Worker << TestLog::Image("ErrorMask", "Error Mask", errorMask);
91*35238bceSAndroid Build Coastguard Worker
92*35238bceSAndroid Build Coastguard Worker m_testCtx.getLog() << TestLog::Float("Result", "Result metric", "", QP_KEY_TAG_NONE, result)
93*35238bceSAndroid Build Coastguard Worker << TestLog::Float("MinBound", "Minimum bound", "", QP_KEY_TAG_NONE, m_minBound)
94*35238bceSAndroid Build Coastguard Worker << TestLog::Float("MaxBound", "Maximum bound", "", QP_KEY_TAG_NONE, m_maxBound)
95*35238bceSAndroid Build Coastguard Worker << TestLog::Integer("CompareTime", "Comparison time", "us", QP_KEY_TAG_TIME, compareTime);
96*35238bceSAndroid Build Coastguard Worker
97*35238bceSAndroid Build Coastguard Worker {
98*35238bceSAndroid Build Coastguard Worker const bool isOk = de::inRange(result, m_minBound, m_maxBound);
99*35238bceSAndroid Build Coastguard Worker m_testCtx.setTestResult(isOk ? QP_TEST_RESULT_PASS : QP_TEST_RESULT_FAIL,
100*35238bceSAndroid Build Coastguard Worker isOk ? "Pass" : "Metric out of bounds");
101*35238bceSAndroid Build Coastguard Worker }
102*35238bceSAndroid Build Coastguard Worker
103*35238bceSAndroid Build Coastguard Worker return STOP;
104*35238bceSAndroid Build Coastguard Worker }
105*35238bceSAndroid Build Coastguard Worker
106*35238bceSAndroid Build Coastguard Worker private:
107*35238bceSAndroid Build Coastguard Worker const std::string m_refImg;
108*35238bceSAndroid Build Coastguard Worker const std::string m_cmpImg;
109*35238bceSAndroid Build Coastguard Worker const float m_minBound;
110*35238bceSAndroid Build Coastguard Worker const float m_maxBound;
111*35238bceSAndroid Build Coastguard Worker };
112*35238bceSAndroid Build Coastguard Worker
113*35238bceSAndroid Build Coastguard Worker class BilinearCompareCase : public tcu::TestCase
114*35238bceSAndroid Build Coastguard Worker {
115*35238bceSAndroid Build Coastguard Worker public:
BilinearCompareCase(tcu::TestContext & testCtx,const char * name,const char * refImg,const char * cmpImg,const tcu::RGBA & threshold,bool expectedResult)116*35238bceSAndroid Build Coastguard Worker BilinearCompareCase(tcu::TestContext &testCtx, const char *name, const char *refImg, const char *cmpImg,
117*35238bceSAndroid Build Coastguard Worker const tcu::RGBA &threshold, bool expectedResult)
118*35238bceSAndroid Build Coastguard Worker : tcu::TestCase(testCtx, name, "")
119*35238bceSAndroid Build Coastguard Worker , m_refImg(refImg)
120*35238bceSAndroid Build Coastguard Worker , m_cmpImg(cmpImg)
121*35238bceSAndroid Build Coastguard Worker , m_threshold(threshold)
122*35238bceSAndroid Build Coastguard Worker , m_expectedResult(expectedResult)
123*35238bceSAndroid Build Coastguard Worker {
124*35238bceSAndroid Build Coastguard Worker }
125*35238bceSAndroid Build Coastguard Worker
iterate(void)126*35238bceSAndroid Build Coastguard Worker IterateResult iterate(void)
127*35238bceSAndroid Build Coastguard Worker {
128*35238bceSAndroid Build Coastguard Worker tcu::TextureLevel refImg;
129*35238bceSAndroid Build Coastguard Worker tcu::TextureLevel cmpImg;
130*35238bceSAndroid Build Coastguard Worker bool result;
131*35238bceSAndroid Build Coastguard Worker uint64_t compareTime = 0;
132*35238bceSAndroid Build Coastguard Worker
133*35238bceSAndroid Build Coastguard Worker loadImageRGBA8(refImg, m_testCtx.getArchive(), de::FilePath::join(BASE_DIR, m_refImg).getPath());
134*35238bceSAndroid Build Coastguard Worker loadImageRGBA8(cmpImg, m_testCtx.getArchive(), de::FilePath::join(BASE_DIR, m_cmpImg).getPath());
135*35238bceSAndroid Build Coastguard Worker
136*35238bceSAndroid Build Coastguard Worker {
137*35238bceSAndroid Build Coastguard Worker const uint64_t startTime = deGetMicroseconds();
138*35238bceSAndroid Build Coastguard Worker result = tcu::bilinearCompare(m_testCtx.getLog(), "CompareResult", "Image comparison result", refImg,
139*35238bceSAndroid Build Coastguard Worker cmpImg, m_threshold, tcu::COMPARE_LOG_EVERYTHING);
140*35238bceSAndroid Build Coastguard Worker compareTime = deGetMicroseconds() - startTime;
141*35238bceSAndroid Build Coastguard Worker }
142*35238bceSAndroid Build Coastguard Worker
143*35238bceSAndroid Build Coastguard Worker m_testCtx.getLog() << TestLog::Integer("CompareTime", "Comparison time", "us", QP_KEY_TAG_TIME, compareTime);
144*35238bceSAndroid Build Coastguard Worker
145*35238bceSAndroid Build Coastguard Worker {
146*35238bceSAndroid Build Coastguard Worker const bool isOk = result == m_expectedResult;
147*35238bceSAndroid Build Coastguard Worker m_testCtx.setTestResult(isOk ? QP_TEST_RESULT_PASS : QP_TEST_RESULT_FAIL,
148*35238bceSAndroid Build Coastguard Worker isOk ? "Pass" : "Wrong comparison result");
149*35238bceSAndroid Build Coastguard Worker }
150*35238bceSAndroid Build Coastguard Worker
151*35238bceSAndroid Build Coastguard Worker return STOP;
152*35238bceSAndroid Build Coastguard Worker }
153*35238bceSAndroid Build Coastguard Worker
154*35238bceSAndroid Build Coastguard Worker private:
155*35238bceSAndroid Build Coastguard Worker const std::string m_refImg;
156*35238bceSAndroid Build Coastguard Worker const std::string m_cmpImg;
157*35238bceSAndroid Build Coastguard Worker const tcu::RGBA m_threshold;
158*35238bceSAndroid Build Coastguard Worker const bool m_expectedResult;
159*35238bceSAndroid Build Coastguard Worker };
160*35238bceSAndroid Build Coastguard Worker
161*35238bceSAndroid Build Coastguard Worker class FuzzyComparisonMetricTests : public tcu::TestCaseGroup
162*35238bceSAndroid Build Coastguard Worker {
163*35238bceSAndroid Build Coastguard Worker public:
FuzzyComparisonMetricTests(tcu::TestContext & testCtx)164*35238bceSAndroid Build Coastguard Worker FuzzyComparisonMetricTests(tcu::TestContext &testCtx)
165*35238bceSAndroid Build Coastguard Worker : tcu::TestCaseGroup(testCtx, "fuzzy_metric", "Fuzzy comparison metrics")
166*35238bceSAndroid Build Coastguard Worker {
167*35238bceSAndroid Build Coastguard Worker }
168*35238bceSAndroid Build Coastguard Worker
init(void)169*35238bceSAndroid Build Coastguard Worker void init(void)
170*35238bceSAndroid Build Coastguard Worker {
171*35238bceSAndroid Build Coastguard Worker addChild(
172*35238bceSAndroid Build Coastguard Worker new FuzzyComparisonMetricCase(m_testCtx, "identical", "cube_ref.png", "cube_ref.png", 0.0f, 0.000001f));
173*35238bceSAndroid Build Coastguard Worker addChild(new FuzzyComparisonMetricCase(m_testCtx, "cube", "cube_ref.png", "cube_cmp.png", 0.0029f, 0.0031f));
174*35238bceSAndroid Build Coastguard Worker addChild(
175*35238bceSAndroid Build Coastguard Worker new FuzzyComparisonMetricCase(m_testCtx, "cube_2", "cube_2_ref.png", "cube_2_cmp.png", 0.0134f, 0.0140f));
176*35238bceSAndroid Build Coastguard Worker addChild(new FuzzyComparisonMetricCase(m_testCtx, "cube_sphere", "cube_sphere_ref.png", "cube_sphere_cmp.png",
177*35238bceSAndroid Build Coastguard Worker 0.0730f, 0.0801f));
178*35238bceSAndroid Build Coastguard Worker addChild(new FuzzyComparisonMetricCase(m_testCtx, "cube_nmap", "cube_nmap_ref.png", "cube_nmap_cmp.png",
179*35238bceSAndroid Build Coastguard Worker 0.0022f, 0.0025f));
180*35238bceSAndroid Build Coastguard Worker addChild(new FuzzyComparisonMetricCase(m_testCtx, "cube_nmap_2", "cube_nmap_2_ref.png", "cube_nmap_2_cmp.png",
181*35238bceSAndroid Build Coastguard Worker 0.0172f, 0.0189f));
182*35238bceSAndroid Build Coastguard Worker addChild(new FuzzyComparisonMetricCase(m_testCtx, "earth_diffuse", "earth_diffuse_ref.png",
183*35238bceSAndroid Build Coastguard Worker "earth_diffuse_cmp.png", 0.0f, 0.00002f));
184*35238bceSAndroid Build Coastguard Worker addChild(new FuzzyComparisonMetricCase(m_testCtx, "eath_texture", "earth_texture_ref.png",
185*35238bceSAndroid Build Coastguard Worker "earth_texture_cmp.png", 0.0002f, 0.0003f));
186*35238bceSAndroid Build Coastguard Worker addChild(new FuzzyComparisonMetricCase(m_testCtx, "earth_spot", "earth_spot_ref.png", "earth_spot_cmp.png",
187*35238bceSAndroid Build Coastguard Worker 0.0015f, 0.0018f));
188*35238bceSAndroid Build Coastguard Worker addChild(new FuzzyComparisonMetricCase(m_testCtx, "earth_light", "earth_light_ref.png", "earth_light_cmp.png",
189*35238bceSAndroid Build Coastguard Worker 1.7050f, 1.7070f));
190*35238bceSAndroid Build Coastguard Worker addChild(new FuzzyComparisonMetricCase(m_testCtx, "lessThan0", "lessThan0-reference.png",
191*35238bceSAndroid Build Coastguard Worker "lessThan0-result.png", 0.0003f, 0.0004f));
192*35238bceSAndroid Build Coastguard Worker addChild(new FuzzyComparisonMetricCase(m_testCtx, "cube_sphere_2", "cube_sphere_2_ref.png",
193*35238bceSAndroid Build Coastguard Worker "cube_sphere_2_cmp.png", 0.0207f, 0.0230f));
194*35238bceSAndroid Build Coastguard Worker addChild(new FuzzyComparisonMetricCase(m_testCtx, "earth_to_empty", "earth_spot_ref.png", "empty_256x256.png",
195*35238bceSAndroid Build Coastguard Worker 54951.0f, 54955.0f));
196*35238bceSAndroid Build Coastguard Worker }
197*35238bceSAndroid Build Coastguard Worker };
198*35238bceSAndroid Build Coastguard Worker
199*35238bceSAndroid Build Coastguard Worker class BilinearCompareTests : public tcu::TestCaseGroup
200*35238bceSAndroid Build Coastguard Worker {
201*35238bceSAndroid Build Coastguard Worker public:
BilinearCompareTests(tcu::TestContext & testCtx)202*35238bceSAndroid Build Coastguard Worker BilinearCompareTests(tcu::TestContext &testCtx)
203*35238bceSAndroid Build Coastguard Worker : tcu::TestCaseGroup(testCtx, "bilinear_compare", "Bilinear Image Comparison Tests")
204*35238bceSAndroid Build Coastguard Worker {
205*35238bceSAndroid Build Coastguard Worker }
206*35238bceSAndroid Build Coastguard Worker
init(void)207*35238bceSAndroid Build Coastguard Worker void init(void)
208*35238bceSAndroid Build Coastguard Worker {
209*35238bceSAndroid Build Coastguard Worker addChild(new BilinearCompareCase(m_testCtx, "identical", "cube_ref.png", "cube_ref.png", tcu::RGBA(0, 0, 0, 0),
210*35238bceSAndroid Build Coastguard Worker true));
211*35238bceSAndroid Build Coastguard Worker addChild(new BilinearCompareCase(m_testCtx, "empty_to_white", "empty_256x256.png", "white_256x256.png",
212*35238bceSAndroid Build Coastguard Worker tcu::RGBA(7, 7, 7, 2), false));
213*35238bceSAndroid Build Coastguard Worker addChild(new BilinearCompareCase(m_testCtx, "white_to_empty", "white_256x256.png", "empty_256x256.png",
214*35238bceSAndroid Build Coastguard Worker tcu::RGBA(7, 7, 7, 2), false));
215*35238bceSAndroid Build Coastguard Worker addChild(
216*35238bceSAndroid Build Coastguard Worker new BilinearCompareCase(m_testCtx, "cube", "cube_ref.png", "cube_cmp.png", tcu::RGBA(7, 7, 7, 2), false));
217*35238bceSAndroid Build Coastguard Worker addChild(new BilinearCompareCase(m_testCtx, "cube_2", "cube_2_ref.png", "cube_2_cmp.png", tcu::RGBA(7, 7, 7, 2),
218*35238bceSAndroid Build Coastguard Worker false));
219*35238bceSAndroid Build Coastguard Worker addChild(new BilinearCompareCase(m_testCtx, "cube_sphere", "cube_sphere_ref.png", "cube_sphere_cmp.png",
220*35238bceSAndroid Build Coastguard Worker tcu::RGBA(7, 7, 7, 2), false));
221*35238bceSAndroid Build Coastguard Worker addChild(new BilinearCompareCase(m_testCtx, "cube_nmap", "cube_nmap_ref.png", "cube_nmap_cmp.png",
222*35238bceSAndroid Build Coastguard Worker tcu::RGBA(7, 7, 7, 2), false));
223*35238bceSAndroid Build Coastguard Worker addChild(new BilinearCompareCase(m_testCtx, "cube_nmap_2", "cube_nmap_2_ref.png", "cube_nmap_2_cmp.png",
224*35238bceSAndroid Build Coastguard Worker tcu::RGBA(7, 7, 7, 2), false));
225*35238bceSAndroid Build Coastguard Worker addChild(new BilinearCompareCase(m_testCtx, "earth_diffuse", "earth_diffuse_ref.png", "earth_diffuse_cmp.png",
226*35238bceSAndroid Build Coastguard Worker tcu::RGBA(20, 20, 20, 2), true));
227*35238bceSAndroid Build Coastguard Worker addChild(new BilinearCompareCase(m_testCtx, "eath_texture", "earth_texture_ref.png", "earth_texture_cmp.png",
228*35238bceSAndroid Build Coastguard Worker tcu::RGBA(7, 7, 7, 2), false));
229*35238bceSAndroid Build Coastguard Worker addChild(new BilinearCompareCase(m_testCtx, "earth_spot", "earth_spot_ref.png", "earth_spot_cmp.png",
230*35238bceSAndroid Build Coastguard Worker tcu::RGBA(7, 7, 7, 2), false));
231*35238bceSAndroid Build Coastguard Worker addChild(new BilinearCompareCase(m_testCtx, "earth_light", "earth_light_ref.png", "earth_light_cmp.png",
232*35238bceSAndroid Build Coastguard Worker tcu::RGBA(7, 7, 7, 2), false));
233*35238bceSAndroid Build Coastguard Worker addChild(new BilinearCompareCase(m_testCtx, "lessThan0", "lessThan0-reference.png", "lessThan0-result.png",
234*35238bceSAndroid Build Coastguard Worker tcu::RGBA(36, 36, 36, 2), true));
235*35238bceSAndroid Build Coastguard Worker addChild(new BilinearCompareCase(m_testCtx, "cube_sphere_2", "cube_sphere_2_ref.png", "cube_sphere_2_cmp.png",
236*35238bceSAndroid Build Coastguard Worker tcu::RGBA(7, 7, 7, 2), false));
237*35238bceSAndroid Build Coastguard Worker addChild(new BilinearCompareCase(m_testCtx, "earth_to_empty", "earth_spot_ref.png", "empty_256x256.png",
238*35238bceSAndroid Build Coastguard Worker tcu::RGBA(7, 7, 7, 2), false));
239*35238bceSAndroid Build Coastguard Worker addChild(new BilinearCompareCase(m_testCtx, "texfilter", "texfilter_ref.png", "texfilter_cmp.png",
240*35238bceSAndroid Build Coastguard Worker tcu::RGBA(7, 7, 7, 2), true));
241*35238bceSAndroid Build Coastguard Worker addChild(new BilinearCompareCase(m_testCtx, "refract_vtx", "refract_vtx_ref.png", "refract_vtx_cmp.png",
242*35238bceSAndroid Build Coastguard Worker tcu::RGBA(7, 7, 7, 2), true));
243*35238bceSAndroid Build Coastguard Worker addChild(new BilinearCompareCase(m_testCtx, "refract_frag", "refract_frag_ref.png", "refract_frag_cmp.png",
244*35238bceSAndroid Build Coastguard Worker tcu::RGBA(7, 7, 7, 2), true));
245*35238bceSAndroid Build Coastguard Worker addChild(new BilinearCompareCase(m_testCtx, "lessthan_vtx", "lessthan_vtx_ref.png", "lessthan_vtx_cmp.png",
246*35238bceSAndroid Build Coastguard Worker tcu::RGBA(7, 7, 7, 2), true));
247*35238bceSAndroid Build Coastguard Worker addChild(new BilinearCompareCase(m_testCtx, "2_units_2d", "2_units_2d_ref.png", "2_units_2d_cmp.png",
248*35238bceSAndroid Build Coastguard Worker tcu::RGBA(7, 7, 7, 2), false));
249*35238bceSAndroid Build Coastguard Worker addChild(new BilinearCompareCase(m_testCtx, "4_units_cube_vtx", "4_units_cube_ref.png", "4_units_cube_cmp.png",
250*35238bceSAndroid Build Coastguard Worker tcu::RGBA(7, 7, 7, 2), false));
251*35238bceSAndroid Build Coastguard Worker addChild(new BilinearCompareCase(m_testCtx, "texfilter_vtx_nearest", "texfilter_vtx_nearest_ref.png",
252*35238bceSAndroid Build Coastguard Worker "texfilter_vtx_nearest_cmp.png", tcu::RGBA(7, 7, 7, 2), false));
253*35238bceSAndroid Build Coastguard Worker addChild(new BilinearCompareCase(m_testCtx, "texfilter_vtx_linear", "texfilter_vtx_linear_ref.png",
254*35238bceSAndroid Build Coastguard Worker "texfilter_vtx_linear_cmp.png", tcu::RGBA(7, 7, 7, 2), false));
255*35238bceSAndroid Build Coastguard Worker addChild(new BilinearCompareCase(m_testCtx, "readpixels_msaa", "readpixels_ref.png", "readpixels_msaa.png",
256*35238bceSAndroid Build Coastguard Worker tcu::RGBA(1, 1, 1, 1), true));
257*35238bceSAndroid Build Coastguard Worker }
258*35238bceSAndroid Build Coastguard Worker };
259*35238bceSAndroid Build Coastguard Worker
ImageCompareTests(tcu::TestContext & testCtx)260*35238bceSAndroid Build Coastguard Worker ImageCompareTests::ImageCompareTests(tcu::TestContext &testCtx)
261*35238bceSAndroid Build Coastguard Worker : tcu::TestCaseGroup(testCtx, "image_compare", "Image comparison tests")
262*35238bceSAndroid Build Coastguard Worker {
263*35238bceSAndroid Build Coastguard Worker }
264*35238bceSAndroid Build Coastguard Worker
~ImageCompareTests(void)265*35238bceSAndroid Build Coastguard Worker ImageCompareTests::~ImageCompareTests(void)
266*35238bceSAndroid Build Coastguard Worker {
267*35238bceSAndroid Build Coastguard Worker }
268*35238bceSAndroid Build Coastguard Worker
init(void)269*35238bceSAndroid Build Coastguard Worker void ImageCompareTests::init(void)
270*35238bceSAndroid Build Coastguard Worker {
271*35238bceSAndroid Build Coastguard Worker addChild(new FuzzyComparisonMetricTests(m_testCtx));
272*35238bceSAndroid Build Coastguard Worker addChild(new BilinearCompareTests(m_testCtx));
273*35238bceSAndroid Build Coastguard Worker }
274*35238bceSAndroid Build Coastguard Worker
275*35238bceSAndroid Build Coastguard Worker } // namespace dit
276