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

Unified Diff: Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp

Issue 13905007: Remove the last remaining PLATFORM() bits from WebCore. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fffffffffff Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp
diff --git a/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp b/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp
index 73ed1c7f4ffec97be9874cc311879be06ecd3970..0892087dc74820c974671fcc82150afce1f29c17 100644
--- a/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp
+++ b/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp
@@ -78,10 +78,6 @@ private:
FontCustomPlatformData::~FontCustomPlatformData()
{
-#if !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED == 1050
- if (m_atsContainer)
- ATSFontDeactivate(m_atsContainer, NULL, kATSOptionFlagsDefault);
-#endif
#if USE(SKIA_ON_MAC_CHROMIUM)
SkSafeUnref(m_typeface);
#endif
@@ -119,45 +115,12 @@ FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer)
RetainPtr<CGFontRef> cgFontRef;
-#if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
RetainPtr<CFDataRef> bufferData(AdoptCF, buffer->createCFData());
RetainPtr<CGDataProviderRef> dataProvider(AdoptCF, CGDataProviderCreateWithCFData(bufferData.get()));
cgFontRef.adoptCF(CGFontCreateWithDataProvider(dataProvider.get()));
if (!cgFontRef)
return 0;
-#else
- // Use ATS to activate the font.
-
- // The value "3" means that the font is private and can't be seen by anyone else.
- ATSFontActivateFromMemory((void*)buffer->data(), buffer->size(), 3, kATSFontFormatUnspecified, NULL, kATSOptionFlagsDefault, &containerRef);
- if (!containerRef)
- return 0;
- ItemCount fontCount;
- ATSFontFindFromContainer(containerRef, kATSOptionFlagsDefault, 0, NULL, &fontCount);
-
- // We just support the first font in the list.
- if (fontCount == 0) {
- ATSFontDeactivate(containerRef, NULL, kATSOptionFlagsDefault);
- return 0;
- }
-
- ATSFontRef fontRef = 0;
- ATSFontFindFromContainer(containerRef, kATSOptionFlagsDefault, 1, &fontRef, NULL);
- if (!fontRef) {
- ATSFontDeactivate(containerRef, NULL, kATSOptionFlagsDefault);
- return 0;
- }
-
- cgFontRef.adoptCF(CGFontCreateWithPlatformFont(&fontRef));
- // Workaround for <rdar://problem/5675504>.
- if (cgFontRef && !CGFontGetNumberOfGlyphs(cgFontRef.get()))
- cgFontRef = 0;
- if (!cgFontRef) {
- ATSFontDeactivate(containerRef, NULL, kATSOptionFlagsDefault);
- return 0;
- }
-#endif // PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
FontCustomPlatformData* fontCustomPlatformData = new FontCustomPlatformData(containerRef, cgFontRef.leakRef());
#if USE(SKIA_ON_MAC_CHROMIUM)
« no previous file with comments | « Source/WebCore/platform/graphics/mac/FontCacheMac.mm ('k') | Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698