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

Side by Side Diff: Source/platform/fonts/mac/FontPlatformDataMac.mm

Issue 1165293003: Work around CGDataProvider premature release. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 | « 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 * This file is part of the internal font implementation. 2 * This file is part of the internal font implementation.
3 * 3 *
4 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 4 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
5 * Copyright (c) 2010 Google Inc. All rights reserved. 5 * Copyright (c) 2010 Google Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 CGFontRef loadedCgFont; 88 CGFontRef loadedCgFont;
89 uint32_t fontID; 89 uint32_t fontID;
90 if (!sandboxSupport->loadFont(nsFont, &loadedCgFont, &fontID)) { 90 if (!sandboxSupport->loadFont(nsFont, &loadedCgFont, &fontID)) {
91 // TODO crbug.com/461279: Make this appear in the inspector console? 91 // TODO crbug.com/461279: Make this appear in the inspector console?
92 WTF_LOG_ERROR("Loading user font \"%s\" from non system location failed. Corrupt or missing font file?", [[nsFont familyName] UTF8String]); 92 WTF_LOG_ERROR("Loading user font \"%s\" from non system location failed. Corrupt or missing font file?", [[nsFont familyName] UTF8String]);
93 return nullptr; 93 return nullptr;
94 } 94 }
95 RetainPtr<CGFontRef> cgFont(AdoptCF, loadedCgFont); 95 RetainPtr<CGFontRef> cgFont(AdoptCF, loadedCgFont);
96 RetainPtr<CTFontRef> ctFont(AdoptCF, CTFontCreateWithGraphicsFont(cgFont.get (), textSize, 0, cascadeToLastResortFontDescriptor())); 96 RetainPtr<CTFontRef> ctFont(AdoptCF, CTFontCreateWithGraphicsFont(cgFont.get (), textSize, 0, cascadeToLastResortFontDescriptor()));
97 PassRefPtr<SkTypeface> returnFont = adoptRef(SkCreateTypefaceFromCTFont(ctFo nt.get())); 97 PassRefPtr<SkTypeface> returnFont = adoptRef(SkCreateTypefaceFromCTFont(ctFo nt.get(), cgFont.get()));
98 98
99 if (!returnFont.get()) 99 if (!returnFont.get())
100 // TODO crbug.com/461279: Make this appear in the inspector console? 100 // TODO crbug.com/461279: Make this appear in the inspector console?
101 WTF_LOG_ERROR("Instantiating SkTypeface from user font failed for font f amily \"%s\".", [[nsFont familyName] UTF8String]); 101 WTF_LOG_ERROR("Instantiating SkTypeface from user font failed for font f amily \"%s\".", [[nsFont familyName] UTF8String]);
102 return returnFont; 102 return returnFont;
103 } 103 }
104 104
105 void FontPlatformData::setupPaint(SkPaint* paint, float, const Font* font) const 105 void FontPlatformData::setupPaint(SkPaint* paint, float, const Font* font) const
106 { 106 {
107 bool shouldSmoothFonts = true; 107 bool shouldSmoothFonts = true;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 } 164 }
165 } 165 }
166 166
167 bool FontPlatformData::defaultUseSubpixelPositioning() 167 bool FontPlatformData::defaultUseSubpixelPositioning()
168 { 168 {
169 return FontDescription::subpixelPositioning(); 169 return FontDescription::subpixelPositioning();
170 } 170 }
171 171
172 172
173 } // namespace blink 173 } // namespace blink
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