Changeset 147859 in webkit
- Timestamp:
- Apr 6, 2013 4:19:08 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r147858 r147859 1 2013-04-06 Benjamin Poulain <benjamin@webkit.org> 2 3 Remove the Chromium code from Mac's FontPlatformData 4 https://bugs.webkit.org/show_bug.cgi?id=114103 5 6 Reviewed by Sam Weinig. 7 8 * platform/graphics/FontPlatformData.h: 9 (WebCore): 10 (FontPlatformData): 11 * platform/graphics/cocoa/FontPlatformDataCocoa.mm: 12 (WebCore::FontPlatformData::FontPlatformData): 13 (WebCore::FontPlatformData::platformDataInit): 14 (WebCore::FontPlatformData::platformDataAssign): 15 (WebCore::FontPlatformData::setFont): 16 (WebCore::FontPlatformData::ctFont): 17 1 18 2013-04-06 Oliver Hunt <oliver@apple.com> 2 19 -
trunk/Source/WebCore/platform/graphics/FontPlatformData.h
r147855 r147859 64 64 #include <wtf/text/StringImpl.h> 65 65 66 #if PLATFORM(CHROMIUM) && OS(DARWIN)67 #include "CrossProcessFontLoading.h"68 #endif69 70 66 #if PLATFORM(WIN) 71 67 typedef struct HFONT__* HFONT; … … 86 82 class FontDescription; 87 83 class SharedBuffer; 88 89 #if PLATFORM(CHROMIUM) && OS(DARWIN)90 class HarfBuzzFace;91 #endif92 84 93 85 #if OS(DARWIN) … … 159 151 #if USE(CAIRO) 160 152 cairo_scaled_font_t* scaledFont() const { return m_scaledFont; } 161 #endif162 163 #if PLATFORM(CHROMIUM) && OS(DARWIN)164 HarfBuzzFace* harfBuzzFace();165 153 #endif 166 154 … … 222 210 #if OS(DARWIN) 223 211 // Load various data about the font specified by |nsFont| with the size fontSize into the following output paramters: 224 // Note: Callers should always take into account that for the Chromium port, |outNSFont| isn't necessarily the same225 // font as |nsFont|. This because the sandbox may block loading of the original font.226 // * outNSFont - The font that was actually loaded, for the Chromium port this may be different than nsFont.227 // The caller is responsible for calling CFRelease() on this parameter when done with it.228 // * cgFont - CGFontRef representing the input font at the specified point size.229 212 void loadFont(NSFont*, float fontSize, NSFont*& outNSFont, CGFontRef&); 230 213 static NSFont* hashTableDeletedFontValue() { return reinterpret_cast<NSFont *>(-1); } … … 264 247 #endif 265 248 266 #if PLATFORM(CHROMIUM) && OS(DARWIN)267 RefPtr<MemoryActivatedFont> m_inMemoryFont;268 RefPtr<HarfBuzzFace> m_harfBuzzFace;269 #endif270 271 249 bool m_isColorBitmapFont; 272 250 bool m_isCompositeFontReference; -
trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm
r147710 r147859 28 28 #import <AppKit/NSFont.h> 29 29 #import <wtf/text/WTFString.h> 30 31 #if PLATFORM(CHROMIUM) && OS(DARWIN)32 #import "HarfBuzzFace.h"33 #endif34 30 35 31 namespace WebCore { … … 63 59 64 60 #if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 65 // FIXME: Chromium: The following code isn't correct for the Chromium port since the sandbox might66 // have blocked font loading, in which case we'll only have the real loaded font file after the call to loadFont().67 61 { 68 62 CTFontSymbolicTraits traits = CTFontGetSymbolicTraits(toCTFontRef(m_font)); … … 92 86 m_cgFont = f.m_cgFont; 93 87 m_CTFont = f.m_CTFont; 94 95 #if PLATFORM(CHROMIUM) && OS(DARWIN)96 m_inMemoryFont = f.m_inMemoryFont;97 m_harfBuzzFace = f.m_harfBuzzFace;98 #endif99 88 } 100 89 … … 110 99 m_font = f.m_font; 111 100 m_CTFont = f.m_CTFont; 112 #if PLATFORM(CHROMIUM) && OS(DARWIN)113 m_inMemoryFont = f.m_inMemoryFont;114 m_harfBuzzFace = f.m_harfBuzzFace;115 #endif116 101 return *this; 117 102 } … … 141 126 NSFont* loadedFont = 0; 142 127 loadFont(m_font, m_size, loadedFont, cgFont); 143 144 #if PLATFORM(CHROMIUM) && OS(DARWIN) 145 // If loadFont replaced m_font with a fallback font, then release the 146 // previous font to counter the retain above. Then retain the new font. 147 if (loadedFont != m_font) { 148 CFRelease(m_font); 149 CFRetain(loadedFont); 150 m_font = loadedFont; 151 } 152 #endif 153 128 154 129 m_cgFont.adoptCF(cgFont); 155 130 #if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 … … 247 222 if (m_CTFont) 248 223 return m_CTFont.get(); 249 250 #if PLATFORM(CHROMIUM)251 if (m_inMemoryFont) {252 m_CTFont.adoptCF(CTFontCreateWithGraphicsFont(m_inMemoryFont->cgFont(), m_size, 0, cascadeToLastResortFontDescriptor()));253 return m_CTFont.get();254 }255 #endif256 224 257 225 m_CTFont = toCTFontRef(m_font); … … 284 252 } 285 253 286 #if PLATFORM(CHROMIUM) && OS(DARWIN)287 static bool isAATFont(CTFontRef ctFont)288 {289 CFDataRef table = CTFontCopyTable(ctFont, kCTFontTableMort, 0);290 if (table) {291 CFRelease(table);292 return true;293 }294 table = CTFontCopyTable(ctFont, kCTFontTableMorx, 0);295 if (table) {296 CFRelease(table);297 return true;298 }299 return false;300 }301 302 HarfBuzzFace* FontPlatformData::harfBuzzFace()303 {304 CTFontRef font = ctFont();305 // HarfBuzz can't handle AAT font306 if (isAATFont(font))307 return 0;308 309 if (!m_harfBuzzFace) {310 uint64_t uniqueID = reinterpret_cast<uintptr_t>(font);311 m_harfBuzzFace = HarfBuzzFace::create(const_cast<FontPlatformData*>(this), uniqueID);312 }313 return m_harfBuzzFace.get();314 }315 #endif316 317 254 #ifndef NDEBUG 318 255 String FontPlatformData::description() const
Note: See TracChangeset
for help on using the changeset viewer.