Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(973)

Unified Diff: src/pdf/SkPDFDocument.cpp

Issue 1037573005: SkPDF: add canon assert before adding code that might break it (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove TODO message Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pdf/SkPDFDocument.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFDocument.cpp
diff --git a/src/pdf/SkPDFDocument.cpp b/src/pdf/SkPDFDocument.cpp
index 57eab950edb987bbe0c2649183b08c17920d8dbf..6d49e68584d92bb387ce3272a45f32ee2f66315c 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])));
}
« no previous file with comments | « src/pdf/SkPDFDocument.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698