| OLD | NEW |
| 1 | |
| 2 /* | 1 /* |
| 3 * Copyright 2010 The Android Open Source Project | 2 * Copyright 2010 The Android Open Source Project |
| 4 * | 3 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 7 */ | 6 */ |
| 8 | 7 |
| 9 #include "Test.h" | 8 #include "Test.h" |
| 9 #include "TestClassDef.h" |
| 10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
| 11 #include "SkCanvas.h" | 11 #include "SkCanvas.h" |
| 12 #include "SkData.h" | 12 #include "SkData.h" |
| 13 #include "SkFlate.h" | 13 #include "SkFlate.h" |
| 14 #include "SkImageEncoder.h" | 14 #include "SkImageEncoder.h" |
| 15 #include "SkMatrix.h" | 15 #include "SkMatrix.h" |
| 16 #include "SkPDFCatalog.h" | 16 #include "SkPDFCatalog.h" |
| 17 #include "SkPDFDevice.h" | 17 #include "SkPDFDevice.h" |
| 18 #include "SkPDFStream.h" | 18 #include "SkPDFStream.h" |
| 19 #include "SkPDFTypes.h" | 19 #include "SkPDFTypes.h" |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 uint16_t glyphID = 65000; | 339 uint16_t glyphID = 65000; |
| 340 c.drawText(&glyphID, 2, 0, 0, paint); | 340 c.drawText(&glyphID, 2, 0, 0, paint); |
| 341 | 341 |
| 342 SkPDFDocument doc; | 342 SkPDFDocument doc; |
| 343 doc.appendPage(dev); | 343 doc.appendPage(dev); |
| 344 | 344 |
| 345 SkDynamicMemoryWStream stream; | 345 SkDynamicMemoryWStream stream; |
| 346 doc.emitPDF(&stream); | 346 doc.emitPDF(&stream); |
| 347 } | 347 } |
| 348 | 348 |
| 349 static void TestPDFPrimitives(skiatest::Reporter* reporter) { | 349 DEF_TEST(PDFPrimitives, reporter) { |
| 350 SkAutoTUnref<SkPDFInt> int42(new SkPDFInt(42)); | 350 SkAutoTUnref<SkPDFInt> int42(new SkPDFInt(42)); |
| 351 SimpleCheckObjectOutput(reporter, int42.get(), "42"); | 351 SimpleCheckObjectOutput(reporter, int42.get(), "42"); |
| 352 | 352 |
| 353 SkAutoTUnref<SkPDFScalar> realHalf(new SkPDFScalar(SK_ScalarHalf)); | 353 SkAutoTUnref<SkPDFScalar> realHalf(new SkPDFScalar(SK_ScalarHalf)); |
| 354 SimpleCheckObjectOutput(reporter, realHalf.get(), "0.5"); | 354 SimpleCheckObjectOutput(reporter, realHalf.get(), "0.5"); |
| 355 | 355 |
| 356 #if defined(SK_SCALAR_IS_FLOAT) | 356 #if defined(SK_SCALAR_IS_FLOAT) |
| 357 SkAutoTUnref<SkPDFScalar> bigScalar(new SkPDFScalar(110999.75f)); | 357 SkAutoTUnref<SkPDFScalar> bigScalar(new SkPDFScalar(110999.75f)); |
| 358 #if !defined(SK_ALLOW_LARGE_PDF_SCALARS) | 358 #if !defined(SK_ALLOW_LARGE_PDF_SCALARS) |
| 359 SimpleCheckObjectOutput(reporter, bigScalar.get(), "111000"); | 359 SimpleCheckObjectOutput(reporter, bigScalar.get(), "111000"); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 TestCatalog(reporter); | 425 TestCatalog(reporter); |
| 426 | 426 |
| 427 TestObjectRef(reporter); | 427 TestObjectRef(reporter); |
| 428 | 428 |
| 429 TestSubstitute(reporter); | 429 TestSubstitute(reporter); |
| 430 | 430 |
| 431 test_issue1083(); | 431 test_issue1083(); |
| 432 | 432 |
| 433 TestImages(reporter); | 433 TestImages(reporter); |
| 434 } | 434 } |
| 435 | |
| 436 #include "TestClassDef.h" | |
| 437 DEFINE_TESTCLASS("PDFPrimitives", PDFPrimitivesTestClass, TestPDFPrimitives) | |
| OLD | NEW |