DM: PDFSink sets rasterizer keyword
authorhalcanary <halcanary@google.com>
Mon, 28 Sep 2015 18:51:54 +0000 (11:51 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 28 Sep 2015 18:51:54 +0000 (11:51 -0700)
Review URL: https://codereview.chromium.org/1376573002

dm/DM.cpp
dm/DMSrcSink.cpp
dm/DMSrcSink.h
tools/dm_flags.json
tools/dm_flags.py

index f70c81a94305caec9f3cb744cb6bf643cf2a5bd5..11581fda81fc71e7d30a2aa9a226fe2b45b3385a 100644 (file)
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -589,7 +589,8 @@ static Sink* create_sink(const char* tag) {
     if (FLAGS_cpu) {
         SINK("565",  RasterSink, kRGB_565_SkColorType);
         SINK("8888", RasterSink, kN32_SkColorType);
-        SINK("pdf",  PDFSink);
+        SINK("pdf",  PDFSink, "Pdfium");
+        SINK("pdf_poppler",  PDFSink, "Poppler");
         SINK("skp",  SKPSink);
         SINK("svg",  SVGSink);
         SINK("null", NullSink);
index 25b5f7b4609c615ee4973c5da44eaa6e83a49fd9..96a0ab1a3ef08c04b9067ca2092e7defe77ea2ff 100644 (file)
@@ -924,7 +924,7 @@ static Error draw_skdocument(const Src& src, SkDocument* doc, SkWStream* dst) {
     return "";
 }
 
-PDFSink::PDFSink() {}
+PDFSink::PDFSink(const char* rasterizer) : fRasterizer(rasterizer) {}
 
 Error PDFSink::draw(const Src& src, SkBitmap*, SkWStream* dst, SkString*) const {
     SkAutoTUnref<SkDocument> doc(SkDocument::CreatePDF(dst));
@@ -936,6 +936,9 @@ Error PDFSink::draw(const Src& src, SkBitmap*, SkWStream* dst, SkString*) const
     info.emplace_back(SkString("Subject"),
                       SkString("rendering correctness test"));
     info.emplace_back(SkString("Creator"), SkString("Skia/DM"));
+
+    info.emplace_back(SkString("Keywords"),
+                      SkStringPrintf("Rasterizer:%s;", fRasterizer));
     doc->setMetadata(info, nullptr, nullptr);
     return draw_skdocument(src, doc.get(), dst);
 }
index 9e0ef496511b0adb336a19a27658d90f4299185d..d8811378962a706070d4695034dcd96b5d67b6bc 100644 (file)
@@ -213,12 +213,14 @@ private:
 
 class PDFSink : public Sink {
 public:
-    PDFSink();
+    PDFSink(const char* rasterizer);
 
     Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
     int enclave() const override { return kAnyThread_Enclave; }
     const char* fileExtension() const override { return "pdf"; }
     SinkFlags flags() const override { return SinkFlags{ SinkFlags::kVector, SinkFlags::kDirect }; }
+private:
+    const char* fRasterizer;
 };
 
 class XPSSink : public Sink {
index 6a05726b813d6314898dabbbfdbc2f5efe237c93..2faef1c14d39de8e988dcf55840972bceba38863 100644 (file)
@@ -12,6 +12,7 @@
     "upright-matrix-8888", 
     "upright-matrix-gpu", 
     "pdf", 
+    "pdf_poppler", 
     "serialize-8888", 
     "tiles_rt-8888", 
     "pipe-8888", 
     "sp-8888", 
     "msaa16", 
     "pdf", 
+    "pdf_poppler", 
     "serialize-8888", 
     "tiles_rt-8888", 
     "pipe-8888", 
     "sp-8888", 
     "msaa16", 
     "pdf", 
+    "pdf_poppler", 
     "serialize-8888", 
     "tiles_rt-8888", 
     "pipe-8888", 
     "nvprmsaa16", 
     "msaa16", 
     "pdf", 
+    "pdf_poppler", 
     "serialize-8888", 
     "tiles_rt-8888", 
     "pipe-8888", 
     "upright-matrix-gpu", 
     "msaa16", 
     "pdf", 
+    "pdf_poppler", 
     "serialize-8888", 
     "tiles_rt-8888", 
     "pipe-8888", 
index f33889cbdd6b3d999493ab450e8e8602f3c26a2c..37ff485ed1b387ec0b082c706ebfb2bbb7dbe836 100755 (executable)
@@ -57,6 +57,7 @@ def get_args(bot):
   # Runs out of memory on Android bots and Daisy.  Everyone else seems fine.
   if 'Android' not in bot and 'Daisy' not in bot:
     configs.append('pdf')
+    configs.append('pdf_poppler')
 
   # NP is running out of RAM when we run all these modes.  skia:3255
   if 'NexusPlayer' not in bot: