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

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

Issue 103423003: Fix refcounting bug for Type1 font usage with more than 255 characters. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: comments Created 7 years 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 857 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 *index = CanonicalFonts().find(search); 868 *index = CanonicalFonts().find(search);
869 return false; 869 return false;
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(SkSafeRef(info)),
879 fDescriptor(relatedFontDescriptor) { 879 fDescriptor(SkSafeRef(relatedFontDescriptor)) {
880 SkSafeRef(info);
881 if (info == NULL) { 880 if (info == NULL) {
882 fFontType = SkAdvancedTypefaceMetrics::kNotEmbeddable_Font; 881 fFontType = SkAdvancedTypefaceMetrics::kNotEmbeddable_Font;
883 } else if (info->fMultiMaster) { 882 } else if (info->fMultiMaster) {
884 fFontType = SkAdvancedTypefaceMetrics::kOther_Font; 883 fFontType = SkAdvancedTypefaceMetrics::kOther_Font;
885 } else { 884 } else {
886 fFontType = info->fType; 885 fFontType = info->fType;
887 } 886 }
888 } 887 }
889 888
890 // static 889 // static
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
1422 1421
1423 insert("FontBBox", makeFontBBox(bbox, 1000))->unref(); 1422 insert("FontBBox", makeFontBBox(bbox, 1000))->unref();
1424 insertInt("FirstChar", firstGlyphID()); 1423 insertInt("FirstChar", firstGlyphID());
1425 insertInt("LastChar", lastGlyphID()); 1424 insertInt("LastChar", lastGlyphID());
1426 insert("Widths", widthArray.get()); 1425 insert("Widths", widthArray.get());
1427 insertName("CIDToGIDMap", "Identity"); 1426 insertName("CIDToGIDMap", "Identity");
1428 1427
1429 populateToUnicodeTable(NULL); 1428 populateToUnicodeTable(NULL);
1430 return true; 1429 return true;
1431 } 1430 }
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