aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf/SkPDFDocument.h
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2016-08-18 14:22:52 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-18 14:22:52 -0700
commit530032a18e373ee673ae96fdbfa1fae6292f8f08 (patch)
tree5edb6e14ca33bf75d3d7b1df73da47be56337b3a /src/pdf/SkPDFDocument.h
parent9637ea91b88ff8f8e95325bfc41417ffc4d5ee0b (diff)
SkPDF: in-place font subsetting
Motivation: gross code simplification, also no bitset lookups at draw time. SkPDFFont owns its glyph useage bitset. SkPDFSubstituteMap goes away. SkPDFObject interface is simplified. SkPDFDocument tracks font usage (as hash set), not glyph usage. SkPDFFont gets a simpler constructor. SkPDFFont has first and last glyph set in constructor, not adjusted later. SkPDFFont implementations are simplified. SkPDFGlyphSet is replaced with simple SkBitSet. SkPDFFont sizes its SkBitSets based on glyph count. SkPDFGlyphSetMap goes away. SkBitSet is now non-copyable. SkBitSet now how utility methods to match old SkPDFGlyphSet. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2253283004 CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Win-MSVC-GCE-CPU-AVX2-x86_64-Release-GDI-Trybot,Test-Win-MSVC-GCE-CPU-AVX2-x86_64-Debug-GDI-Trybot Review-Url: https://codereview.chromium.org/2253283004
Diffstat (limited to 'src/pdf/SkPDFDocument.h')
-rw-r--r--src/pdf/SkPDFDocument.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/pdf/SkPDFDocument.h b/src/pdf/SkPDFDocument.h
index 86562fe42e..5221dd2728 100644
--- a/src/pdf/SkPDFDocument.h
+++ b/src/pdf/SkPDFDocument.h
@@ -25,7 +25,6 @@ sk_sp<SkDocument> SkPDFMakeDocument(SkWStream* stream,
// keep similar functionality together.
struct SkPDFObjectSerializer : SkNoncopyable {
SkPDFObjNumMap fObjNumMap;
- SkPDFSubstituteMap fSubstituteMap;
SkTDArray<int32_t> fOffsets;
sk_sp<SkPDFObject> fInfoDict;
size_t fBaseOffset;
@@ -70,18 +69,16 @@ public:
It might go without saying that objects should not be changed
after calling serialize, since those changes will be too late.
- The same goes for changes to the SkPDFSubstituteMap that effect
- the object or its dependencies.
*/
void serialize(const sk_sp<SkPDFObject>&);
SkPDFCanon* canon() { return &fCanon; }
- SkPDFGlyphSetMap* getGlyphUsage() { return &fGlyphUsage; }
+ void registerFont(SkPDFFont* f) { fFonts.add(f); }
private:
SkPDFObjectSerializer fObjectSerializer;
SkPDFCanon fCanon;
- SkPDFGlyphSetMap fGlyphUsage;
SkTArray<sk_sp<SkPDFDict>> fPages;
+ SkTHashSet<SkPDFFont*> fFonts;
sk_sp<SkPDFDict> fDests;
sk_sp<SkPDFDevice> fPageDevice;
sk_sp<SkCanvas> fCanvas;
@@ -90,6 +87,8 @@ private:
SkScalar fRasterDpi;
SkDocument::PDFMetadata fMetadata;
bool fPDFA;
+
+ void reset();
};
#endif // SkPDFDocument_DEFINED