| 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 #ifndef SkPDFStream_DEFINED | 10 #ifndef SkPDFStream_DEFINED |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 * @param stream The data part of the stream. Will not take ownership. | 36 * @param stream The data part of the stream. Will not take ownership. |
| 37 */ | 37 */ |
| 38 explicit SkPDFStream(SkStream* stream) { this->setData(stream); } | 38 explicit SkPDFStream(SkStream* stream) { this->setData(stream); } |
| 39 | 39 |
| 40 virtual ~SkPDFStream(); | 40 virtual ~SkPDFStream(); |
| 41 | 41 |
| 42 // The SkPDFObject interface. | 42 // The SkPDFObject interface. |
| 43 void emitObject(SkWStream* stream, | 43 void emitObject(SkWStream* stream, |
| 44 const SkPDFObjNumMap& objNumMap, | 44 const SkPDFObjNumMap& objNumMap, |
| 45 const SkPDFSubstituteMap& substitutes) const override; | 45 const SkPDFSubstituteMap& substitutes) const override; |
| 46 void drop() override; |
| 46 | 47 |
| 47 protected: | 48 protected: |
| 48 /* Create a PDF stream with no data. The setData method must be called to | 49 /* Create a PDF stream with no data. The setData method must be called to |
| 49 * set the data. | 50 * set the data. |
| 50 */ | 51 */ |
| 51 SkPDFStream() {} | 52 SkPDFStream() {} |
| 52 | 53 |
| 53 /** Only call this function once. */ | 54 /** Only call this function once. */ |
| 54 void setData(SkStream* stream); | 55 void setData(SkStream* stream); |
| 55 void setData(SkData* data) { | 56 void setData(SkData* data) { |
| 56 SkMemoryStream memoryStream(data); | 57 SkMemoryStream memoryStream(data); |
| 57 this->setData(&memoryStream); | 58 this->setData(&memoryStream); |
| 58 } | 59 } |
| 59 | 60 |
| 60 private: | 61 private: |
| 61 SkAutoTDelete<SkStreamRewindable> fCompressedData; | 62 SkAutoTDelete<SkStreamRewindable> fCompressedData; |
| 62 | 63 |
| 63 typedef SkPDFDict INHERITED; | 64 typedef SkPDFDict INHERITED; |
| 64 }; | 65 }; |
| 65 | 66 |
| 66 #endif | 67 #endif |
| OLD | NEW |