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

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

Issue 1891873002: SkPDF: PDF/A runtime switch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-04-21 (Thursday) 16:21:36 EDT 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 | « src/core/SkMD5.cpp ('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 #ifdef SK_PDF_GENERATE_PDFA 830 annotation->insertInt("F", 4); // required by ISO 19005
831 annotation->insertInt("F", 4); // required by ISO 19005
832 #endif
833 831
834 auto border = sk_make_sp<SkPDFArray>(); 832 auto border = sk_make_sp<SkPDFArray>();
835 border->reserve(3); 833 border->reserve(3);
836 border->appendInt(0); // Horizontal corner radius. 834 border->appendInt(0); // Horizontal corner radius.
837 border->appendInt(0); // Vertical corner radius. 835 border->appendInt(0); // Vertical corner radius.
838 border->appendInt(0); // Width, 0 = no border. 836 border->appendInt(0); // Width, 0 = no border.
839 annotation->insertObject("Border", std::move(border)); 837 annotation->insertObject("Border", std::move(border));
840 838
841 auto rect = sk_make_sp<SkPDFArray>(); 839 auto rect = sk_make_sp<SkPDFArray>();
842 rect->reserve(4); 840 rect->reserve(4);
(...skipping 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after
2139 if (!pdfimage) { 2137 if (!pdfimage) {
2140 return; 2138 return;
2141 } 2139 }
2142 fDocument->serialize(pdfimage); // serialize images early. 2140 fDocument->serialize(pdfimage); // serialize images early.
2143 fDocument->canon()->addPDFBitmap(key, pdfimage); 2141 fDocument->canon()->addPDFBitmap(key, pdfimage);
2144 } 2142 }
2145 // TODO(halcanary): addXObjectResource() should take a sk_sp<SkPDFObject> 2143 // TODO(halcanary): addXObjectResource() should take a sk_sp<SkPDFObject>
2146 SkPDFUtils::DrawFormXObject(this->addXObjectResource(pdfimage.get()), 2144 SkPDFUtils::DrawFormXObject(this->addXObjectResource(pdfimage.get()),
2147 &content.entry()->fContent); 2145 &content.entry()->fContent);
2148 } 2146 }
OLDNEW
« no previous file with comments | « src/core/SkMD5.cpp ('k') | src/pdf/SkPDFDocument.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698