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

Side by Side Diff: experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.cpp

Issue 21252003: pdfviewer: more prerequired work to have examples working for transparency work items. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « experimental/PdfViewer/generate_code.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include "SkNativeParsedPDF.h" 1 #include "SkNativeParsedPDF.h"
2 #include "SkPdfNativeTokenizer.h" 2 #include "SkPdfNativeTokenizer.h"
3 #include "SkPdfBasics.h" 3 #include "SkPdfBasics.h"
4 #include "SkPdfObject.h" 4 #include "SkPdfObject.h"
5 5
6 #include <stdio.h> 6 #include <stdio.h>
7 #include <string.h> 7 #include <string.h>
8 #include <sys/types.h> 8 #include <sys/types.h>
9 #include <sys/stat.h> 9 #include <sys/stat.h>
10 10
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 116
117 if (strcmp((char*)xrefstartKeywordLine, "startxref") != 0) { 117 if (strcmp((char*)xrefstartKeywordLine, "startxref") != 0) {
118 // TODO(edisonn): report/issue 118 // TODO(edisonn): report/issue
119 } 119 }
120 120
121 long xrefByteOffset = atol((const char*)xrefByteOffsetLine); 121 long xrefByteOffset = atol((const char*)xrefByteOffsetLine);
122 122
123 bool storeCatalog = true; 123 bool storeCatalog = true;
124 while (xrefByteOffset >= 0) { 124 while (xrefByteOffset >= 0) {
125 const unsigned char* trailerStart = readCrossReferenceSection(fFileConte nt + xrefByteOffset, xrefstartKeywordLine); 125 const unsigned char* trailerStart = readCrossReferenceSection(fFileConte nt + xrefByteOffset, xrefstartKeywordLine);
126 readTrailer(trailerStart, xrefstartKeywordLine, storeCatalog, &xrefByteO ffset, false); 126 xrefByteOffset = -1;
127 storeCatalog = false; 127 if (trailerStart < xrefstartKeywordLine) {
128 readTrailer(trailerStart, xrefstartKeywordLine, storeCatalog, &xrefB yteOffset, false);
129 storeCatalog = false;
130 }
128 } 131 }
129 132
130 // TODO(edisonn): warn/error expect fObjects[fRefCatalogId].fGeneration == f RefCatalogGeneration 133 // TODO(edisonn): warn/error expect fObjects[fRefCatalogId].fGeneration == f RefCatalogGeneration
131 // TODO(edisonn): security, verify that SkPdfCatalogDictionary is indeed usi ng mapper 134 // TODO(edisonn): security, verify that SkPdfCatalogDictionary is indeed usi ng mapper
132 // load catalog 135 // load catalog
133 136
134 if (fRootCatalogRef) { 137 if (fRootCatalogRef) {
135 fRootCatalog = (SkPdfCatalogDictionary*)resolveReference(fRootCatalogRef ); 138 fRootCatalog = (SkPdfCatalogDictionary*)resolveReference(fRootCatalogRef );
136 if (fRootCatalog->isDictionary() && fRootCatalog->valid()) { 139 if (fRootCatalog->isDictionary() && fRootCatalog->valid()) {
137 SkPdfPageTreeNodeDictionary* tree = fRootCatalog->Pages(this); 140 SkPdfPageTreeNodeDictionary* tree = fRootCatalog->Pages(this);
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 return (SkPdfObject*)ref; 540 return (SkPdfObject*)ref;
538 } 541 }
539 542
540 size_t SkNativeParsedPDF::bytesUsed() const { 543 size_t SkNativeParsedPDF::bytesUsed() const {
541 return fAllocator->bytesUsed() + 544 return fAllocator->bytesUsed() +
542 fContentLength + 545 fContentLength +
543 fObjects.count() * sizeof(PublicObjectEntry) + 546 fObjects.count() * sizeof(PublicObjectEntry) +
544 fPages.count() * sizeof(SkPdfPageObjectDictionary*) + 547 fPages.count() * sizeof(SkPdfPageObjectDictionary*) +
545 sizeof(*this); 548 sizeof(*this);
546 } 549 }
OLDNEW
« no previous file with comments | « experimental/PdfViewer/generate_code.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698