OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 The Android Open Source Project | 2 * Copyright 2010 The Android Open Source Project |
3 * | 3 * |
4 * 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 |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "Test.h" | 8 #include "Test.h" |
9 #include "TestClassDef.h" | 9 #include "TestClassDef.h" |
10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 doc.emitPDF(&stream); | 346 doc.emitPDF(&stream); |
347 } | 347 } |
348 | 348 |
349 DEF_TEST(PDFPrimitives, 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) | |
357 SkAutoTUnref<SkPDFScalar> bigScalar(new SkPDFScalar(110999.75f)); | 356 SkAutoTUnref<SkPDFScalar> bigScalar(new SkPDFScalar(110999.75f)); |
358 #if !defined(SK_ALLOW_LARGE_PDF_SCALARS) | 357 #if !defined(SK_ALLOW_LARGE_PDF_SCALARS) |
359 SimpleCheckObjectOutput(reporter, bigScalar.get(), "111000"); | 358 SimpleCheckObjectOutput(reporter, bigScalar.get(), "111000"); |
360 #else | 359 #else |
361 SimpleCheckObjectOutput(reporter, bigScalar.get(), "110999.75"); | 360 SimpleCheckObjectOutput(reporter, bigScalar.get(), "110999.75"); |
362 | 361 |
363 SkAutoTUnref<SkPDFScalar> biggerScalar(new SkPDFScalar(50000000.1)); | 362 SkAutoTUnref<SkPDFScalar> biggerScalar(new SkPDFScalar(50000000.1)); |
364 SimpleCheckObjectOutput(reporter, biggerScalar.get(), "50000000"); | 363 SimpleCheckObjectOutput(reporter, biggerScalar.get(), "50000000"); |
365 | 364 |
366 SkAutoTUnref<SkPDFScalar> smallestScalar(new SkPDFScalar(1.0/65536)); | 365 SkAutoTUnref<SkPDFScalar> smallestScalar(new SkPDFScalar(1.0/65536)); |
367 SimpleCheckObjectOutput(reporter, smallestScalar.get(), "0.00001526"); | 366 SimpleCheckObjectOutput(reporter, smallestScalar.get(), "0.00001526"); |
368 #endif | 367 #endif |
369 #endif | |
370 | 368 |
371 SkAutoTUnref<SkPDFString> stringSimple( | 369 SkAutoTUnref<SkPDFString> stringSimple( |
372 new SkPDFString("test ) string ( foo")); | 370 new SkPDFString("test ) string ( foo")); |
373 SimpleCheckObjectOutput(reporter, stringSimple.get(), | 371 SimpleCheckObjectOutput(reporter, stringSimple.get(), |
374 "(test \\) string \\( foo)"); | 372 "(test \\) string \\( foo)"); |
375 SkAutoTUnref<SkPDFString> stringComplex( | 373 SkAutoTUnref<SkPDFString> stringComplex( |
376 new SkPDFString("\ttest ) string ( foo")); | 374 new SkPDFString("\ttest ) string ( foo")); |
377 SimpleCheckObjectOutput(reporter, stringComplex.get(), | 375 SimpleCheckObjectOutput(reporter, stringComplex.get(), |
378 "<0974657374202920737472696E67202820666F6F>"); | 376 "<0974657374202920737472696E67202820666F6F>"); |
379 | 377 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 TestCatalog(reporter); | 423 TestCatalog(reporter); |
426 | 424 |
427 TestObjectRef(reporter); | 425 TestObjectRef(reporter); |
428 | 426 |
429 TestSubstitute(reporter); | 427 TestSubstitute(reporter); |
430 | 428 |
431 test_issue1083(); | 429 test_issue1083(); |
432 | 430 |
433 TestImages(reporter); | 431 TestImages(reporter); |
434 } | 432 } |
OLD | NEW |