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

Unified Diff: experimental/PdfViewer/SkPdfFont.cpp

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
« no previous file with comments | « experimental/PdfViewer/SkPdfConfig.h ('k') | experimental/PdfViewer/SkPdfRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/PdfViewer/SkPdfFont.cpp
===================================================================
--- experimental/PdfViewer/SkPdfFont.cpp (revision 10235)
+++ experimental/PdfViewer/SkPdfFont.cpp (working copy)
@@ -164,12 +164,12 @@
}
}
- unsigned char* uncompressedStream = NULL;
+ const unsigned char* uncompressedStream = NULL;
size_t uncompressedStreamLength = 0;
// TODO(edisonn): report warning to be used in testing.
if (!pdfStream ||
- !pdfStream->GetFilteredStreamRef(&uncompressedStream, &uncompressedStreamLength, doc->allocator()) ||
+ !pdfStream->GetFilteredStreamRef(&uncompressedStream, &uncompressedStreamLength) ||
!uncompressedStream ||
!uncompressedStreamLength) {
return NULL;
@@ -321,7 +321,9 @@
fCMapEncodingFlag = NULL;
if (stream) {
- SkPdfNativeTokenizer* tokenizer = fParsed->tokenizerOfStream(stream);
+ // Since font will be cached, the font has to sit in the per doc allocator, not to be
+ // freed after the page is done drawing.
+ SkPdfNativeTokenizer* tokenizer = fParsed->tokenizerOfStream(stream, parsed->allocator());
PdfToken token;
fCMapEncoding = new unsigned short[256 * 256];
« no previous file with comments | « experimental/PdfViewer/SkPdfConfig.h ('k') | experimental/PdfViewer/SkPdfRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698