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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 virtual size_t getOutputSize(SkPDFCatalog* catalog, bool indirect); | 44 virtual size_t getOutputSize(SkPDFCatalog* catalog, bool indirect); |
45 | 45 |
46 protected: | 46 protected: |
47 /* Create a PDF stream with no data. The setData method must be called to | 47 /* Create a PDF stream with no data. The setData method must be called to |
48 * set the data. | 48 * set the data. |
49 */ | 49 */ |
50 SkPDFStream(); | 50 SkPDFStream(); |
51 | 51 |
52 void setData(SkStream* stream); | 52 void setData(SkStream* stream); |
53 | 53 |
| 54 virtual void trasferPDFObjecsOwnership(SkTDArray<SkPDFObject*>* list) { |
| 55 list->push(fSubstitute.detach()); |
| 56 |
| 57 INHERITED::trasferPDFObjecsOwnership(list); |
| 58 } |
| 59 |
54 private: | 60 private: |
55 enum State { | 61 enum State { |
56 kUnused_State, //!< The stream hasn't been requested yet. | 62 kUnused_State, //!< The stream hasn't been requested yet. |
57 kNoCompression_State, //!< The stream's been requested in an | 63 kNoCompression_State, //!< The stream's been requested in an |
58 // uncompressed form. | 64 // uncompressed form. |
59 kCompressed_State, //!< The stream's already been compressed. | 65 kCompressed_State, //!< The stream's already been compressed. |
60 }; | 66 }; |
61 // Indicates what form (or if) the stream has been requested. | 67 // Indicates what form (or if) the stream has been requested. |
62 State fState; | 68 State fState; |
63 | 69 |
64 // TODO(vandebo): Use SkData (after removing deprecated constructor). | 70 // TODO(vandebo): Use SkData (after removing deprecated constructor). |
65 SkAutoTUnref<SkStream> fData; | 71 SkAutoTUnref<SkStream> fData; |
66 SkAutoTUnref<SkPDFStream> fSubstitute; | 72 SkAutoTUnref<SkPDFStream> fSubstitute; |
67 | 73 |
68 typedef SkPDFDict INHERITED; | 74 typedef SkPDFDict INHERITED; |
69 | 75 |
70 // Populate the stream dictionary. This method returns false if | 76 // Populate the stream dictionary. This method returns false if |
71 // fSubstitute should be used. | 77 // fSubstitute should be used. |
72 bool populate(SkPDFCatalog* catalog); | 78 bool populate(SkPDFCatalog* catalog); |
73 }; | 79 }; |
74 | 80 |
75 #endif | 81 #endif |
OLD | NEW |