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

Side by Side Diff: src/pdf/SkPDFStream.cpp

Issue 23414007: [PDF] Fix printing crashes caused by font streams that don't support getMemoryBase(). (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 3 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 | « no previous file | 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 1
2 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 bool indirect) { 57 bool indirect) {
58 if (indirect) { 58 if (indirect) {
59 return emitIndirectObject(stream, catalog); 59 return emitIndirectObject(stream, catalog);
60 } 60 }
61 if (!this->populate(catalog)) { 61 if (!this->populate(catalog)) {
62 return fSubstitute->emitObject(stream, catalog, indirect); 62 return fSubstitute->emitObject(stream, catalog, indirect);
63 } 63 }
64 64
65 this->INHERITED::emitObject(stream, catalog, false); 65 this->INHERITED::emitObject(stream, catalog, false);
66 stream->writeText(" stream\n"); 66 stream->writeText(" stream\n");
67 stream->write(fData->getMemoryBase(), fData->getLength()); 67 stream->writeStream(fData.get(), fData->getLength());
68 stream->writeText("\nendstream"); 68 stream->writeText("\nendstream");
69 } 69 }
70 70
71 size_t SkPDFStream::getOutputSize(SkPDFCatalog* catalog, bool indirect) { 71 size_t SkPDFStream::getOutputSize(SkPDFCatalog* catalog, bool indirect) {
72 if (indirect) { 72 if (indirect) {
73 return getIndirectOutputSize(catalog); 73 return getIndirectOutputSize(catalog);
74 } 74 }
75 if (!this->populate(catalog)) { 75 if (!this->populate(catalog)) {
76 return fSubstitute->getOutputSize(catalog, indirect); 76 return fSubstitute->getOutputSize(catalog, indirect);
77 } 77 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 } else if (fState == kNoCompression_State && !skip_compression(catalog) && 113 } else if (fState == kNoCompression_State && !skip_compression(catalog) &&
114 SkFlate::HaveFlate()) { 114 SkFlate::HaveFlate()) {
115 if (!fSubstitute.get()) { 115 if (!fSubstitute.get()) {
116 fSubstitute.reset(new SkPDFStream(*this)); 116 fSubstitute.reset(new SkPDFStream(*this));
117 catalog->setSubstitute(this, fSubstitute.get()); 117 catalog->setSubstitute(this, fSubstitute.get());
118 } 118 }
119 return false; 119 return false;
120 } 120 }
121 return true; 121 return true;
122 } 122 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698