diff options
author | 2016-02-11 07:59:59 -0800 | |
---|---|---|
committer | 2016-02-11 07:59:59 -0800 | |
commit | 7001576c7160e20c9c9db2fbe947408989027d66 (patch) | |
tree | f349b8744cc86d24128c7a0c79b0bb77bb5d0691 /include/core/SkDocument.h | |
parent | db6a254bdcf6884db172f716966d7787e0d6f264 (diff) |
SkDocument: remove use of SkTArray (part 1/3).
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1689683002
Review URL: https://codereview.chromium.org/1689683002
Diffstat (limited to 'include/core/SkDocument.h')
-rw-r--r-- | include/core/SkDocument.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/include/core/SkDocument.h b/include/core/SkDocument.h index 6ee96b9ce3..9e1de8ae4e 100644 --- a/include/core/SkDocument.h +++ b/include/core/SkDocument.h @@ -131,7 +131,7 @@ public: * nullptr. For example: * * SkDocument* make_doc(SkWStream* output) { - * SkTArray<SkDocument::Attribute> info; + * std::vector<SkDocument::Attribute> info; * info.emplace_back(SkString("Title"), SkString("...")); * info.emplace_back(SkString("Author"), SkString("...")); * info.emplace_back(SkString("Subject"), SkString("...")); @@ -140,7 +140,7 @@ public: * SkTime::DateTime now; * SkTime::GetDateTime(&now); * SkDocument* doc = SkDocument::CreatePDF(output); - * doc->setMetadata(info, &now, &now); + * doc->setMetadata(&info[0], (int)info.size(), &now, &now); * return doc; * } */ @@ -148,10 +148,18 @@ public: SkString fKey, fValue; Attribute(const SkString& k, const SkString& v) : fKey(k), fValue(v) {} }; - virtual void setMetadata(const SkTArray<SkDocument::Attribute>&, + virtual void setMetadata(const SkDocument::Attribute[], + int /* attributeCount */, const SkTime::DateTime* /* creationDate */, const SkTime::DateTime* /* modifiedDate */) {} + // This version is deprecated. + void setMetadata(const SkTArray<SkDocument::Attribute>& att, + const SkTime::DateTime* creation, + const SkTime::DateTime* modified) { + this->setMetadata(&att[0], att.count(), creation, modified); + } + protected: SkDocument(SkWStream*, void (*)(SkWStream*, bool aborted)); |