SkPDF: Hold page objects, not SkPDFDevices.
authorhalcanary <halcanary@google.com>
Wed, 23 Mar 2016 13:26:31 +0000 (06:26 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 23 Mar 2016 13:26:32 +0000 (06:26 -0700)
commitcc77c12293d1685f5e83d768b30ca9157af1576d
tree51ab29ac484cfcd035a19d938028a06bcd0b8aee
parent0a291c7b7eea1807bd58bdaa60c258fd0ebeb257
SkPDF: Hold page objects, not SkPDFDevices.

Page Contents:
    serialize early, at endPage()

SkPDFDocument:
   Rather than holding all SkPDFDevices until onClose(), store
   fGlyphUseage and array of pages objects.

perform_font_subsetting function removed:
   First half moved to onEndPage.
   Second half moved to onClose.

create_pdf_page function removed:
   Merged into onEndPage.

generate_page_tree:
   Refactored to use SkTArray<sk_sp<T>> over SkTDArray<T*>.
   (the former is explicit about ownership, the latter is unclear.)

   No longer populates a structure of objects to be dumped,
   unnecessary since dump is always called after serialization.
   Takes ownership of fPages and returns root of tree-ified version.
   Less reference churn.

SkPDFGlyphSetMap:
    use new-style iterator.

BUG=skia:5087
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1823683005

Review URL: https://codereview.chromium.org/1823683005
src/pdf/SkPDFDocument.cpp
src/pdf/SkPDFDocument.h
src/pdf/SkPDFFont.cpp
src/pdf/SkPDFFont.h