| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2010 The Android Open Source Project | 3 * Copyright 2010 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #include "Test.h" | 10 #include "Test.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 return false; | 44 return false; |
| 45 } | 45 } |
| 46 return memcmp(data->bytes() + offset, buffer, len) == 0; | 46 return memcmp(data->bytes() + offset, buffer, len) == 0; |
| 47 } | 47 } |
| 48 | 48 |
| 49 static void CheckObjectOutput(skiatest::Reporter* reporter, SkPDFObject* obj, | 49 static void CheckObjectOutput(skiatest::Reporter* reporter, SkPDFObject* obj, |
| 50 const char* expectedData, size_t expectedSize, | 50 const char* expectedData, size_t expectedSize, |
| 51 bool indirect, bool compression) { | 51 bool indirect, bool compression) { |
| 52 SkPDFDocument::Flags docFlags = (SkPDFDocument::Flags) 0; | 52 SkPDFDocument::Flags docFlags = (SkPDFDocument::Flags) 0; |
| 53 if (!compression) { | 53 if (!compression) { |
| 54 docFlags = SkTBitOr(docFlags, SkPDFDocument::kNoCompression_Flags); | 54 docFlags = SkTBitOr(docFlags, SkPDFDocument::kFavorSpeedOverSize_Flags); |
| 55 } | 55 } |
| 56 SkPDFCatalog catalog(docFlags); | 56 SkPDFCatalog catalog(docFlags); |
| 57 size_t directSize = obj->getOutputSize(&catalog, false); | 57 size_t directSize = obj->getOutputSize(&catalog, false); |
| 58 REPORTER_ASSERT(reporter, directSize == expectedSize); | 58 REPORTER_ASSERT(reporter, directSize == expectedSize); |
| 59 | 59 |
| 60 SkDynamicMemoryWStream buffer; | 60 SkDynamicMemoryWStream buffer; |
| 61 obj->emit(&buffer, &catalog, false); | 61 obj->emit(&buffer, &catalog, false); |
| 62 REPORTER_ASSERT(reporter, directSize == buffer.getOffset()); | 62 REPORTER_ASSERT(reporter, directSize == buffer.getOffset()); |
| 63 REPORTER_ASSERT(reporter, stream_equals(buffer, 0, expectedData, | 63 REPORTER_ASSERT(reporter, stream_equals(buffer, 0, expectedData, |
| 64 directSize)); | 64 directSize)); |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 | 321 |
| 322 TestObjectRef(reporter); | 322 TestObjectRef(reporter); |
| 323 | 323 |
| 324 TestSubstitute(reporter); | 324 TestSubstitute(reporter); |
| 325 | 325 |
| 326 test_issue1083(); | 326 test_issue1083(); |
| 327 } | 327 } |
| 328 | 328 |
| 329 #include "TestClassDef.h" | 329 #include "TestClassDef.h" |
| 330 DEFINE_TESTCLASS("PDFPrimitives", PDFPrimitivesTestClass, TestPDFPrimitives) | 330 DEFINE_TESTCLASS("PDFPrimitives", PDFPrimitivesTestClass, TestPDFPrimitives) |
| OLD | NEW |