From f8afb2bd5853f9d66448ba1f23251f8c93340bf6 Mon Sep 17 00:00:00 2001 From: "vandebo@chromium.org" Date: Wed, 6 Nov 2013 16:32:15 +0000 Subject: [PATCH] Update gm flags so that it can be run without a pdf rasterizer. BUG=1806 R=edisonn@google.com Review URL: https://codereview.chromium.org/61643004 git-svn-id: http://skia.googlecode.com/svn/trunk@12157 2bbb7eff-a529-9590-31e7-b0007b416f81 --- gm/gmmain.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp index 92c70b5842..2a7db03bab 100644 --- a/gm/gmmain.cpp +++ b/gm/gmmain.cpp @@ -1408,7 +1408,7 @@ static SkString pdfRasterizerUsage() { // Alphabetized ignoring "no" prefix ("readPath", "noreplay", "resourcePath"). DEFINE_string(config, "", configUsage().c_str()); -DEFINE_string(pdfRasterizers, "", pdfRasterizerUsage().c_str()); +DEFINE_string(pdfRasterizers, "default", pdfRasterizerUsage().c_str()); DEFINE_bool(deferred, false, "Exercise the deferred rendering test pass."); DEFINE_string(excludeConfig, "", "Space delimited list of configs to skip."); DEFINE_bool(forceBWtext, false, "Disable text anti-aliasing."); @@ -2003,25 +2003,25 @@ static bool parse_flags_pdf_rasterizers(const SkTDArray& configs, return true; } - for (int i = 0; i < FLAGS_pdfRasterizers.count(); i++) { - const char* rasterizer = FLAGS_pdfRasterizers[i]; - const PDFRasterizerData* rasterizerPtr = findPDFRasterizer(rasterizer); - - if (rasterizerPtr == NULL) { - gm_fprintf(stderr, "unrecognized rasterizer %s\n", rasterizer); - return false; - } - appendUnique(outRasterizers, - rasterizerPtr); - } - - if (outRasterizers->count() == 0) { - // if no config is specified by user, add the defaults + if (FLAGS_pdfRasterizers.count() == 1 && + !strcmp(FLAGS_pdfRasterizers[0], "default")) { for (int i = 0; i < (int)SK_ARRAY_COUNT(kPDFRasterizers); ++i) { if (kPDFRasterizers[i].fRunByDefault) { *outRasterizers->append() = &kPDFRasterizers[i]; } } + } else { + for (int i = 0; i < FLAGS_pdfRasterizers.count(); i++) { + const char* rasterizer = FLAGS_pdfRasterizers[i]; + const PDFRasterizerData* rasterizerPtr = + findPDFRasterizer(rasterizer); + if (rasterizerPtr == NULL) { + gm_fprintf(stderr, "unrecognized rasterizer %s\n", rasterizer); + return false; + } + appendUnique(outRasterizers, + rasterizerPtr); + } } // now show the user the set of configs that will be run.