aboutsummaryrefslogtreecommitdiffhomepage
path: root/dm/DM.cpp
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2015-01-10 11:18:04 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-01-10 11:18:04 -0800
commit9e398f79c95640359847a153f53f30a2823be40c (patch)
tree98f5eae8945e15b9f5340658e4f63e3bee3e6993 /dm/DM.cpp
parent07394ca5ed36cb8cb49dcf08270e83c871063340 (diff)
add --rasterPDF flag to DM
If no rasterizer is compiled in, this flag does nothing. Default value (true) gives the same behavior as before. Review URL: https://codereview.chromium.org/830333005
Diffstat (limited to 'dm/DM.cpp')
-rw-r--r--dm/DM.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/dm/DM.cpp b/dm/DM.cpp
index 047b8d6a50..7113ad839a 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -21,6 +21,7 @@
#include "DMImageTask.h"
#include "DMJsonWriter.h"
#include "DMPDFTask.h"
+#include "DMPDFRasterizeTask.h"
#include "DMReporter.h"
#include "DMSKPTask.h"
#include "DMTask.h"
@@ -52,9 +53,15 @@ DEFINE_bool(tests, true, "Run tests?");
DEFINE_bool(reportUsedChars, false, "Output test font construction data to be pasted into"
" create_test_font.cpp.");
DEFINE_string(images, "resources", "Path to directory containing images to decode.");
+DEFINE_bool(rasterPDF, true, "Rasterize PDFs?");
__SK_FORCE_IMAGE_DECODER_LINKING;
+static DM::RasterizePdfProc get_pdf_rasterizer_proc() {
+ return reinterpret_cast<DM::RasterizePdfProc>(
+ FLAGS_rasterPDF ? RASTERIZE_PDF_PROC : NULL);
+}
+
// "FooBar" -> "foobar". Obviously, ASCII only.
static SkString lowercase(SkString s) {
for (size_t i = 0; i < s.size(); i++) {
@@ -102,7 +109,7 @@ static void kick_off_gms(const SkTDArray<GMRegistry::Factory>& gms,
#if SK_MESA
START("mesa", GpuGMTask, mesa, gpuAPI, 0, false);
#endif
- START("pdf", PDFTask, RASTERIZE_PDF_PROC);
+ START("pdf", PDFTask, get_pdf_rasterizer_proc());
}
}
#undef START
@@ -158,7 +165,8 @@ static void kick_off_skps(const SkTArray<SkString>& skps,
SkString filename = SkOSPath::Basename(skps[i].c_str());
tasks->add(SkNEW_ARGS(DM::SKPTask, (reporter, tasks, pic, filename)));
- tasks->add(SkNEW_ARGS(DM::PDFTask, (reporter, tasks, pic, filename, RASTERIZE_PDF_PROC)));
+ tasks->add(SkNEW_ARGS(DM::PDFTask, (reporter, tasks, pic, filename,
+ get_pdf_rasterizer_proc())));
}
}