Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Unified Diff: include/core/SkDocument.h

Issue 1689683002: SkDocument: remove use of SkTArray (part 1/3). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: size_t -> int Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dm/DMSrcSink.cpp ('k') | src/doc/SkDocument_PDF.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkDocument.h
diff --git a/include/core/SkDocument.h b/include/core/SkDocument.h
index 6ee96b9ce3afed5e69eb1e0fcf20d9a72ac71951..9e1de8ae4e7f412c9bd3527c92e548b9b4119494 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));
« no previous file with comments | « dm/DMSrcSink.cpp ('k') | src/doc/SkDocument_PDF.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698