diff options
author | Hal Canary <halcanary@google.com> | 2017-06-28 16:04:20 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-06-30 16:47:14 +0000 |
commit | 80fa7cea93974b0480f35f7a5260ce78ba50420f (patch) | |
tree | efd0f86808985a700b386d94482724538f4f9fba /src/pdf/SkPDFTypes.cpp | |
parent | a062258e76e28ef0ec88ef827ae84a90730393cc (diff) |
SkPDF: simplify SkPDFGraphicState
- Separate graphic state objects for Stroke and Fill.
- SkPDFGraphicState::GetGraphicStateForPaint simplified.
- No more SkPDFGraphicState objects.Simplify SkPDFCanon.
All PDFs render the same. Most PDFs are slightly smaller, especially
those from captured web pages.
Change-Id: Id9605c1d7495645da558d5f378ba585cdc201bba
Reviewed-on: https://skia-review.googlesource.com/21343
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
Diffstat (limited to 'src/pdf/SkPDFTypes.cpp')
-rw-r--r-- | src/pdf/SkPDFTypes.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pdf/SkPDFTypes.cpp b/src/pdf/SkPDFTypes.cpp index 614a6eb2f2..c256ff925d 100644 --- a/src/pdf/SkPDFTypes.cpp +++ b/src/pdf/SkPDFTypes.cpp @@ -384,6 +384,10 @@ void SkPDFDict::addResources(SkPDFObjNumMap* catalog) const { int SkPDFDict::size() const { return fRecords.count(); } +void SkPDFDict::reserve(int n) { + fRecords.reserve(n); +} + void SkPDFDict::insertObjRef(const char key[], sk_sp<SkPDFObject> objSp) { fRecords.emplace_back(Record{SkPDFUnion::Name(key), SkPDFUnion::ObjRef(std::move(objSp))}); } |