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

Side by Side Diff: src/pdf/SkPDFDevice.cpp

Issue 1892203002: Revert of SkPDF: PDF/A runtime switch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « gyp/pdf.gypi ('k') | src/pdf/SkPDFDocument.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkPDFDevice.h" 8 #include "SkPDFDevice.h"
9 9
10 #include "SkAnnotationKeys.h" 10 #include "SkAnnotationKeys.h"
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 } 820 }
821 break; 821 break;
822 default: 822 default:
823 SkASSERT(false); 823 SkASSERT(false);
824 } 824 }
825 } 825 }
826 826
827 static sk_sp<SkPDFDict> create_link_annotation(const SkRect& translatedRect) { 827 static sk_sp<SkPDFDict> create_link_annotation(const SkRect& translatedRect) {
828 auto annotation = sk_make_sp<SkPDFDict>("Annot"); 828 auto annotation = sk_make_sp<SkPDFDict>("Annot");
829 annotation->insertName("Subtype", "Link"); 829 annotation->insertName("Subtype", "Link");
830 annotation->insertInt("F", 4); // required by ISO 19005 830 #ifdef SK_PDF_GENERATE_PDFA
831 annotation->insertInt("F", 4); // required by ISO 19005
832 #endif
831 833
832 auto border = sk_make_sp<SkPDFArray>(); 834 auto border = sk_make_sp<SkPDFArray>();
833 border->reserve(3); 835 border->reserve(3);
834 border->appendInt(0); // Horizontal corner radius. 836 border->appendInt(0); // Horizontal corner radius.
835 border->appendInt(0); // Vertical corner radius. 837 border->appendInt(0); // Vertical corner radius.
836 border->appendInt(0); // Width, 0 = no border. 838 border->appendInt(0); // Width, 0 = no border.
837 annotation->insertObject("Border", std::move(border)); 839 annotation->insertObject("Border", std::move(border));
838 840
839 auto rect = sk_make_sp<SkPDFArray>(); 841 auto rect = sk_make_sp<SkPDFArray>();
840 rect->reserve(4); 842 rect->reserve(4);
(...skipping 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after
2137 if (!pdfimage) { 2139 if (!pdfimage) {
2138 return; 2140 return;
2139 } 2141 }
2140 fDocument->serialize(pdfimage); // serialize images early. 2142 fDocument->serialize(pdfimage); // serialize images early.
2141 fDocument->canon()->addPDFBitmap(key, pdfimage); 2143 fDocument->canon()->addPDFBitmap(key, pdfimage);
2142 } 2144 }
2143 // TODO(halcanary): addXObjectResource() should take a sk_sp<SkPDFObject> 2145 // TODO(halcanary): addXObjectResource() should take a sk_sp<SkPDFObject>
2144 SkPDFUtils::DrawFormXObject(this->addXObjectResource(pdfimage.get()), 2146 SkPDFUtils::DrawFormXObject(this->addXObjectResource(pdfimage.get()),
2145 &content.entry()->fContent); 2147 &content.entry()->fContent);
2146 } 2148 }
OLDNEW
« no previous file with comments | « gyp/pdf.gypi ('k') | src/pdf/SkPDFDocument.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698