|
|
Descriptionreplace gm_fprintf() calls with SkDebugf()
BUG=skia:1221
Committed: http://code.google.com/p/skia/source/detail?r=13613
Patch Set 1 #Patch Set 2 : rebase #
Messages
Total messages: 10 (0 generated)
Ready for review at patchset 1. 2 of my 3 HouseKeeper trybot runs failed due to https://code.google.com/p/skia/issues/detail?id=2229 ('Spurious "[Errno 101] Network is unreachable" failures on Skia GCE bots (housekeeper, rebaselineserver)'), but the one that succeeded is good enough for me. :-)
ping
On 2014/02/27 17:49:38, epoger wrote: > ping lgtm
The CQ bit was checked by epoger@google.com
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/epoger@google.com/181933002/1
The CQ bit was unchecked by commit-bot@chromium.org
Failed to apply patch for gm/gmmain.cpp: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file gm/gmmain.cpp Hunk #7 FAILED at 1089. 1 out of 27 hunks FAILED -- saving rejects to file gm/gmmain.cpp.rej Patch: gm/gmmain.cpp Index: gm/gmmain.cpp diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp index fb50b1e34eddf34867e909279adfb67fe1d7aef5..5f2f7d7388cd8fdd3f412cdec96b95b6490e9c8d 100644 --- a/gm/gmmain.cpp +++ b/gm/gmmain.cpp @@ -274,7 +274,7 @@ public: // nothing to do here; 565 bitmaps are inherently opaque break; default: - gm_fprintf(stderr, "unsupported bitmap colorType %d\n", colorType); + SkDebugf("unsupported bitmap colorType %d\n", colorType); DEBUGFAIL_SEE_STDERR; } } @@ -297,7 +297,7 @@ public: if (!SkImageEncoder::EncodeFile(path.c_str(), copy, SkImageEncoder::kPNG_Type, 100)) { - gm_fprintf(stderr, "FAILED to write bitmap: %s\n", path.c_str()); + SkDebugf("FAILED to write bitmap: %s\n", path.c_str()); return ErrorCombination(kWritingReferenceImage_ErrorType); } return kEmpty_ErrorCombination; @@ -429,7 +429,7 @@ public: line.append((*failedTestsOfThisType)[i]); } } - gm_fprintf(stdout, "%s\n", line.c_str()); + SkDebugf("%s\n", line.c_str()); } /** @@ -445,19 +445,19 @@ public: ErrorType type = static_cast<ErrorType>(typeInt); summary.appendf(" %s=%d", getErrorTypeName(type), fFailedTests[type].count()); } - gm_fprintf(stdout, "%s\n", summary.c_str()); + SkDebugf("%s\n", summary.c_str()); // Now, for each failure type, list the tests that failed that way. for (int typeInt = 0; typeInt <= kLast_ErrorType; typeInt++) { this->DisplayResultTypeSummary(static_cast<ErrorType>(typeInt), verbose); } - gm_fprintf(stdout, "(results marked with [*] will cause nonzero return value)\n"); + SkDebugf("(results marked with [*] will cause nonzero return value)\n"); } static ErrorCombination write_document(const SkString& path, SkStreamAsset* asset) { SkFILEWStream stream(path.c_str()); if (!stream.writeStream(asset, asset->getLength())) { - gm_fprintf(stderr, "FAILED to write document: %s\n", path.c_str()); + SkDebugf("FAILED to write document: %s\n", path.c_str()); return ErrorCombination(kWritingReferenceImage_ErrorType); } return kEmpty_ErrorCombination; @@ -734,16 +734,15 @@ public: const int width = actualBitmap.width(); const int height = actualBitmap.height(); if ((expectedWidth != width) || (expectedHeight != height)) { - gm_fprintf(stderr, "---- %s: dimension mismatch --" - " expected [%d %d], actual [%d %d]\n", - testName, expectedWidth, expectedHeight, width, height); + SkDebugf("---- %s: dimension mismatch -- expected [%d %d], actual [%d %d]\n", + testName, expectedWidth, expectedHeight, width, height); return; } if ((kPMColor_SkColorType != expectedBitmap.colorType()) || (kPMColor_SkColorType != actualBitmap.colorType())) { - gm_fprintf(stderr, "---- %s: not computing max per-channel" - " pixel mismatch because non-8888\n", testName); + SkDebugf("---- %s: not computing max per-channel pixel mismatch because non-8888\n", + testName); return; } @@ -774,9 +773,9 @@ public: } } } - gm_fprintf(stderr, "---- %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); + 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); } /** @@ -1090,9 +1089,9 @@ public: bool success = (*pdfRasterizers[i]->fRasterizerFunction)( documentStream.get(), &pdfBitmap); if (!success) { - gm_fprintf(stderr, "FAILED to render PDF for %s using renderer %s\n", - gm->shortName(), - pdfRasterizers[i]->fName); + SkDebugf("FAILED to render PDF for %s using renderer %s\n", + gm->shortName(), + pdfRasterizers[i]->fName); continue; } @@ -1819,7 +1818,7 @@ static bool read_lines_from_file(const char* filename, SkTArray<SkString> &lines SkAutoTUnref<SkStream> streamWrapper(SkStream::NewFromFile(filename)); SkStream *stream = streamWrapper.get(); if (!stream) { - gm_fprintf(stderr, "unable to read file '%s'\n", filename); + SkDebugf("unable to read file '%s'\n", filename); return false; } @@ -1932,8 +1931,8 @@ static bool parse_flags_configs(SkTDArray<size_t>* outConfigs, } } else if (0 == strcmp(kDefaultsConfigStr, config)) { if (exclude) { - gm_fprintf(stderr, "%c%s is not allowed.\n", - kExcludeConfigChar, kDefaultsConfigStr); + SkDebugf("%c%s is not allowed.\n", + kExcludeConfigChar, kDefaultsConfigStr); return false; } for (size_t c = 0; c < SK_ARRAY_COUNT(gRec); ++c) { @@ -1942,7 +1941,7 @@ static bool parse_flags_configs(SkTDArray<size_t>* outConfigs, } } } else { - gm_fprintf(stderr, "unrecognized config %s\n", config); + SkDebugf("unrecognized config %s\n", config); return false; } } @@ -1952,7 +1951,7 @@ static bool parse_flags_configs(SkTDArray<size_t>* outConfigs, if (index >= 0) { *excludeConfigs.append() = index; } else { - gm_fprintf(stderr, "unrecognized excludeConfig %s\n", FLAGS_excludeConfig[i]); + SkDebugf("unrecognized excludeConfig %s\n", FLAGS_excludeConfig[i]); return false; } } @@ -1982,16 +1981,16 @@ static bool parse_flags_configs(SkTDArray<size_t>* outConfigs, if (kGPU_Backend == gRec[index].fBackend) { GrContext* ctx = grFactory->get(gRec[index].fGLContextType); if (NULL == ctx) { - gm_fprintf(stderr, "GrContext could not be created for config %s." - " Config will be skipped.\n", gRec[index].fName); + SkDebugf("GrContext could not be created for config %s. Config will be skipped.\n", + gRec[index].fName); outConfigs->remove(i); --i; continue; } if (gRec[index].fSampleCnt > ctx->getMaxSampleCount()) { - gm_fprintf(stderr, "Sample count (%d) of config %s is not supported." - " Config will be skipped.\n", - gRec[index].fSampleCnt, gRec[index].fName); + SkDebugf("Sample count (%d) of config %s is not supported." + " Config will be skipped.\n", + gRec[index].fSampleCnt, gRec[index].fName); outConfigs->remove(i); --i; } @@ -2000,7 +1999,7 @@ static bool parse_flags_configs(SkTDArray<size_t>* outConfigs, #endif if (outConfigs->isEmpty()) { - gm_fprintf(stderr, "No configs to run."); + SkDebugf("No configs to run."); return false; } @@ -2010,7 +2009,7 @@ static bool parse_flags_configs(SkTDArray<size_t>* outConfigs, for (int i = 0; i < outConfigs->count(); ++i) { configStr.appendf(" %s", gRec[(*outConfigs)[i]].fName); } - gm_fprintf(stdout, "%s\n", configStr.c_str()); + SkDebugf("%s\n", configStr.c_str()); return true; } @@ -2043,7 +2042,7 @@ static bool parse_flags_pdf_rasterizers(const SkTDArray<size_t>& configs, const PDFRasterizerData* rasterizerPtr = findPDFRasterizer(rasterizer); if (rasterizerPtr == NULL) { - gm_fprintf(stderr, "unrecognized rasterizer %s\n", rasterizer); + SkDebugf("unrecognized rasterizer %s\n", rasterizer); return false; } appendUnique<const PDFRasterizerData*>(outRasterizers, @@ -2057,7 +2056,7 @@ static bool parse_flags_pdf_rasterizers(const SkTDArray<size_t>& configs, for (int i = 0; i < outRasterizers->count(); ++i) { configStr.appendf(" %s", (*outRasterizers)[i]->fName); } - gm_fprintf(stdout, "%s\n", configStr.c_str()); + SkDebugf("%s\n", configStr.c_str()); return true; } @@ -2069,7 +2068,7 @@ static bool parse_flags_ignore_error_types(ErrorCombination* outErrorTypes) { ErrorType type; const char *name = FLAGS_ignoreErrorTypes[i]; if (!getErrorTypeByName(name, &type)) { - gm_fprintf(stderr, "cannot find ErrorType with name '%s'\n", name); + SkDebugf("cannot find ErrorType with name '%s'\n", name); return false; } else { outErrorTypes->add(type); @@ -2112,7 +2111,7 @@ static bool parse_flags_modulo(int* moduloRemainder, int* moduloDivisor) { *moduloDivisor = atoi(FLAGS_modulo[1]); … (message too large)
The CQ bit was checked by epoger@google.com
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/epoger@google.com/181933002/20001
Message was sent while issue was closed.
Change committed as 13613 |