OLD | NEW |
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 Loading... |
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->writeStream(fData.get(), fData->getLength()); | 67 stream->write(fData->getMemoryBase(), 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 Loading... |
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 } |
OLD | NEW |