| Index: gm/gmmain.cpp
|
| ===================================================================
|
| --- gm/gmmain.cpp (revision 8115)
|
| +++ gm/gmmain.cpp (working copy)
|
| @@ -223,8 +223,8 @@
|
| // nothing to do here; 565 bitmaps are inherently opaque
|
| break;
|
| default:
|
| - fprintf(stderr, "unsupported bitmap config %d\n", config);
|
| - SkDEBUGFAIL("unsupported bitmap config");
|
| + fprintf(stderr, GM_PREAMBLE "unsupported bitmap config %d\n", config);
|
| + DEBUGFAIL_SEE_STDERR;
|
| }
|
| }
|
|
|
| @@ -271,9 +271,9 @@
|
| void ListErrors() {
|
| for (int i = 0; i < fFailedTests.count(); ++i) {
|
| if (fFailedTests[i].fIsPixelError) {
|
| - SkDebugf("\t\t%s pixel_error\n", fFailedTests[i].fName.c_str());
|
| + fprintf(stderr, GM_PREAMBLE "\t\t%s pixel_error\n", fFailedTests[i].fName.c_str());
|
| } else {
|
| - SkDebugf("\t\t%s\n", fFailedTests[i].fName.c_str());
|
| + fprintf(stderr, GM_PREAMBLE "\t\t%s\n", fFailedTests[i].fName.c_str());
|
| }
|
| }
|
| }
|
| @@ -518,7 +518,7 @@
|
| if (success) {
|
| return kEmptyErrorBitfield;
|
| } else {
|
| - fprintf(stderr, "FAILED to write %s\n", path.c_str());
|
| + fprintf(stderr, GM_PREAMBLE "FAILED to write %s\n", path.c_str());
|
| RecordError(kWritingReferenceImage_ErrorBitmask, name,
|
| renderModeDescriptor);
|
| return kWritingReferenceImage_ErrorBitmask;
|
| @@ -536,15 +536,16 @@
|
| const int width = actualBitmap.width();
|
| const int height = actualBitmap.height();
|
| if ((expectedWidth != width) || (expectedHeight != height)) {
|
| - SkDebugf("---- %s: dimension mismatch -- expected [%d %d], actual [%d %d]\n",
|
| + fprintf(stderr, GM_PREAMBLE "---- %s: dimension mismatch --"
|
| + " expected [%d %d], actual [%d %d]\n",
|
| testName, expectedWidth, expectedHeight, width, height);
|
| return;
|
| }
|
|
|
| if ((SkBitmap::kARGB_8888_Config != expectedBitmap.config()) ||
|
| (SkBitmap::kARGB_8888_Config != actualBitmap.config())) {
|
| - SkDebugf("---- %s: not computing max per-channel pixel mismatch because non-8888\n",
|
| - testName);
|
| + fprintf(stderr, GM_PREAMBLE "---- %s: not computing max per-channel"
|
| + " pixel mismatch because non-8888\n", testName);
|
| return;
|
| }
|
|
|
| @@ -575,9 +576,9 @@
|
| }
|
| }
|
| }
|
| - SkDebugf("---- %s: %d (of %d) differing pixels, max per-channel mismatch"
|
| - " R=%d G=%d B=%d A=%d\n",
|
| - testName, differingPixels, width*height, errR, errG, errB, errA);
|
| + fprintf(stderr, GM_PREAMBLE "---- %s: %d (of %d) differing pixels,"
|
| + " max per-channel mismatch R=%d G=%d B=%d A=%d\n",
|
| + testName, differingPixels, width*height, errR, errG, errB, errA);
|
| }
|
|
|
| /**
|
| @@ -1012,16 +1013,16 @@
|
| };
|
|
|
| static void usage(const char * argv0) {
|
| - SkDebugf("%s\n", argv0);
|
| - SkDebugf(" [--config ");
|
| + fprintf(stderr, "%s\n", argv0);
|
| + fprintf(stderr, " [--config ");
|
| for (size_t i = 0; i < SK_ARRAY_COUNT(gRec); ++i) {
|
| if (i > 0) {
|
| - SkDebugf("|");
|
| + fprintf(stderr, "|");
|
| }
|
| - SkDebugf(gRec[i].fName);
|
| + fprintf(stderr, "%s", gRec[i].fName);
|
| }
|
| - SkDebugf("]:\n run these configurations\n");
|
| - SkDebugf(
|
| + fprintf(stderr, "]:\n run these configurations\n");
|
| + fprintf(stderr,
|
| // Alphabetized ignoring "no" prefix ("readPath", "noreplay", "resourcePath").
|
| // It would probably be better if we allowed both yes-and-no settings for each
|
| // one, e.g.:
|
| @@ -1197,14 +1198,12 @@
|
| appendUnique<size_t>(&configs, index);
|
| userConfig = true;
|
| } else {
|
| - SkString str;
|
| - str.printf("unrecognized config %s\n", *argv);
|
| - SkDebugf(str.c_str());
|
| + fprintf(stderr, GM_PREAMBLE "unrecognized config %s\n", *argv);
|
| usage(commandName);
|
| return -1;
|
| }
|
| } else {
|
| - SkDebugf("missing arg for --config\n");
|
| + fprintf(stderr, GM_PREAMBLE "missing arg for --config\n");
|
| usage(commandName);
|
| return -1;
|
| }
|
| @@ -1215,14 +1214,12 @@
|
| if (index >= 0) {
|
| *excludeConfigs.append() = index;
|
| } else {
|
| - SkString str;
|
| - str.printf("unrecognized exclude-config %s\n", *argv);
|
| - SkDebugf(str.c_str());
|
| + fprintf(stderr, GM_PREAMBLE "unrecognized exclude-config %s\n", *argv);
|
| usage(commandName);
|
| return -1;
|
| }
|
| } else {
|
| - SkDebugf("missing arg for --exclude-config\n");
|
| + fprintf(stderr, GM_PREAMBLE "missing arg for --exclude-config\n");
|
| usage(commandName);
|
| return -1;
|
| }
|
| @@ -1267,7 +1264,7 @@
|
| gpuCacheSize.fBytes = atoi(*++argv);
|
| gpuCacheSize.fCount = atoi(*++argv);
|
| } else {
|
| - SkDebugf("missing arg for --gpuCacheSize\n");
|
| + fprintf(stderr, GM_PREAMBLE "missing arg for --gpuCacheSize\n");
|
| usage(commandName);
|
| return -1;
|
| }
|
| @@ -1298,7 +1295,7 @@
|
| }
|
| moduloDivisor = atoi(*argv);
|
| if (moduloRemainder < 0 || moduloDivisor <= 0 || moduloRemainder >= moduloDivisor) {
|
| - SkDebugf("invalid modulo values.");
|
| + fprintf(stderr, GM_PREAMBLE "invalid modulo values.");
|
| return -1;
|
| }
|
| } else if (strcmp(*argv, "--nopdf") == 0) {
|
| @@ -1376,36 +1373,36 @@
|
| for (int i = 0; i < configs.count(); ++i) {
|
| str.appendf(" %s", gRec[configs[i]].fName);
|
| }
|
| - SkDebugf("%s\n", str.c_str());
|
| + fprintf(stderr, "%s\n", str.c_str());
|
| }
|
|
|
| GM::SetResourcePath(resourcePath);
|
|
|
| if (readPath) {
|
| if (!sk_exists(readPath)) {
|
| - fprintf(stderr, "readPath %s does not exist!\n", readPath);
|
| + fprintf(stderr, GM_PREAMBLE "readPath %s does not exist!\n", readPath);
|
| return -1;
|
| }
|
| if (sk_isdir(readPath)) {
|
| - fprintf(stderr, "reading from %s\n", readPath);
|
| + fprintf(stdout, GM_PREAMBLE "reading from %s\n", readPath);
|
| gmmain.fExpectationsSource.reset(SkNEW_ARGS(
|
| IndividualImageExpectationsSource,
|
| (readPath, notifyMissingReadReference)));
|
| } else {
|
| - fprintf(stderr, "reading expectations from JSON summary file %s\n",
|
| + fprintf(stdout, GM_PREAMBLE "reading expectations from JSON summary file %s\n",
|
| readPath);
|
| gmmain.fExpectationsSource.reset(SkNEW_ARGS(
|
| JsonExpectationsSource, (readPath)));
|
| }
|
| }
|
| if (writePath) {
|
| - fprintf(stderr, "writing to %s\n", writePath);
|
| + fprintf(stdout, GM_PREAMBLE "writing to %s\n", writePath);
|
| }
|
| if (writePicturePath) {
|
| - fprintf(stderr, "writing pictures to %s\n", writePicturePath);
|
| + fprintf(stdout, GM_PREAMBLE "writing pictures to %s\n", writePicturePath);
|
| }
|
| if (resourcePath) {
|
| - fprintf(stderr, "reading resources from %s\n", resourcePath);
|
| + fprintf(stdout, GM_PREAMBLE "reading resources from %s\n", resourcePath);
|
| }
|
|
|
| if (moduloDivisor <= 0) {
|
| @@ -1465,7 +1462,7 @@
|
| }
|
|
|
| SkISize size = gm->getISize();
|
| - SkDebugf("%sdrawing... %s [%d %d]\n", moduloStr.c_str(), shortName,
|
| + fprintf(stdout, GM_PREAMBLE "%sdrawing... %s [%d %d]\n", moduloStr.c_str(), shortName,
|
| size.width(), size.height());
|
|
|
| ErrorBitfield testErrors = kEmptyErrorBitfield;
|
| @@ -1682,8 +1679,8 @@
|
|
|
| SkDELETE(gm);
|
| }
|
| - SkDebugf("Ran %d tests: %d passed, %d failed, %d missing reference images\n",
|
| - testsRun, testsPassed, testsFailed, testsMissingReferenceImages);
|
| + fprintf(stdout, GM_PREAMBLE "Ran %d tests: %d passed, %d failed, %d missing reference images\n",
|
| + testsRun, testsPassed, testsFailed, testsMissingReferenceImages);
|
| gmmain.ListErrors();
|
|
|
| if (NULL != writeJsonSummaryPath) {
|
| @@ -1713,7 +1710,7 @@
|
| if (kGPU_Backend == config.fBackend) {
|
| GrContext* gr = grFactory->get(config.fGLContextType);
|
|
|
| - SkDebugf("config: %s %x\n", config.fName, gr);
|
| + fprintf(stdout, GM_PREAMBLE "config: %s %x\n", config.fName, gr);
|
| gr->printCacheStats();
|
| }
|
| }
|
|
|