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

Unified Diff: experimental/PdfViewer/pdfparser/native/SkPdfNativeTokenizer.cpp

Issue 80463005: Separate and update PDF_DIFF_TRACE_IN_PNG (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 7 years 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
Index: experimental/PdfViewer/pdfparser/native/SkPdfNativeTokenizer.cpp
diff --git a/experimental/PdfViewer/pdfparser/native/SkPdfNativeTokenizer.cpp b/experimental/PdfViewer/pdfparser/native/SkPdfNativeTokenizer.cpp
index 79935bc954b9f800df6d8ffcc1a07ad3a4cb598a..5dfe14e5fcbe588c7bc1800c78e963fcf16e63d4 100644
--- a/experimental/PdfViewer/pdfparser/native/SkPdfNativeTokenizer.cpp
+++ b/experimental/PdfViewer/pdfparser/native/SkPdfNativeTokenizer.cpp
@@ -6,6 +6,7 @@
*/
#include "SkPdfConfig.h"
+#include "SkPdfDiffEncoder.h"
#include "SkPdfNativeObject.h"
#include "SkPdfNativeTokenizer.h"
#include "SkPdfUtils.h"
@@ -940,6 +941,7 @@ bool SkPdfNativeTokenizer::readTokenCore(PdfToken* token) {
fUncompressedStream = skipPdfWhiteSpaces(fUncompressedStream, fUncompressedStreamEnd);
if (fUncompressedStream >= fUncompressedStreamEnd) {
+ fEmpty = true;
return false;
}
@@ -985,26 +987,33 @@ void SkPdfNativeTokenizer::PutBack(PdfToken token) {
#endif
}
-bool SkPdfNativeTokenizer::readToken(PdfToken* token) {
+bool SkPdfNativeTokenizer::readToken(PdfToken* token, bool writeDiff) {
if (fHasPutBack) {
*token = fPutBack;
fHasPutBack = false;
#ifdef PDF_TRACE_READ_TOKEN
- printf("READ_BACK %s %s\n", token->fType == kKeyword_TokenType ? "Keyword" : "Object",
- token->fKeyword ? SkString(token->fKeyword, token->fKeywordLength).c_str() :
- token->fObject->toString().c_str());
+ printf("READ_BACK %s %s\n", token->fType == kKeyword_TokenType ? "Keyword" : "Object",
+ token->fKeyword ? SkString(token->fKeyword, token->fKeywordLength).c_str() :
+ token->fObject->toString().c_str());
#endif
+ if (writeDiff) {
+ SkPdfDiffEncoder::WriteToFile(token);
+ }
return true;
}
if (fEmpty) {
#ifdef PDF_TRACE_READ_TOKEN
- printf("EMPTY TOKENIZER\n");
+ printf("EMPTY TOKENIZER\n");
#endif
return false;
}
- return readTokenCore(token);
+ const bool result = readTokenCore(token);
+ if (result && writeDiff) {
+ SkPdfDiffEncoder::WriteToFile(token);
+ }
+ return result;
}
#define DECLARE_PDF_NAME(longName) SkPdfName longName((char*)#longName)
« no previous file with comments | « experimental/PdfViewer/pdfparser/native/SkPdfNativeTokenizer.h ('k') | experimental/PdfViewer/src/SkPdfContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698