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 17 matching lines...) Expand all Loading... |
28 SK_DECLARE_INST_COUNT(SkPDFStream) | 28 SK_DECLARE_INST_COUNT(SkPDFStream) |
29 public: | 29 public: |
30 /** Create a PDF stream. A Length entry is automatically added to the | 30 /** Create a PDF stream. A Length entry is automatically added to the |
31 * stream dictionary. The stream may be retained (stream->ref() may be | 31 * stream dictionary. The stream may be retained (stream->ref() may be |
32 * called) so its contents must not be changed after calling this. | 32 * called) so its contents must not be changed after calling this. |
33 * @param data The data part of the stream. | 33 * @param data The data part of the stream. |
34 */ | 34 */ |
35 explicit SkPDFStream(SkData* data); | 35 explicit SkPDFStream(SkData* data); |
36 /** Deprecated constructor. */ | 36 /** Deprecated constructor. */ |
37 explicit SkPDFStream(SkStream* stream); | 37 explicit SkPDFStream(SkStream* stream); |
38 /** Create a PDF stream with the same content and dictionary entries | 38 |
39 * as the passed one. | |
40 */ | |
41 explicit SkPDFStream(const SkPDFStream& pdfStream); | |
42 virtual ~SkPDFStream(); | 39 virtual ~SkPDFStream(); |
43 | 40 |
44 // The SkPDFObject interface. | 41 // The SkPDFObject interface. |
45 virtual void emitObject(SkWStream* stream, SkPDFCatalog* catalog, | 42 virtual void emitObject(SkWStream* stream, SkPDFCatalog* catalog, |
46 bool indirect); | 43 bool indirect); |
47 virtual size_t getOutputSize(SkPDFCatalog* catalog, bool indirect); | 44 virtual size_t getOutputSize(SkPDFCatalog* catalog, bool indirect); |
48 | 45 |
49 protected: | 46 protected: |
50 enum State { | 47 enum State { |
51 kUnused_State, //!< The stream hasn't been requested yet. | 48 kUnused_State, //!< The stream hasn't been requested yet. |
52 kNoCompression_State, //!< The stream's been requested in an | 49 kNoCompression_State, //!< The stream's been requested in an |
53 // uncompressed form. | 50 // uncompressed form. |
54 kCompressed_State, //!< The stream's already been compressed. | 51 kCompressed_State, //!< The stream's already been compressed. |
55 }; | 52 }; |
56 | 53 |
| 54 /** Create a PDF stream with the same content and dictionary entries |
| 55 * as the passed one. |
| 56 */ |
| 57 explicit SkPDFStream(const SkPDFStream& pdfStream); |
| 58 |
57 /* Create a PDF stream with no data. The setData method must be called to | 59 /* Create a PDF stream with no data. The setData method must be called to |
58 * set the data. | 60 * set the data. |
59 */ | 61 */ |
60 SkPDFStream(); | 62 SkPDFStream(); |
61 | 63 |
62 // Populate the stream dictionary. This method returns false if | 64 // Populate the stream dictionary. This method returns false if |
63 // fSubstitute should be used. | 65 // fSubstitute should be used. |
64 virtual bool populate(SkPDFCatalog* catalog); | 66 virtual bool populate(SkPDFCatalog* catalog); |
65 | 67 |
66 void setSubstitute(SkPDFStream* stream) { | 68 void setSubstitute(SkPDFStream* stream) { |
(...skipping 24 matching lines...) Expand all Loading... |
91 State fState; | 93 State fState; |
92 | 94 |
93 // TODO(vandebo): Use SkData (after removing deprecated constructor). | 95 // TODO(vandebo): Use SkData (after removing deprecated constructor). |
94 SkAutoTUnref<SkStream> fData; | 96 SkAutoTUnref<SkStream> fData; |
95 SkAutoTUnref<SkPDFStream> fSubstitute; | 97 SkAutoTUnref<SkPDFStream> fSubstitute; |
96 | 98 |
97 typedef SkPDFDict INHERITED; | 99 typedef SkPDFDict INHERITED; |
98 }; | 100 }; |
99 | 101 |
100 #endif | 102 #endif |
OLD | NEW |