SkPDF: allow PDF module to be disabled in DM and SampleApp
To disable PDF:
GYP_DEFINES='skia_pdf=0' bin/sync-and-gyp
ninja -C out/Debug dm SampleApp
When disabled, SkDocument::CreatePDF() always returns NULL.
Review URL: https://codereview.chromium.org/1279123007
diff --git a/tests/CanvasTest.cpp b/tests/CanvasTest.cpp
index 970a370..78253ac 100644
--- a/tests/CanvasTest.cpp
+++ b/tests/CanvasTest.cpp
@@ -568,6 +568,8 @@
CanvasTestStep* testStep) {
SkDynamicMemoryWStream outStream;
SkAutoTUnref<SkDocument> doc(SkDocument::CreatePDF(&outStream));
+#if SK_SUPPORT_PDF
+ REPORTER_ASSERT(reporter, doc);
SkCanvas* canvas = doc->beginPage(SkIntToScalar(d.fWidth),
SkIntToScalar(d.fHeight));
REPORTER_ASSERT(reporter, canvas);
@@ -575,6 +577,9 @@
testStep->draw(canvas, d, reporter);
REPORTER_ASSERT(reporter, doc->close());
+#else
+ REPORTER_ASSERT(reporter, !doc);
+#endif // SK_SUPPORT_PDF
}
// The following class groups static functions that need to access