<http://webkit.org/b/91015> Remove BUILDING_ON / TARGETING macros in favor of system...
[WebKit-https.git] / Source / WebCore / platform / graphics / mac / FontCustomPlatformData.cpp
index 47d1f21..b192684 100644 (file)
@@ -78,7 +78,7 @@ private:
 
 FontCustomPlatformData::~FontCustomPlatformData()
 {
-#ifdef BUILDING_ON_LEOPARD
+#if __MAC_OS_X_VERSION_MIN_REQUIRED == 1050
     if (m_atsContainer)
         ATSFontDeactivate(m_atsContainer, NULL, kATSOptionFlagsDefault);
 #endif
@@ -97,7 +97,7 @@ FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer)
 {
     ASSERT_ARG(buffer, buffer);
 
-#if ENABLE(OPENTYPE_SANITIZER)
+#if USE(OPENTYPE_SANITIZER)
     OpenTypeSanitizer sanitizer(buffer);
     RefPtr<SharedBuffer> transcodeBuffer = sanitizer.sanitize();
     if (!transcodeBuffer)
@@ -119,7 +119,7 @@ FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer)
 
     RetainPtr<CGFontRef> cgFontRef;
 
-#ifndef BUILDING_ON_LEOPARD
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
     RetainPtr<CFDataRef> bufferData(AdoptCF, buffer->createCFData());
     RetainPtr<CGDataProviderRef> dataProvider(AdoptCF, CGDataProviderCreateWithCFData(bufferData.get()));
 
@@ -157,12 +157,13 @@ FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer)
         ATSFontDeactivate(containerRef, NULL, kATSOptionFlagsDefault);
         return 0;
     }
-#endif // !defined(BUILDING_ON_LEOPARD)
+#endif // __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
 
-    FontCustomPlatformData* fontCustomPlatformData = new FontCustomPlatformData(containerRef, cgFontRef.releaseRef());
+    FontCustomPlatformData* fontCustomPlatformData = new FontCustomPlatformData(containerRef, cgFontRef.leakRef());
 #if USE(SKIA_ON_MAC_CHROMIUM)
     RemoteFontStream* stream = new RemoteFontStream(buffer);
     fontCustomPlatformData->m_typeface = SkTypeface::CreateFromStream(stream);
+    stream->unref();
 #endif
     return fontCustomPlatformData;
 }