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

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

Issue 1777923002: SkPDF: use sk_ref_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « src/pdf/SkPDFDevice.cpp ('k') | src/pdf/SkPDFFormXObject.cpp » ('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 <ctype.h> 8 #include <ctype.h>
9 9
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 1185 matching lines...) Expand 10 before | Expand all | Expand 10 after
1196 SkPDFDict* relatedFontDescriptor) 1196 SkPDFDict* relatedFontDescriptor)
1197 : SkPDFFont(info, typeface, relatedFontDescriptor) { 1197 : SkPDFFont(info, typeface, relatedFontDescriptor) {
1198 this->populate(glyphID); 1198 this->populate(glyphID);
1199 } 1199 }
1200 1200
1201 SkPDFType1Font::~SkPDFType1Font() {} 1201 SkPDFType1Font::~SkPDFType1Font() {}
1202 1202
1203 bool SkPDFType1Font::addFontDescriptor(int16_t defaultWidth) { 1203 bool SkPDFType1Font::addFontDescriptor(int16_t defaultWidth) {
1204 if (SkPDFDict* descriptor = getFontDescriptor()) { 1204 if (SkPDFDict* descriptor = getFontDescriptor()) {
1205 this->insertObjRef("FontDescriptor", 1205 this->insertObjRef("FontDescriptor",
1206 sk_sp<SkPDFDict>(SkRef(descriptor))); 1206 sk_ref_sp(descriptor));
1207 return true; 1207 return true;
1208 } 1208 }
1209 1209
1210 auto descriptor = sk_make_sp<SkPDFDict>("FontDescriptor"); 1210 auto descriptor = sk_make_sp<SkPDFDict>("FontDescriptor");
1211 setFontDescriptor(descriptor.get()); 1211 setFontDescriptor(descriptor.get());
1212 1212
1213 int ttcIndex; 1213 int ttcIndex;
1214 size_t header SK_INIT_TO_AVOID_WARNING; 1214 size_t header SK_INIT_TO_AVOID_WARNING;
1215 size_t data SK_INIT_TO_AVOID_WARNING; 1215 size_t data SK_INIT_TO_AVOID_WARNING;
1216 size_t trailer SK_INIT_TO_AVOID_WARNING; 1216 size_t trailer SK_INIT_TO_AVOID_WARNING;
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
1427 sk_sp<const SkAdvancedTypefaceMetrics> fontMetrics( 1427 sk_sp<const SkAdvancedTypefaceMetrics> fontMetrics(
1428 face->getAdvancedTypefaceMetrics( 1428 face->getAdvancedTypefaceMetrics(
1429 SkTypeface::kNo_PerGlyphInfo, nullptr, 0)); 1429 SkTypeface::kNo_PerGlyphInfo, nullptr, 0));
1430 if (fontMetrics) { 1430 if (fontMetrics) {
1431 canEmbed = !SkToBool( 1431 canEmbed = !SkToBool(
1432 fontMetrics->fFlags & 1432 fontMetrics->fFlags &
1433 SkAdvancedTypefaceMetrics::kNotEmbeddable_FontFlag); 1433 SkAdvancedTypefaceMetrics::kNotEmbeddable_FontFlag);
1434 } 1434 }
1435 return *canon->fCanEmbedTypeface.set(id, canEmbed); 1435 return *canon->fCanEmbedTypeface.set(id, canEmbed);
1436 } 1436 }
OLDNEW
« no previous file with comments | « src/pdf/SkPDFDevice.cpp ('k') | src/pdf/SkPDFFormXObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698