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 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1397 "into this directory."); | 1397 "into this directory."); |
1398 DEFINE_string(mismatchPath, "", "Write images for tests that failed due to " | 1398 DEFINE_string(mismatchPath, "", "Write images for tests that failed due to " |
1399 "pixel mismatches into this directory."); | 1399 "pixel mismatches into this directory."); |
1400 DEFINE_string(modulo, "", "[--modulo <remainder> <divisor>]: only run tests for
which " | 1400 DEFINE_string(modulo, "", "[--modulo <remainder> <divisor>]: only run tests for
which " |
1401 "testIndex %% divisor == remainder."); | 1401 "testIndex %% divisor == remainder."); |
1402 DEFINE_bool(pdf, true, "Exercise the pdf rendering test pass."); | 1402 DEFINE_bool(pdf, true, "Exercise the pdf rendering test pass."); |
1403 DEFINE_bool(pipe, false, "Exercise the SkGPipe replay test pass."); | 1403 DEFINE_bool(pipe, false, "Exercise the SkGPipe replay test pass."); |
1404 DEFINE_string2(readPath, r, "", "Read reference images from this dir, and report
" | 1404 DEFINE_string2(readPath, r, "", "Read reference images from this dir, and report
" |
1405 "any differences between those and the newly generated ones."); | 1405 "any differences between those and the newly generated ones."); |
1406 DEFINE_bool(replay, false, "Exercise the SkPicture replay test pass."); | 1406 DEFINE_bool(replay, false, "Exercise the SkPicture replay test pass."); |
| 1407 #if SK_SUPPORT_GPU |
| 1408 DEFINE_bool(resetGpuContext, false, "Reset the GrContext prior to running each G
M."); |
| 1409 #endif |
1407 DEFINE_string2(resourcePath, i, "", "Directory that stores image resources."); | 1410 DEFINE_string2(resourcePath, i, "", "Directory that stores image resources."); |
1408 DEFINE_bool(rtree, false, "Exercise the R-Tree variant of SkPicture test pass.")
; | 1411 DEFINE_bool(rtree, false, "Exercise the R-Tree variant of SkPicture test pass.")
; |
1409 DEFINE_bool(serialize, false, "Exercise the SkPicture serialization & deserializ
ation test pass."); | 1412 DEFINE_bool(serialize, false, "Exercise the SkPicture serialization & deserializ
ation test pass."); |
1410 DEFINE_bool(simulatePipePlaybackFailure, false, "Simulate a rendering failure in
pipe mode only."); | 1413 DEFINE_bool(simulatePipePlaybackFailure, false, "Simulate a rendering failure in
pipe mode only."); |
1411 DEFINE_bool(tiledPipe, false, "Exercise tiled SkGPipe replay."); | 1414 DEFINE_bool(tiledPipe, false, "Exercise tiled SkGPipe replay."); |
1412 DEFINE_bool(tileGrid, false, "Exercise the tile grid variant of SkPicture."); | 1415 DEFINE_bool(tileGrid, false, "Exercise the tile grid variant of SkPicture."); |
1413 DEFINE_string(tileGridReplayScales, "", "Space separated list of floating-point
scale " | 1416 DEFINE_string(tileGridReplayScales, "", "Space separated list of floating-point
scale " |
1414 "factors to be used for tileGrid playback testing. Default value:
1.0"); | 1417 "factors to be used for tileGrid playback testing. Default value:
1.0"); |
1415 DEFINE_bool2(verbose, v, false, "Give more detail (e.g. list all GMs run, more i
nfo about " | 1418 DEFINE_bool2(verbose, v, false, "Give more detail (e.g. list all GMs run, more i
nfo about " |
1416 "each test)."); | 1419 "each test)."); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1538 continue; | 1541 continue; |
1539 } | 1542 } |
1540 | 1543 |
1541 // Now we know that we want to run this test and record its | 1544 // Now we know that we want to run this test and record its |
1542 // success or failure. | 1545 // success or failure. |
1543 ErrorCombination errorsForThisConfig; | 1546 ErrorCombination errorsForThisConfig; |
1544 GrSurface* gpuTarget = NULL; | 1547 GrSurface* gpuTarget = NULL; |
1545 #if SK_SUPPORT_GPU | 1548 #if SK_SUPPORT_GPU |
1546 SkAutoTUnref<GrSurface> auGpuTarget; | 1549 SkAutoTUnref<GrSurface> auGpuTarget; |
1547 if ((errorsForThisConfig.isEmpty()) && (kGPU_Backend == config.fBackend)
) { | 1550 if ((errorsForThisConfig.isEmpty()) && (kGPU_Backend == config.fBackend)
) { |
| 1551 if (FLAGS_resetGpuContext) { |
| 1552 grFactory->destroyContexts(); |
| 1553 } |
1548 GrContext* gr = grFactory->get(config.fGLContextType); | 1554 GrContext* gr = grFactory->get(config.fGLContextType); |
1549 bool grSuccess = false; | 1555 bool grSuccess = false; |
1550 if (gr) { | 1556 if (gr) { |
1551 // create a render target to back the device | 1557 // create a render target to back the device |
1552 GrTextureDesc desc; | 1558 GrTextureDesc desc; |
1553 desc.fConfig = kSkia8888_GrPixelConfig; | 1559 desc.fConfig = kSkia8888_GrPixelConfig; |
1554 desc.fFlags = kRenderTarget_GrTextureFlagBit; | 1560 desc.fFlags = kRenderTarget_GrTextureFlagBit; |
1555 desc.fWidth = gm->getISize().width(); | 1561 desc.fWidth = gm->getISize().width(); |
1556 desc.fHeight = gm->getISize().height(); | 1562 desc.fHeight = gm->getISize().height(); |
1557 desc.fSampleCnt = config.fSampleCnt; | 1563 desc.fSampleCnt = config.fSampleCnt; |
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2271 if (FLAGS_forceBWtext) { | 2277 if (FLAGS_forceBWtext) { |
2272 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); | 2278 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); |
2273 } | 2279 } |
2274 } | 2280 } |
2275 | 2281 |
2276 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 2282 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
2277 int main(int argc, char * const argv[]) { | 2283 int main(int argc, char * const argv[]) { |
2278 return tool_main(argc, (char**) argv); | 2284 return tool_main(argc, (char**) argv); |
2279 } | 2285 } |
2280 #endif | 2286 #endif |
OLD | NEW |