OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 /* | 8 /* |
9 * Code for the "gm" (Golden Master) rendering comparison tool. | 9 * Code for the "gm" (Golden Master) rendering comparison tool. |
10 * | 10 * |
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
919 nameWithExtension.append(kPNG_FileExtension); | 919 nameWithExtension.append(kPNG_FileExtension); |
920 | 920 |
921 ErrorCombination errors; | 921 ErrorCombination errors; |
922 | 922 |
923 if (NULL == actualBitmapAndDigest) { | 923 if (NULL == actualBitmapAndDigest) { |
924 // Note that we intentionally skipped validating the results for | 924 // Note that we intentionally skipped validating the results for |
925 // this test, because we don't know how to generate an SkBitmap | 925 // this test, because we don't know how to generate an SkBitmap |
926 // version of the output. | 926 // version of the output. |
927 RecordTestResults(ErrorCombination(kIntentionallySkipped_ErrorType), | 927 RecordTestResults(ErrorCombination(kIntentionallySkipped_ErrorType), |
928 shortNamePlusConfig, ""); | 928 shortNamePlusConfig, ""); |
929 } else if (!(gRec.fFlags & kWrite_ConfigFlag)) { | |
epoger
2013/07/12 15:44:08
Tested as follows:
$ out/Debug/gm --config gpudeb
| |
930 // We don't record the results for this test or compare them | |
931 // against any expectations, because the output image isn't | |
932 // meaningful. | |
933 // See https://code.google.com/p/skia/issues/detail?id=1410 ('some | |
934 // GM result images not available for download from Google Storage') | |
935 RecordTestResults(ErrorCombination(kIntentionallySkipped_ErrorType), | |
936 shortNamePlusConfig, ""); | |
929 } else { | 937 } else { |
930 ExpectationsSource *expectationsSource = this->fExpectationsSource.g et(); | 938 ExpectationsSource *expectationsSource = this->fExpectationsSource.g et(); |
931 if (expectationsSource && (gRec.fFlags & kRead_ConfigFlag)) { | 939 if (expectationsSource && (gRec.fFlags & kRead_ConfigFlag)) { |
932 /* | 940 /* |
933 * Get the expected results for this test, as one or more allowe d | 941 * Get the expected results for this test, as one or more allowe d |
934 * hash digests. The current implementation of expectationsSourc e | 942 * hash digests. The current implementation of expectationsSourc e |
935 * get this by computing the hash digest of a single PNG file on disk. | 943 * get this by computing the hash digest of a single PNG file on disk. |
936 * | 944 * |
937 * TODO(epoger): This relies on the fact that | 945 * TODO(epoger): This relies on the fact that |
938 * force_all_opaque() was called on the bitmap before it | 946 * force_all_opaque() was called on the bitmap before it |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1240 static const ConfigData gRec[] = { | 1248 static const ConfigData gRec[] = { |
1241 { SkBitmap::kARGB_8888_Config, kRaster_Backend, kDontCare_GLContextType, 0, kRW_ConfigFlag, "8888", true }, | 1249 { SkBitmap::kARGB_8888_Config, kRaster_Backend, kDontCare_GLContextType, 0, kRW_ConfigFlag, "8888", true }, |
1242 #if 0 // stop testing this (for now at least) since we want to remove support for it (soon please!!!) | 1250 #if 0 // stop testing this (for now at least) since we want to remove support for it (soon please!!!) |
1243 { SkBitmap::kARGB_4444_Config, kRaster_Backend, kDontCare_GLContextType, 0, kRW_ConfigFlag, "4444", true }, | 1251 { SkBitmap::kARGB_4444_Config, kRaster_Backend, kDontCare_GLContextType, 0, kRW_ConfigFlag, "4444", true }, |
1244 #endif | 1252 #endif |
1245 { SkBitmap::kRGB_565_Config, kRaster_Backend, kDontCare_GLContextType, 0, kRW_ConfigFlag, "565", true }, | 1253 { SkBitmap::kRGB_565_Config, kRaster_Backend, kDontCare_GLContextType, 0, kRW_ConfigFlag, "565", true }, |
1246 #if SK_SUPPORT_GPU | 1254 #if SK_SUPPORT_GPU |
1247 { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kNative_GL ContextType, 0, kRW_ConfigFlag, "gpu", true }, | 1255 { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kNative_GL ContextType, 0, kRW_ConfigFlag, "gpu", true }, |
1248 { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kNative_GL ContextType, 16, kRW_ConfigFlag, "msaa16", false}, | 1256 { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kNative_GL ContextType, 16, kRW_ConfigFlag, "msaa16", false}, |
1249 { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kNative_GL ContextType, 4, kRW_ConfigFlag, "msaa4", false}, | 1257 { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kNative_GL ContextType, 4, kRW_ConfigFlag, "msaa4", false}, |
1250 /* The debug context does not generate images */ | 1258 /* The gpudebug context does not generate meaningful images, so don't record |
1259 * the images it generates! We only run it to look for asserts. */ | |
1251 { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kDebug_GLC ontextType, 0, kNone_ConfigFlag, "gpudebug", GR_DEBUG}, | 1260 { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kDebug_GLC ontextType, 0, kNone_ConfigFlag, "gpudebug", GR_DEBUG}, |
1252 #if SK_ANGLE | 1261 #if SK_ANGLE |
1253 { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kANGLE_GLC ontextType, 0, kRW_ConfigFlag, "angle", true }, | 1262 { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kANGLE_GLC ontextType, 0, kRW_ConfigFlag, "angle", true }, |
1254 { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kANGLE_GLC ontextType, 16, kRW_ConfigFlag, "anglemsaa16", true }, | 1263 { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kANGLE_GLC ontextType, 16, kRW_ConfigFlag, "anglemsaa16", true }, |
1255 #endif // SK_ANGLE | 1264 #endif // SK_ANGLE |
1256 #ifdef SK_MESA | 1265 #ifdef SK_MESA |
1257 { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kMESA_GLCo ntextType, 0, kRW_ConfigFlag, "mesa", true }, | 1266 { SkBitmap::kARGB_8888_Config, kGPU_Backend, GrContextFactory::kMESA_GLCo ntextType, 0, kRW_ConfigFlag, "mesa", true }, |
1258 #endif // SK_MESA | 1267 #endif // SK_MESA |
1259 #endif // SK_SUPPORT_GPU | 1268 #endif // SK_SUPPORT_GPU |
1260 #ifdef SK_SUPPORT_XPS | 1269 #ifdef SK_SUPPORT_XPS |
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2165 if (FLAGS_forceBWtext) { | 2174 if (FLAGS_forceBWtext) { |
2166 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); | 2175 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); |
2167 } | 2176 } |
2168 } | 2177 } |
2169 | 2178 |
2170 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 2179 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
2171 int main(int argc, char * const argv[]) { | 2180 int main(int argc, char * const argv[]) { |
2172 return tool_main(argc, (char**) argv); | 2181 return tool_main(argc, (char**) argv); |
2173 } | 2182 } |
2174 #endif | 2183 #endif |
OLD | NEW |