| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
| 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 "SkDocument.h" | 8 #include "SkDocument.h" |
| 9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkImageGenerator.h" | 10 #include "SkImageGenerator.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 canvas->clear(SK_ColorLTGRAY); | 69 canvas->clear(SK_ColorLTGRAY); |
| 70 | 70 |
| 71 SkBitmap bm1(bitmap_from_data(mandrillData.get())); | 71 SkBitmap bm1(bitmap_from_data(mandrillData.get())); |
| 72 canvas->drawBitmap(bm1, 65.0, 0.0, nullptr); | 72 canvas->drawBitmap(bm1, 65.0, 0.0, nullptr); |
| 73 SkBitmap bm2(bitmap_from_data(cmykData.get())); | 73 SkBitmap bm2(bitmap_from_data(cmykData.get())); |
| 74 canvas->drawBitmap(bm2, 0.0, 512.0, nullptr); | 74 canvas->drawBitmap(bm2, 0.0, 512.0, nullptr); |
| 75 | 75 |
| 76 canvas->flush(); | 76 canvas->flush(); |
| 77 document->endPage(); | 77 document->endPage(); |
| 78 document->close(); | 78 document->close(); |
| 79 SkAutoTUnref<SkData> pdfData(pdf.copyToData()); | 79 sk_sp<SkData> pdfData(pdf.copyToData()); |
| 80 SkASSERT(pdfData); | 80 SkASSERT(pdfData); |
| 81 pdf.reset(); | 81 pdf.reset(); |
| 82 | 82 |
| 83 REPORTER_ASSERT(r, is_subset_of(mandrillData.get(), pdfData.get())); | 83 REPORTER_ASSERT(r, is_subset_of(mandrillData.get(), pdfData.get())); |
| 84 | 84 |
| 85 // This JPEG uses a nonstandard colorspace - it can not be | 85 // This JPEG uses a nonstandard colorspace - it can not be |
| 86 // embedded into the PDF directly. | 86 // embedded into the PDF directly. |
| 87 REPORTER_ASSERT(r, !is_subset_of(cmykData.get(), pdfData.get())); | 87 REPORTER_ASSERT(r, !is_subset_of(cmykData.get(), pdfData.get())); |
| 88 //////////////////////////////////////////////////////////////////////////// | 88 //////////////////////////////////////////////////////////////////////////// |
| 89 pdf.reset(); | 89 pdf.reset(); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 continue; // not applicable | 138 continue; // not applicable |
| 139 } | 139 } |
| 140 if (kTests[i].type != info.fType) { | 140 if (kTests[i].type != info.fType) { |
| 141 ERRORF(r, "%s failed jfif type test", kTests[i].path); | 141 ERRORF(r, "%s failed jfif type test", kTests[i].path); |
| 142 continue; | 142 continue; |
| 143 } | 143 } |
| 144 INFOF(r, "\nJpegIdentification: %s [%d x %d]\n", kTests[i].path, | 144 INFOF(r, "\nJpegIdentification: %s [%d x %d]\n", kTests[i].path, |
| 145 info.fSize.width(), info.fSize.height()); | 145 info.fSize.width(), info.fSize.height()); |
| 146 } | 146 } |
| 147 } | 147 } |
| OLD | NEW |