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

Unified Diff: experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.h

Issue 19793011: (upload draf code for backup) pdfviewer: improve memory, son't allocate extra buffers, and put the … (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 5 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
Index: experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.h
===================================================================
--- experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.h (revision 10235)
+++ experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.h (working copy)
@@ -41,10 +41,11 @@
int pages() const;
SkPdfResourceDictionary* pageResources(int page);
SkRect MediaBox(int page);
- SkPdfNativeTokenizer* tokenizerOfPage(int n);
+ SkPdfNativeTokenizer* tokenizerOfPage(int n, SkPdfAllocator* allocator);
- SkPdfNativeTokenizer* tokenizerOfStream(SkPdfObject* stream);
- SkPdfNativeTokenizer* tokenizerOfBuffer(unsigned char* buffer, size_t len);
+ SkPdfNativeTokenizer* tokenizerOfStream(SkPdfObject* stream, SkPdfAllocator* allocator);
+ SkPdfNativeTokenizer* tokenizerOfBuffer(const unsigned char* buffer, size_t len,
+ SkPdfAllocator* allocator);
size_t objects() const;
SkPdfObject* object(int i);
@@ -55,10 +56,8 @@
SkPdfReal* createReal(double value) const;
SkPdfInteger* createInteger(int value) const;
// the string does not own the char*
- SkPdfString* createString(unsigned char* sz, size_t len) const;
+ SkPdfString* createString(const unsigned char* sz, size_t len) const;
- void drawPage(int page, SkCanvas* canvas);
-
SkPdfObject* resolveReference(const SkPdfObject* ref);
// Reports an approximation of all the memory usage.
@@ -66,8 +65,8 @@
private:
- unsigned char* readCrossReferenceSection(unsigned char* xrefStart, unsigned char* trailerEnd);
- long readTrailer(unsigned char* trailerStart, unsigned char* trailerEnd, bool storeCatalog);
+ const unsigned char* readCrossReferenceSection(const unsigned char* xrefStart, const unsigned char* trailerEnd);
+ long readTrailer(const unsigned char* trailerStart, const unsigned char* trailerEnd, bool storeCatalog);
// TODO(edisonn): updates not supported right now, generation ignored
void addCrossSectionInfo(int id, int generation, int offset, bool isFreed);
@@ -84,7 +83,7 @@
// private fields
SkPdfAllocator* fAllocator;
SkPdfMapper* fMapper;
- unsigned char* fFileContent;
+ const unsigned char* fFileContent;
size_t fContentLength;
const SkPdfObject* fRootCatalogRef;
SkPdfCatalogDictionary* fRootCatalog;
« no previous file with comments | « experimental/PdfViewer/pdf_viewer_main.cpp ('k') | experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698