| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2010 The Android Open Source Project | 3 * Copyright 2010 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #include "SkPDFFormXObject.h" | 10 #include "SkPDFFormXObject.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 } | 53 } |
| 54 | 54 |
| 55 /** | 55 /** |
| 56 * Common initialization code. | 56 * Common initialization code. |
| 57 * Note that bbox is unreferenced here, so calling code does not need worry. | 57 * Note that bbox is unreferenced here, so calling code does not need worry. |
| 58 */ | 58 */ |
| 59 void SkPDFFormXObject::init(const char* colorSpace, | 59 void SkPDFFormXObject::init(const char* colorSpace, |
| 60 SkPDFDict* resourceDict, SkPDFArray* bbox) { | 60 SkPDFDict* resourceDict, SkPDFArray* bbox) { |
| 61 this->insertName("Type", "XObject"); | 61 this->insertName("Type", "XObject"); |
| 62 this->insertName("Subtype", "Form"); | 62 this->insertName("Subtype", "Form"); |
| 63 this->insertObject("Resources", sk_sp<SkPDFDict>(SkRef(resourceDict))); | 63 this->insertObject("Resources", sk_ref_sp(resourceDict)); |
| 64 this->insertObject("BBox", sk_sp<SkPDFArray>(SkRef(bbox))); | 64 this->insertObject("BBox", sk_ref_sp(bbox)); |
| 65 | 65 |
| 66 // Right now SkPDFFormXObject is only used for saveLayer, which implies | 66 // Right now SkPDFFormXObject is only used for saveLayer, which implies |
| 67 // isolated blending. Do this conditionally if that changes. | 67 // isolated blending. Do this conditionally if that changes. |
| 68 auto group = sk_make_sp<SkPDFDict>("Group"); | 68 auto group = sk_make_sp<SkPDFDict>("Group"); |
| 69 group->insertName("S", "Transparency"); | 69 group->insertName("S", "Transparency"); |
| 70 | 70 |
| 71 if (colorSpace != nullptr) { | 71 if (colorSpace != nullptr) { |
| 72 group->insertName("CS", colorSpace); | 72 group->insertName("CS", colorSpace); |
| 73 } | 73 } |
| 74 group->insertBool("I", true); // Isolated. | 74 group->insertBool("I", true); // Isolated. |
| 75 this->insertObject("Group", std::move(group)); | 75 this->insertObject("Group", std::move(group)); |
| 76 } | 76 } |
| 77 | 77 |
| 78 SkPDFFormXObject::~SkPDFFormXObject() {} | 78 SkPDFFormXObject::~SkPDFFormXObject() {} |
| OLD | NEW |