diff options
author | halcanary <halcanary@google.com> | 2015-08-11 13:35:12 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-11 13:35:12 -0700 |
commit | 2ccdb636e8618db77be8e05cdacd82c249c6898c (patch) | |
tree | 2cf6f3fc1e2dc9cdc15645415a415cf7481244cd /tests/CanvasTest.cpp | |
parent | fcaaadee711a93d601ccc9f0b47d744e22c35205 (diff) |
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
Diffstat (limited to 'tests/CanvasTest.cpp')
-rw-r--r-- | tests/CanvasTest.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/CanvasTest.cpp b/tests/CanvasTest.cpp index 78253ac900..0d5c862360 100644 --- a/tests/CanvasTest.cpp +++ b/tests/CanvasTest.cpp @@ -570,6 +570,12 @@ static void TestPdfDevice(skiatest::Reporter* reporter, 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 @@ 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 |