diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/pdf/SkPDFDevice.h | 4 | ||||
-rw-r--r-- | src/pdf/SkPDFDocument.cpp | 3 | ||||
-rw-r--r-- | src/pdf/SkPDFDocument.h | 1 |
3 files changed, 7 insertions, 1 deletions
diff --git a/src/pdf/SkPDFDevice.h b/src/pdf/SkPDFDevice.h index a90ea115c1..047841df84 100644 --- a/src/pdf/SkPDFDevice.h +++ b/src/pdf/SkPDFDevice.h @@ -180,6 +180,10 @@ public: return *(fFontGlyphUsage.get()); } +#ifdef SK_DEBUG + SkPDFCanon* getCanon() const { return fCanon; } +#endif // SK_DEBUG + protected: const SkBitmap& onAccessBitmap() SK_OVERRIDE { return fLegacyBitmap; diff --git a/src/pdf/SkPDFDocument.cpp b/src/pdf/SkPDFDocument.cpp index 57eab950ed..6d49e68584 100644 --- a/src/pdf/SkPDFDocument.cpp +++ b/src/pdf/SkPDFDocument.cpp @@ -70,9 +70,12 @@ bool SkPDFDocument::EmitPDF(const SkTDArray<SkPDFDevice*>& pageDevices, if (pageDevices.isEmpty()) { return false; } + SkTDArray<SkPDFPage*> pages; for (int i = 0; i < pageDevices.count(); i++) { SkASSERT(pageDevices[i]); + SkASSERT(i == 0 || + pageDevices[i - 1]->getCanon() == pageDevices[i]->getCanon()); // Reference from new passed to pages. pages.push(SkNEW_ARGS(SkPDFPage, (pageDevices[i]))); } diff --git a/src/pdf/SkPDFDocument.h b/src/pdf/SkPDFDocument.h index f39b59ef47..b63edc12d2 100644 --- a/src/pdf/SkPDFDocument.h +++ b/src/pdf/SkPDFDocument.h @@ -26,7 +26,6 @@ namespace SkPDFDocument { * * @param pageDevices An array of pages, in order. All pages * should be created using the same SkPDFCanon. - * TODO(halcanary): ASSERT this condition. * @param SkWStream The writable output stream to send the PDF to. */ bool EmitPDF(const SkTDArray<SkPDFDevice*>& pageDevices, SkWStream*); |