Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(235)

Unified Diff: dm/DM.cpp

Issue 830333005: add --rasterPDF flag to DM (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: compile on win (try again) Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DM.cpp
diff --git a/dm/DM.cpp b/dm/DM.cpp
index 047b8d6a50e3e1a26fe29ae0a8823ccbc3f0eacc..7113ad839a02e4e61cc028adf608c389e389edea 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())));
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698