| OLD | NEW | 
|---|
| 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  Loading... | 
| 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 | 
|  | 831         annotation->insertInt("F", 4);  // required by ISO 19005 | 
|  | 832     #endif | 
| 830 | 833 | 
| 831     auto border = sk_make_sp<SkPDFArray>(); | 834     auto border = sk_make_sp<SkPDFArray>(); | 
| 832     border->reserve(3); | 835     border->reserve(3); | 
| 833     border->appendInt(0);  // Horizontal corner radius. | 836     border->appendInt(0);  // Horizontal corner radius. | 
| 834     border->appendInt(0);  // Vertical corner radius. | 837     border->appendInt(0);  // Vertical corner radius. | 
| 835     border->appendInt(0);  // Width, 0 = no border. | 838     border->appendInt(0);  // Width, 0 = no border. | 
| 836     annotation->insertObject("Border", std::move(border)); | 839     annotation->insertObject("Border", std::move(border)); | 
| 837 | 840 | 
| 838     auto rect = sk_make_sp<SkPDFArray>(); | 841     auto rect = sk_make_sp<SkPDFArray>(); | 
| 839     rect->reserve(4); | 842     rect->reserve(4); | 
| (...skipping 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2136         if (!pdfimage) { | 2139         if (!pdfimage) { | 
| 2137             return; | 2140             return; | 
| 2138         } | 2141         } | 
| 2139         fDocument->serialize(pdfimage);  // serialize images early. | 2142         fDocument->serialize(pdfimage);  // serialize images early. | 
| 2140         fDocument->canon()->addPDFBitmap(key, pdfimage); | 2143         fDocument->canon()->addPDFBitmap(key, pdfimage); | 
| 2141     } | 2144     } | 
| 2142     // TODO(halcanary): addXObjectResource() should take a sk_sp<SkPDFObject> | 2145     // TODO(halcanary): addXObjectResource() should take a sk_sp<SkPDFObject> | 
| 2143     SkPDFUtils::DrawFormXObject(this->addXObjectResource(pdfimage.get()), | 2146     SkPDFUtils::DrawFormXObject(this->addXObjectResource(pdfimage.get()), | 
| 2144                                 &content.entry()->fContent); | 2147                                 &content.entry()->fContent); | 
| 2145 } | 2148 } | 
| OLD | NEW | 
|---|