SkPDF: clean up overuse of SK_SUPPORT_PDF
When possible use run-time checks (via SkDocument::CreatePDF)
When PDF is disabled, do not compile tests/PDF*.cpp
Review URL: https://codereview.chromium.org/1278403006
diff --git a/tests/CanvasTest.cpp b/tests/CanvasTest.cpp
index 78253ac..0d5c862 100644
--- a/tests/CanvasTest.cpp
+++ b/tests/CanvasTest.cpp
@@ -570,6 +570,12 @@
SkAutoTUnref<SkDocument> doc(SkDocument::CreatePDF(&outStream));
#if SK_SUPPORT_PDF
REPORTER_ASSERT(reporter, doc);
+#else
+ REPORTER_ASSERT(reporter, !doc);
+#endif // SK_SUPPORT_PDF
+ if (!doc) {
+ return;
+ }
SkCanvas* canvas = doc->beginPage(SkIntToScalar(d.fWidth),
SkIntToScalar(d.fHeight));
REPORTER_ASSERT(reporter, canvas);
@@ -577,9 +583,6 @@
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