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

Unified Diff: src/pdf/SkPDFMetadata.cpp

Issue 1823753002: SkPDF: record milestone version in Producer string (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: include Created 4 years, 9 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 | « include/core/SkMilestone.h ('k') | tests/PDFMetadataAttributeTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFMetadata.cpp
diff --git a/src/pdf/SkPDFMetadata.cpp b/src/pdf/SkPDFMetadata.cpp
index 118cda39fe9fb53b3cb91c6f20b7c08bc56e5d06..addec4f01db57af70114abcd021bfdc952b25cbd 100644
--- a/src/pdf/SkPDFMetadata.cpp
+++ b/src/pdf/SkPDFMetadata.cpp
@@ -5,6 +5,7 @@
* found in the LICENSE file.
*/
+#include "SkMilestone.h"
#include "SkPDFMetadata.h"
#include "SkPDFTypes.h"
#include <utility>
@@ -27,6 +28,9 @@ static SkString pdf_date(const SkTime::DateTime& dt) {
timeZoneMinutes);
}
+#define SKPDF_STRING(X) SKPDF_STRING_IMPL(X)
+#define SKPDF_STRING_IMPL(X) #X
+
SkPDFObject* SkPDFMetadata::createDocumentInformationDict() const {
auto dict = sk_make_sp<SkPDFDict>();
static const char* keys[] = {
@@ -38,7 +42,7 @@ SkPDFObject* SkPDFMetadata::createDocumentInformationDict() const {
}
}
}
- dict->insertString("Producer", "Skia/PDF");
+ dict->insertString("Producer", "Skia/PDF m" SKPDF_STRING(SK_MILESTONE));
if (fCreation) {
dict->insertString("CreationDate", pdf_date(*fCreation.get()));
}
@@ -48,6 +52,9 @@ SkPDFObject* SkPDFMetadata::createDocumentInformationDict() const {
return dict.release();
}
+#undef SKPDF_STRING
+#undef SKPDF_STRING_IMPL
+
#ifdef SK_PDF_GENERATE_PDFA
SkPDFMetadata::UUID SkPDFMetadata::uuid() const {
// The main requirement is for the UUID to be unique; the exact
« no previous file with comments | « include/core/SkMilestone.h ('k') | tests/PDFMetadataAttributeTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698