OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 #ifndef SkPDFDocument_DEFINED | 7 #ifndef SkPDFDocument_DEFINED |
8 #define SkPDFDocument_DEFINED | 8 #define SkPDFDocument_DEFINED |
9 | 9 |
10 #include "SkDocument.h" | 10 #include "SkDocument.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 // keep similar functionality together. | 24 // keep similar functionality together. |
25 struct SkPDFObjectSerializer : SkNoncopyable { | 25 struct SkPDFObjectSerializer : SkNoncopyable { |
26 SkPDFObjNumMap fObjNumMap; | 26 SkPDFObjNumMap fObjNumMap; |
27 SkPDFSubstituteMap fSubstituteMap; | 27 SkPDFSubstituteMap fSubstituteMap; |
28 SkTDArray<int32_t> fOffsets; | 28 SkTDArray<int32_t> fOffsets; |
29 sk_sp<SkPDFObject> fInfoDict; | 29 sk_sp<SkPDFObject> fInfoDict; |
30 size_t fBaseOffset; | 30 size_t fBaseOffset; |
31 int32_t fNextToBeSerialized; // index in fObjNumMap | 31 int32_t fNextToBeSerialized; // index in fObjNumMap |
32 | 32 |
33 SkPDFObjectSerializer(); | 33 SkPDFObjectSerializer(); |
| 34 ~SkPDFObjectSerializer(); |
34 void addObjectRecursively(const sk_sp<SkPDFObject>&); | 35 void addObjectRecursively(const sk_sp<SkPDFObject>&); |
35 void serializeHeader(SkWStream*, const SkPDFMetadata&); | 36 void serializeHeader(SkWStream*, const SkPDFMetadata&); |
36 void serializeObjects(SkWStream*); | 37 void serializeObjects(SkWStream*); |
37 void serializeFooter(SkWStream*, const sk_sp<SkPDFObject>, sk_sp<SkPDFObject
>); | 38 void serializeFooter(SkWStream*, const sk_sp<SkPDFObject>, sk_sp<SkPDFObject
>); |
38 int32_t offset(SkWStream*); | 39 int32_t offset(SkWStream*); |
39 }; | 40 }; |
40 | 41 |
41 /** Concrete implementation of SkDocument that creates PDF files. This | 42 /** Concrete implementation of SkDocument that creates PDF files. This |
42 class does not produced linearized or optimized PDFs; instead it | 43 class does not produced linearized or optimized PDFs; instead it |
43 it attempts to use a minimum amount of RAM. */ | 44 it attempts to use a minimum amount of RAM. */ |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 SkPDFGlyphSetMap fGlyphUsage; | 77 SkPDFGlyphSetMap fGlyphUsage; |
77 SkTArray<sk_sp<SkPDFDict>> fPages; | 78 SkTArray<sk_sp<SkPDFDict>> fPages; |
78 sk_sp<SkPDFDict> fDests; | 79 sk_sp<SkPDFDict> fDests; |
79 sk_sp<SkPDFDevice> fPageDevice; | 80 sk_sp<SkPDFDevice> fPageDevice; |
80 sk_sp<SkCanvas> fCanvas; | 81 sk_sp<SkCanvas> fCanvas; |
81 SkScalar fRasterDpi; | 82 SkScalar fRasterDpi; |
82 SkPDFMetadata fMetadata; | 83 SkPDFMetadata fMetadata; |
83 }; | 84 }; |
84 | 85 |
85 #endif // SkPDFDocument_DEFINED | 86 #endif // SkPDFDocument_DEFINED |
OLD | NEW |