diff options
author | halcanary <halcanary@google.com> | 2015-08-11 10:30:12 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-11 10:30:12 -0700 |
commit | 8ee06f21a27bbffaf613a312c6f24bbbb21c650a (patch) | |
tree | 781cfcac8ec506a9fcb9cbddf943f5ff37eba355 /tests/CanvasTest.cpp | |
parent | 4cf9e7e14797f87f08b2078fa1afaf731cbf8f52 (diff) |
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
Diffstat (limited to 'tests/CanvasTest.cpp')
-rw-r--r-- | tests/CanvasTest.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/CanvasTest.cpp b/tests/CanvasTest.cpp index 970a37074f..78253ac900 100644 --- a/tests/CanvasTest.cpp +++ b/tests/CanvasTest.cpp @@ -568,6 +568,8 @@ static void TestPdfDevice(skiatest::Reporter* reporter, 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 @@ static void TestPdfDevice(skiatest::Reporter* reporter, 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 |