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

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: 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(info),
bungeman-skia 2013/12/05 18:36:20 fFontInfo(SkSafeRef(info)), fDescriptor(SkSafeRef(
vandebo (ex-Chrome) 2013/12/05 19:34:56 Done. Indeed, I didn't realize that SkSafeRef ret
879 fDescriptor(relatedFontDescriptor) { 879 fDescriptor(relatedFontDescriptor) {
880 SkSafeRef(info); 880 SkSafeRef(info);
881 SkSafeRef(relatedFontDescriptor);
881 if (info == NULL) { 882 if (info == NULL) {
882 fFontType = SkAdvancedTypefaceMetrics::kNotEmbeddable_Font; 883 fFontType = SkAdvancedTypefaceMetrics::kNotEmbeddable_Font;
883 } else if (info->fMultiMaster) { 884 } else if (info->fMultiMaster) {
884 fFontType = SkAdvancedTypefaceMetrics::kOther_Font; 885 fFontType = SkAdvancedTypefaceMetrics::kOther_Font;
885 } else { 886 } else {
886 fFontType = info->fType; 887 fFontType = info->fType;
887 } 888 }
888 } 889 }
889 890
890 // static 891 // static
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
1422 1423
1423 insert("FontBBox", makeFontBBox(bbox, 1000))->unref(); 1424 insert("FontBBox", makeFontBBox(bbox, 1000))->unref();
1424 insertInt("FirstChar", firstGlyphID()); 1425 insertInt("FirstChar", firstGlyphID());
1425 insertInt("LastChar", lastGlyphID()); 1426 insertInt("LastChar", lastGlyphID());
1426 insert("Widths", widthArray.get()); 1427 insert("Widths", widthArray.get());
1427 insertName("CIDToGIDMap", "Identity"); 1428 insertName("CIDToGIDMap", "Identity");
1428 1429
1429 populateToUnicodeTable(NULL); 1430 populateToUnicodeTable(NULL);
1430 return true; 1431 return true;
1431 } 1432 }
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