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

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

Issue 26799003: Fix double ref issue in SkPDFFont ctor (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 859 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 } 870 }
871 871
872 SkPDFFont::SkPDFFont(SkAdvancedTypefaceMetrics* info, SkTypeface* typeface, 872 SkPDFFont::SkPDFFont(SkAdvancedTypefaceMetrics* info, SkTypeface* typeface,
873 SkPDFDict* relatedFontDescriptor) 873 SkPDFDict* relatedFontDescriptor)
874 : SkPDFDict("Font"), 874 : SkPDFDict("Font"),
875 fTypeface(ref_or_default(typeface)), 875 fTypeface(ref_or_default(typeface)),
876 fFirstGlyphID(1), 876 fFirstGlyphID(1),
877 fLastGlyphID(info ? info->fLastGlyphID : 0), 877 fLastGlyphID(info ? info->fLastGlyphID : 0),
878 fFontInfo(info), 878 fFontInfo(info),
879 fDescriptor(relatedFontDescriptor) { 879 fDescriptor(relatedFontDescriptor) {
880 SkSafeRef(typeface);
881 SkSafeRef(info); 880 SkSafeRef(info);
882 if (info == NULL) { 881 if (info == NULL) {
883 fFontType = SkAdvancedTypefaceMetrics::kNotEmbeddable_Font; 882 fFontType = SkAdvancedTypefaceMetrics::kNotEmbeddable_Font;
884 } else if (info->fMultiMaster) { 883 } else if (info->fMultiMaster) {
885 fFontType = SkAdvancedTypefaceMetrics::kOther_Font; 884 fFontType = SkAdvancedTypefaceMetrics::kOther_Font;
886 } else { 885 } else {
887 fFontType = info->fType; 886 fFontType = info->fType;
888 } 887 }
889 } 888 }
890 889
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
1423 1422
1424 insert("FontBBox", makeFontBBox(bbox, 1000))->unref(); 1423 insert("FontBBox", makeFontBBox(bbox, 1000))->unref();
1425 insertInt("FirstChar", firstGlyphID()); 1424 insertInt("FirstChar", firstGlyphID());
1426 insertInt("LastChar", lastGlyphID()); 1425 insertInt("LastChar", lastGlyphID());
1427 insert("Widths", widthArray.get()); 1426 insert("Widths", widthArray.get());
1428 insertName("CIDToGIDMap", "Identity"); 1427 insertName("CIDToGIDMap", "Identity");
1429 1428
1430 populateToUnicodeTable(NULL); 1429 populateToUnicodeTable(NULL);
1431 return true; 1430 return true;
1432 } 1431 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698