[iOS] CoreGraphics SPI not available in public SDK
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Nov 2014 22:27:58 +0000 (22:27 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Nov 2014 22:27:58 +0000 (22:27 +0000)
https://bugs.webkit.org/show_bug.cgi?id=138709

Reviewed by David Kilzer.

Source/WebCore:

Add a SPI wrapper header called CoreGraphicsSPI.h that forward declares
CoreGraphics SPI and use this header instead of including private headers
of CoreGraphics directly.

* WebCore.xcodeproj/project.pbxproj: Add WebCore private header CoreGraphicsSPI.h. Also remove header
CGFontUnicodeSupportSPI.h as its functionality has been incorporated into header CoreGraphicsSPI.h.
* WebCore.vcxproj/WebCore.vcxproj: Add WebCore private header CoreGraphicsSPI.h.
* WebCore.vcxproj/WebCore.vcxproj.filters: Add directories platform/spi and platform/spi/cg.
* WebCore.vcxproj/WebCoreCG.props: Add include directory platform/spi/cg.
* WebCore.vcxproj/copyForwardingHeaders.cmd: Copy WebCore headers from directory platform/spi/cg. This
is necessary because WebCore/platform/graphics/SimpleFontData.h includes CoreGraphicsSPI.h. And
WebCore/platform/graphics/SimpleFontData.h is compiled for the Apple Windows port.
* platform/graphics/SimpleFontData.h: Move CGFontRenderingStyle declaration and associated enum
from this file to file CoreGraphicsSPI.h and include header CoreGraphicsSPI.h.
* platform/graphics/cg/BitmapImageCG.cpp: Remove unnecessary #include of header CGContextPrivate.h.
* platform/graphics/cg/ColorCG.cpp: Include header CoreGraphicsSPI.h instead of including headers
of CoreGraphics directly.
* platform/graphics/cg/GraphicsContextCG.cpp: Move forward declarations of CoreGraphics functions
from this file to file CoreGraphicsSPI.h and include header CoreGraphicsSPI.h. Also sort the list
of #include directives.
* platform/graphics/cg/ImageSourceCG.cpp: Include header CoreGraphicsSPI.h instead of including
headers of CoreGraphics directly.
* platform/graphics/cg/PDFDocumentImage.cpp: Ditto.
* platform/graphics/cocoa/FontPlatformDataCocoa.mm: Ditto.
* platform/graphics/ios/FontCacheIOS.mm: Include header CoreGraphicsSPI.h instead of including
header <CoreGraphics/CGFontUnicodeSupport.h> directly.
* platform/graphics/ios/FontServicesIOS.mm: Include header CoreGraphicsSPI.h instead of including
headers of CoreGraphics directly.
* platform/graphics/ios/SimpleFontDataIOS.mm: Ditto.
* platform/graphics/mac/FontMac.mm: Move forward declarations of CoreGraphics functions from this
file to file CoreGraphicsSPI.h and include header CoreGraphicsSPI.h.
* platform/graphics/mac/GlyphPageTreeNodeMac.cpp: Substitute header CoreGraphicsSPI.h for CGFontUnicodeSupportSPI.h
and remove #include of headers CGFontUnicodeSupport.h (it will be included by CoreGraphicsSPI.h).
* platform/graphics/mac/SimpleFontDataMac.mm: Move forward declarations of CoreGraphics functions
from this file to file CoreGraphicsSPI.h and include header CoreGraphicsSPI.h.
* platform/ios/LegacyTileGrid.mm: Include header CoreGraphicsSPI.h instead of including headers of
CoreGraphics directly.
* platform/ios/wak/WKGraphics.h: Remove #include of header CoreGraphicsPrivate.h and forward declare
CGFontAntialiasingStyle Additionally, declare WKCompositeOperation as an alias of int and use this
data type instead of CGCompositeOperation (SPI). This approach lets us keep the definition of
CGCompositeOperation in file CoreGraphicsSPI.h, where all the other definitions/forward declarations
of CoreGraphics data types reside, as opposed to defining it in this file.
* platform/ios/wak/WKGraphics.mm:
(WKRectFillUsingOperation): Cast data type WKCompositeOperation to CGCompositeOperation and added
compile-time assert to ensure that the size of WKCompositeOperation is identical to the size of CGCompositeOperation.
* platform/graphics/cg/ImageSourceCG.cpp: Move CGImageCachingFlags declaration, associated enum, and
forward declaration of CGImageSetCachingFlags() from this file to file CoreGraphicsSPI.h and include
header CoreGraphicsSPI.h.
(WebCore::ImageSource::createFrameAtIndex): Fix incorrect comment.
* platform/spi/cocoa/CGFontUnicodeSupportSPI.h: Removed; moved its functionality into header CoreGraphicsSPI.h.
* platform/spi/cg/CoreGraphicsSPI.h: Added.
(CGFloatMin):
* rendering/RenderThemeIOS.mm: Substitute header CoreGraphics.h for CGPathPrivate.h as we no longer
make use of any functionality from CGPathPrivate.h in this file. The functionality we used from
CGPathPrivate.h, including CGPathAddRoundedRect(), has been moved to the public API header, CGPath.h,
which is included from header CoreGraphics.h.

Source/WebKit/ios:

Include header CoreGraphicsSPI.h instead of the private header CGFloat.h.

* WebCoreSupport/WebFixedPositionContent.mm:

Source/WebKit2:

Include header CoreGraphicsSPI.h instead of including headers of
CoreGraphics directly.

* UIProcess/API/Cocoa/WKWebView.mm:
* UIProcess/ios/WKScrollView.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176140 268f45cc-cd09-0410-ab3c-d52691b4dbfc

26 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/copyForwardingHeaders.cmd
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/platform/graphics/SimpleFontData.h
Source/WebCore/platform/graphics/cg/BitmapImageCG.cpp
Source/WebCore/platform/graphics/cg/ColorCG.cpp
Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
Source/WebCore/platform/graphics/cg/ImageSourceCG.cpp
Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp
Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm
Source/WebCore/platform/graphics/ios/FontCacheIOS.mm
Source/WebCore/platform/graphics/ios/FontServicesIOS.mm
Source/WebCore/platform/graphics/ios/SimpleFontDataIOS.mm
Source/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp
Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm
Source/WebCore/platform/ios/LegacyTileGrid.mm
Source/WebCore/platform/ios/wak/WKGraphics.h
Source/WebCore/platform/ios/wak/WKGraphics.mm
Source/WebCore/platform/spi/cg/CoreGraphicsSPI.h
Source/WebCore/rendering/RenderThemeIOS.mm
Source/WebKit/ios/ChangeLog
Source/WebKit/ios/WebCoreSupport/WebFixedPositionContent.mm
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit2/UIProcess/ios/WKScrollView.mm

index 1a16f4fa087483d04606dbdde8f1d4f091de7d19..9060f347a01378a48fa31509ce2399d59c33eeb2 100644 (file)
@@ -1,3 +1,67 @@
+2014-11-14  Daniel Bates  <dabates@apple.com>
+
+        [iOS] CoreGraphics SPI not available in public SDK
+        https://bugs.webkit.org/show_bug.cgi?id=138709
+
+        Reviewed by David Kilzer.
+
+        Add a SPI wrapper header called CoreGraphicsSPI.h that forward declares
+        CoreGraphics SPI and use this header instead of including private headers
+        of CoreGraphics directly.
+
+        * WebCore.xcodeproj/project.pbxproj: Add WebCore private header CoreGraphicsSPI.h. Also remove header
+        CGFontUnicodeSupportSPI.h as its functionality has been incorporated into header CoreGraphicsSPI.h.
+        * WebCore.vcxproj/WebCore.vcxproj: Add WebCore private header CoreGraphicsSPI.h.
+        * WebCore.vcxproj/WebCore.vcxproj.filters: Add directories platform/spi and platform/spi/cg.
+        * WebCore.vcxproj/WebCoreCG.props: Add include directory platform/spi/cg.
+        * WebCore.vcxproj/copyForwardingHeaders.cmd: Copy WebCore headers from directory platform/spi/cg. This
+        is necessary because WebCore/platform/graphics/SimpleFontData.h includes CoreGraphicsSPI.h. And
+        WebCore/platform/graphics/SimpleFontData.h is compiled for the Apple Windows port.
+        * platform/graphics/SimpleFontData.h: Move CGFontRenderingStyle declaration and associated enum
+        from this file to file CoreGraphicsSPI.h and include header CoreGraphicsSPI.h. 
+        * platform/graphics/cg/BitmapImageCG.cpp: Remove unnecessary #include of header CGContextPrivate.h.
+        * platform/graphics/cg/ColorCG.cpp: Include header CoreGraphicsSPI.h instead of including headers
+        of CoreGraphics directly.
+        * platform/graphics/cg/GraphicsContextCG.cpp: Move forward declarations of CoreGraphics functions
+        from this file to file CoreGraphicsSPI.h and include header CoreGraphicsSPI.h. Also sort the list
+        of #include directives.
+        * platform/graphics/cg/ImageSourceCG.cpp: Include header CoreGraphicsSPI.h instead of including
+        headers of CoreGraphics directly.
+        * platform/graphics/cg/PDFDocumentImage.cpp: Ditto.
+        * platform/graphics/cocoa/FontPlatformDataCocoa.mm: Ditto.
+        * platform/graphics/ios/FontCacheIOS.mm: Include header CoreGraphicsSPI.h instead of including
+        header <CoreGraphics/CGFontUnicodeSupport.h> directly.
+        * platform/graphics/ios/FontServicesIOS.mm: Include header CoreGraphicsSPI.h instead of including
+        headers of CoreGraphics directly.
+        * platform/graphics/ios/SimpleFontDataIOS.mm: Ditto.
+        * platform/graphics/mac/FontMac.mm: Move forward declarations of CoreGraphics functions from this
+        file to file CoreGraphicsSPI.h and include header CoreGraphicsSPI.h.
+        * platform/graphics/mac/GlyphPageTreeNodeMac.cpp: Substitute header CoreGraphicsSPI.h for CGFontUnicodeSupportSPI.h
+        and remove #include of headers CGFontUnicodeSupport.h (it will be included by CoreGraphicsSPI.h).
+        * platform/graphics/mac/SimpleFontDataMac.mm: Move forward declarations of CoreGraphics functions
+        from this file to file CoreGraphicsSPI.h and include header CoreGraphicsSPI.h.
+        * platform/ios/LegacyTileGrid.mm: Include header CoreGraphicsSPI.h instead of including headers of
+        CoreGraphics directly.
+        * platform/ios/wak/WKGraphics.h: Remove #include of header CoreGraphicsPrivate.h and forward declare
+        CGFontAntialiasingStyle Additionally, declare WKCompositeOperation as an alias of int and use this
+        data type instead of CGCompositeOperation (SPI). This approach lets us keep the definition of
+        CGCompositeOperation in file CoreGraphicsSPI.h, where all the other definitions/forward declarations
+        of CoreGraphics data types reside, as opposed to defining it in this file.
+        * platform/ios/wak/WKGraphics.mm:
+        (WKRectFillUsingOperation): Cast data type WKCompositeOperation to CGCompositeOperation and added
+        compile-time assert to ensure that the size of WKCompositeOperation is identical to the size of CGCompositeOperation.
+        * platform/graphics/cg/ImageSourceCG.cpp: Move CGImageCachingFlags declaration, associated enum, and
+        forward declaration of CGImageSetCachingFlags() from this file to file CoreGraphicsSPI.h and include
+        header CoreGraphicsSPI.h.
+        (WebCore::ImageSource::createFrameAtIndex): Fix incorrect comment.
+        * platform/spi/cocoa/CGFontUnicodeSupportSPI.h: Removed; moved its functionality into header CoreGraphicsSPI.h.
+        * platform/spi/cg/CoreGraphicsSPI.h: Added.
+        (CGFloatMin):
+        * rendering/RenderThemeIOS.mm: Substitute header CoreGraphics.h for CGPathPrivate.h as we no longer
+        make use of any functionality from CGPathPrivate.h in this file. The functionality we used from
+        CGPathPrivate.h, including CGPathAddRoundedRect(), has been moved to the public API header, CGPath.h,
+        which is included from header CoreGraphics.h.
+
 2014-11-14  Dean Jackson  <dino@apple.com>
 
         [Media] Timeline scrubber not updating as the video plays
index 6be7bfaf99a32b80adde4189af5118e3edf5e889..3be5bf61606f548f9791a60b2fdbc51e5343ce21 100644 (file)
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
     </CustomBuildStep>
+    <ClInclude Include="..\platform\spi\cg\CoreGraphicsSPI.h">
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
+    </ClInclude>
     <ClInclude Include="..\platform\sql\SQLiteDatabase.h" />
     <ClInclude Include="..\platform\sql\SQLiteDatabaseTracker.h" />
     <ClInclude Include="..\platform\sql\SQLiteDatabaseTrackerClient.h" />
index dc0b59d65d42c03ae4146d88ed76df5052150db4..c4b6830c40b8690792e2c05feaecaeb124f067eb 100644 (file)
@@ -67,6 +67,7 @@ xcopy /y /d "%ProjectDir%..\platform\text\transcoder\*.h" "%CONFIGURATIONBUILDDI
 xcopy /y /d "%ProjectDir%..\platform\win\*.h" "%CONFIGURATIONBUILDDIR%\include\WebCore"
 xcopy /y /d "%ProjectDir%..\platform\network\*.h" "%CONFIGURATIONBUILDDIR%\include\WebCore"
 xcopy /y /d "%ProjectDir%..\platform\network\%2\*.h" "%CONFIGURATIONBUILDDIR%\include\WebCore"
+xcopy /y /d "%ProjectDir%..\platform\spi\cg\*.h" "%CONFIGURATIONBUILDDIR%\include\WebCore"
 xcopy /y /d "%ProjectDir%..\platform\sql\*.h" "%CONFIGURATIONBUILDDIR%\include\WebCore"
 xcopy /y /d "%ProjectDir%..\platform\cairo\cairo\src\*.h" "%CONFIGURATIONBUILDDIR%\include\WebCore"
 xcopy /y /d "%ProjectDir%..\bindings\*.h" "%CONFIGURATIONBUILDDIR%\include\WebCore"
index dc4571e7efec353f33796645812efdc48b656abe..6de024e2b80ebe280aa690a597cb03907c9935e2 100644 (file)
                CE057FA61220731100A476D5 /* DocumentMarkerController.h in Headers */ = {isa = PBXBuildFile; fileRef = CE057FA41220731100A476D5 /* DocumentMarkerController.h */; settings = {ATTRIBUTES = (Private, ); }; };
                CE08C3D1152B599A0021B8C2 /* AlternativeTextController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE08C3CF152B599A0021B8C2 /* AlternativeTextController.cpp */; };
                CE08C3D2152B599A0021B8C2 /* AlternativeTextController.h in Headers */ = {isa = PBXBuildFile; fileRef = CE08C3D0152B599A0021B8C2 /* AlternativeTextController.h */; settings = {ATTRIBUTES = (); }; };
+               CE1252371A15BDBE00864480 /* CoreGraphicsSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = C24685131A148E1800811792 /* CoreGraphicsSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
                CE7B2DB31586ABAD0098B3FA /* AlternativeTextUIController.h in Headers */ = {isa = PBXBuildFile; fileRef = CE7B2DAF1586ABAD0098B3FA /* AlternativeTextUIController.h */; settings = {ATTRIBUTES = (Private, ); }; };
                CE7B2DB41586ABAD0098B3FA /* AlternativeTextUIController.mm in Sources */ = {isa = PBXBuildFile; fileRef = CE7B2DB01586ABAD0098B3FA /* AlternativeTextUIController.mm */; };
                CE7B2DB51586ABAD0098B3FA /* TextAlternativeWithRange.h in Headers */ = {isa = PBXBuildFile; fileRef = CE7B2DB11586ABAD0098B3FA /* TextAlternativeWithRange.h */; settings = {ATTRIBUTES = (Private, ); }; };
                                339B5B63131DAA3200F48D02 /* CookiesStrategy.h in Headers */,
                                33D0212D131DB37B004091A8 /* CookieStorage.h in Headers */,
                                9746AF2114F4DDE6003E7A71 /* Coordinates.h in Headers */,
+                               CE1252371A15BDBE00864480 /* CoreGraphicsSPI.h in Headers */,
                                1C6466251A12C38E0094603C /* CoreTextSPI.h in Headers */,
                                862F129E18C1576F005C54AF /* CountedUserActivity.h in Headers */,
                                A80E6D040A1989CA007FB8C5 /* Counter.h in Headers */,
index 274527606ba502ab61a420675ae57f7661be2070..e0b3740d3724bbe3d877799f1c6dccae56098c10 100644 (file)
 #endif
 
 #if USE(CG)
-#if defined(__has_include) && __has_include(<CoreGraphics/CGFontRendering.h>)
-#include <CoreGraphics/CGFontRendering.h>
-#else
-enum {
-    kCGFontRenderingStyleAntialiasing = (1 << 0),
-    kCGFontRenderingStyleSmoothing = (1 << 1),
-    kCGFontRenderingStyleSubpixelPositioning = (1 << 2),
-    kCGFontRenderingStyleSubpixelQuantization = (1 << 3),
-    kCGFontRenderingStylePlatformNative = (1 << 9),
-    kCGFontRenderingStyleMask = 0x20F
-};
-#endif
-typedef uint32_t CGFontRenderingStyle;
+#include <WebCore/CoreGraphicsSPI.h>
 #endif
 
 namespace WebCore {
index 8a4a13e89b6b164d1ee5b5166dea142056dcd40b..d2519c826fff59ab6771a2f02c6992650f08cef6 100644 (file)
 #include <ApplicationServices/ApplicationServices.h>
 #endif
 
-#if PLATFORM(IOS)
-#include <CoreGraphics/CGContextPrivate.h>
-#endif
-
 #if PLATFORM(COCOA)
 #include "WebCoreSystemInterface.h"
 #endif
index 0756691136d7e56afdbf0edb31fb9f78d9ff9297..8a7febed540837ed12300d7b28b37bab786fff35 100644 (file)
@@ -34,8 +34,7 @@
 #if !PLATFORM(IOS)
 #include <ApplicationServices/ApplicationServices.h>
 #else
-#include <CoreGraphics/CGColorTransform.h>
-#include <CoreGraphics/CoreGraphics.h>
+#include <WebCore/CoreGraphicsSPI.h>
 #include <wtf/StdLibExtras.h>
 #endif // !PLATFORM(IOS)
 
index 1e3aa75a69412667d60b2e8dfe85556d326b8d81..015cbf16c9d37e1dff0c49413a7964a27ba80160 100644 (file)
 #include "GraphicsContextCG.h"
 
 #include "AffineTransform.h"
+#include "CoreGraphicsSPI.h"
 #include "FloatConversion.h"
 #include "GraphicsContextPlatformPrivateCG.h"
 #include "ImageBuffer.h"
 #include "ImageOrientation.h"
-#include "URL.h"
 #include "Path.h"
 #include "Pattern.h"
 #include "ShadowBlur.h"
 #include "SubimageCacheWithTimer.h"
 #include "Timer.h"
-#include <CoreGraphics/CoreGraphics.h>
+#include "URL.h"
 #include <wtf/MathExtras.h>
 #include <wtf/RetainPtr.h>
 
 #endif
 
 #if PLATFORM(IOS)
-#include <CoreGraphics/CGContextGState.h>
 #include <wtf/HashMap.h>
 #endif
 
-#if !PLATFORM(IOS)
-extern "C" {
-    CG_EXTERN void CGContextSetCTM(CGContextRef, CGAffineTransform);
-    CG_EXTERN CGAffineTransform CGContextGetBaseCTM(CGContextRef);
-};
-#endif // !PLATFORM(IOS)
-
 // FIXME: The following using declaration should be in <wtf/HashFunctions.h>.
 using WTF::pairIntHash;
 
index aba550219483ce8e995b2aed4debe7a4a841456b..953faea7930aafc90c496c8befdb65ed6b53533b 100644 (file)
@@ -29,6 +29,7 @@
 #if USE(CG)
 #include "ImageSourceCG.h"
 
+#include "CoreGraphicsSPI.h"
 #include "ImageOrientation.h"
 #include "IntPoint.h"
 #include "IntSize.h"
@@ -39,7 +40,6 @@
 #if !PLATFORM(IOS)
 #include <ApplicationServices/ApplicationServices.h>
 #else
-#include <CoreGraphics/CGImagePrivate.h>
 #include <ImageIO/ImageIO.h>
 #include <wtf/RetainPtr.h>
 #endif
 const CFStringRef kCGImageSourceSubsampleFactor = CFSTR("kCGImageSourceSubsampleFactor");
 #endif
 
-#if __has_include(<CoreGraphics/CGImagePrivate.h>)
-#import <CoreGraphics/CGImagePrivate.h>
-#else
-enum {
-    kCGImageCachingTransient = 1,
-    kCGImageCachingTemporary = 3
-};
-typedef uint32_t CGImageCachingFlags;
-extern "C" void CGImageSetCachingFlags(CGImageRef image, CGImageCachingFlags flags);
-#endif
-
 namespace WebCore {
 
 const CFStringRef WebCoreCGImagePropertyAPNGUnclampedDelayTime = CFSTR("UnclampedDelayTime");
@@ -371,7 +360,7 @@ CGImageRef ImageSource::createFrameAtIndex(size_t index, SubsamplingLevel subsam
 #if COMPILER(CLANG)
 #pragma clang diagnostic pop
 #endif
-#endif // !PLATFORM(IOS)
+#endif // PLATFORM(IOS)
 
     CFStringRef imageUTI = CGImageSourceGetType(m_decoder);
     static const CFStringRef xbmUTI = CFSTR("public.xbitmap-image");
index ad33b613241b9c80751f13f91b2e1314b8639f11..b19fb081e4386232b51cb1ded1b16b630b3a7669 100644 (file)
 #if USE(CG)
 
 #if PLATFORM(IOS)
-#import <CoreGraphics/CGContextPrivate.h>
-#import <CoreGraphics/CGContextGState.h>
-#import <CoreGraphics/CoreGraphics.h>
-#import <ImageIO/ImageIO.h>
+#include <CoreGraphics/CoreGraphics.h>
+#include <ImageIO/ImageIO.h>
 #endif
 
 #include "GraphicsContext.h"
index 3ff1823ffe2288737491488b120604385577fd48..36b1f2ab6ce64198e0c64267d0b96da1a3e3226c 100644 (file)
@@ -28,8 +28,8 @@
 #if !PLATFORM(IOS)
 #import <AppKit/NSFont.h>
 #else
+#import "CoreGraphicsSPI.h"
 #import <CoreText/CoreText.h>
-#import <CoreGraphics/CGFontInfo.h>
 #endif
 
 #import <wtf/text/WTFString.h>
index 17328858983b458b8aa61e79a75e65f987222424..48a46b82859f930515e90cd41aefa2951a44215d 100644 (file)
@@ -29,9 +29,9 @@
 #import "config.h"
 #import "FontCache.h"
 
+#import "CoreGraphicsSPI.h"
 #import "Font.h"
 #import "RenderThemeIOS.h"
-#import <CoreGraphics/CGFontUnicodeSupport.h>
 #import <CoreText/CTFontDescriptorPriv.h>
 #import <CoreText/CTFontPriv.h>
 #import <wtf/NeverDestroyed.h>
index c062dc82932d7c5df3193d36e29c16d3c881d34c..819c362c9d3beec03009d6f6212cd3cdf6567925 100644 (file)
@@ -25,9 +25,8 @@
 #import "config.h"
 #import "FontServicesIOS.h"
 
+#import "CoreGraphicsSPI.h"
 #import "FontMetrics.h"
-#import <CoreGraphics/CoreGraphics.h>
-#import <CoreGraphics/CoreGraphicsPrivate.h>
 #import <mach-o/dyld_priv.h>
 #import <wtf/RetainPtr.h>
 
index 4af8a238f06850f633d312a3a6d44fc8e32c50f3..d0c080068876729a4ed5b97115a1baf268752569 100644 (file)
 #import "SimpleFontData.h"
 
 #import "BlockExceptions.h"
+#import "CoreGraphicsSPI.h"
 #import "Font.h"
 #import "FontCache.h"
 #import "FontDescription.h"
 #import "FontServicesIOS.h"
-#import <CoreGraphics/CGFontInfo.h>
 #import <CoreText/CoreText.h>
 #import <float.h>
 #import <unicode/uchar.h>
index 42dfba4f3e053da23f44f15a6c3cd735dc114747..c5141c6655b4f1f510a1580390eb2cf31651e46c 100644 (file)
@@ -37,7 +37,6 @@
 #if !PLATFORM(IOS)
 #include <ApplicationServices/ApplicationServices.h>
 #else
-#include <CoreGraphics/CGFontUnicodeSupport.h>
 #include <CoreText/CTFontPriv.h>
 #include <CoreText/CoreText.h>
 #endif
index a89e624ba5088119f5ad7402f7a012ae3df8e518..2b1d787b9551f4faada56214c4cebc3c6f7b8962 100644 (file)
@@ -29,6 +29,7 @@
 
 #import "BlockExceptions.h"
 #import "Color.h"
+#import "CoreGraphicsSPI.h"
 #import "CoreTextSPI.h"
 #import "FloatRect.h"
 #import "Font.h"
 #endif
 extern "C" bool CTFontDescriptorIsSystemUIFont(CTFontDescriptorRef);
 
-#if defined(__has_include) && __has_include(<CoreGraphics/CGFontGlyphSupport.h>)
-#import <CoreGraphics/CGFontGlyphSupport.h>
-#endif
-extern "C" bool CGFontGetGlyphAdvancesForStyle(CGFontRef font,
-    const CGAffineTransform *t, CGFontRenderingStyle style,
-    const CGGlyph glyphs[], size_t count, CGSize advances[]);
-
 #if !PLATFORM(IOS)
 @interface NSFont (WebAppKitSecretAPI)
 - (BOOL)_isFakeFixedPitch;
index a92df13bcb8853698e6849193594ed3b3556cfab..81b998f7954f3935304046bbf3fc02a719ae526a 100644 (file)
 
 #if PLATFORM(IOS)
 
+#include "CoreGraphicsSPI.h"
 #include "MemoryPressureHandler.h"
 #include "SystemMemory.h"
 #include "LegacyTileGridTile.h"
 #include "LegacyTileLayer.h"
 #include "LegacyTileLayerPool.h"
 #include "WAKWindow.h"
-#include <CoreGraphics/CoreGraphicsPrivate.h>
 #include <QuartzCore/QuartzCore.h>
 #include <QuartzCore/QuartzCorePrivate.h>
 #include <algorithm>
index bf385968f4836dce96486c660f7b4c4cf970f198..7c40bc43006ba0b3cc3266ca3c0339786938596e 100644 (file)
@@ -29,7 +29,9 @@
 #if TARGET_OS_IPHONE
 
 #import <CoreGraphics/CoreGraphics.h>
-#import <CoreGraphics/CoreGraphicsPrivate.h>
+
+typedef int WKCompositeOperation;
+typedef uint32_t CGFontAntialiasingStyle;
 
 #ifdef __cplusplus
 extern "C" {
@@ -39,7 +41,7 @@ CGContextRef WKGetCurrentGraphicsContext(void);
 void WKSetCurrentGraphicsContext(CGContextRef context);
 
 void WKRectFill(CGContextRef context, CGRect aRect);
-void WKRectFillUsingOperation(CGContextRef context, CGRect aRect, CGCompositeOperation op);
+void WKRectFillUsingOperation(CGContextRef, CGRect, WKCompositeOperation);
 
 CGImageRef WKGraphicsCreateImageFromBundleWithName(const char *image_file);
 CGPatternRef WKCreatePatternFromCGImage(CGImageRef imageRef);
index 31c6ec02a999cb277e2cb40886fa4434f4421eca..ed96b08106f66a0a7f4976819208209dda8365a7 100644 (file)
@@ -28,8 +28,9 @@
 
 #if PLATFORM(IOS)
 
-#import "WebCoreSystemInterface.h"
+#import "CoreGraphicsSPI.h"
 #import "Font.h"
+#import "WebCoreSystemInterface.h"
 #import "WebCoreThread.h"
 #import <ImageIO/ImageIO.h>
 #import <wtf/StdLibExtras.h>
@@ -70,11 +71,12 @@ void WKRectFill(CGContextRef context, CGRect aRect)
     }
 }
 
-void WKRectFillUsingOperation(CGContextRef context, CGRect aRect, CGCompositeOperation op)
+void WKRectFillUsingOperation(CGContextRef context, CGRect aRect, WKCompositeOperation compositeOperation)
 {
+    COMPILE_ASSERT(sizeof(WKCompositeOperation) == sizeof(CGCompositeOperation), "WKCompositeOperation must be the same size as CGCompositeOperation.");
     if (aRect.size.width > 0 && aRect.size.height > 0.0) {
         CGContextSaveGState(context);
-        _FillRectUsingOperation(context, aRect, op);
+        _FillRectUsingOperation(context, aRect, static_cast<CGCompositeOperation>(compositeOperation));
         CGContextRestoreGState(context);
     }
 }
index 90f7171981506a528cdf48cf8f7c4b2a954048bc..734768b3ea15b5372c6da9a5b50c62ef943be1c8 100644 (file)
 #ifndef CoreGraphicsSPI_h
 #define CoreGraphicsSPI_h
 
+#include <CoreFoundation/CoreFoundation.h>
 #include <CoreGraphics/CoreGraphics.h>
 
 #if USE(APPLE_INTERNAL_SDK)
+
 #include <CoreGraphics/CGFontCache.h>
 #include <CoreGraphics/CoreGraphicsPrivate.h>
+
+#else
+struct CGFontHMetrics {
+    int ascent;
+    int descent;
+    int lineGap;
+    int maxAdvanceWidth;
+    int minLeftSideBearing;
+    int minRightSideBearing;
+};
+
+struct CGFontDescriptor {
+    CGRect bbox;
+    CGFloat ascent;
+    CGFloat descent;
+    CGFloat capHeight;
+    CGFloat italicAngle;
+    CGFloat stemV;
+    CGFloat stemH;
+    CGFloat avgWidth;
+    CGFloat maxWidth;
+    CGFloat missingWidth;
+    CGFloat leading;
+    CGFloat xHeight;
+};
+
+typedef const struct CGColorTransform* CGColorTransformRef;
+
+typedef enum {
+    kCGCompositeCopy = 1,
+    kCGCompositeSover = 2,
+} CGCompositeOperation;
+
+enum {
+    kCGFontRenderingStyleAntialiasing = 1 << 0,
+    kCGFontRenderingStyleSmoothing = 1 << 1,
+    kCGFontRenderingStyleSubpixelPositioning = 1 << 2,
+    kCGFontRenderingStyleSubpixelQuantization = 1 << 3,
+    kCGFontRenderingStylePlatformNative = 1 << 9,
+    kCGFontRenderingStyleMask = 0x20F,
+};
+typedef uint32_t CGFontRenderingStyle;
+
+enum {
+    kCGFontAntialiasingStyleUnfiltered = 0 << 7,
+    kCGFontAntialiasingStyleFilterLight = 1 << 7,
+};
+typedef uint32_t CGFontAntialiasingStyle;
+
+enum {
+    kCGImageCachingTransient = 1,
+    kCGImageCachingTemporary = 3,
+};
+typedef uint32_t CGImageCachingFlags;
+
+#if PLATFORM(COCOA)
+typedef struct CGSRegionEnumeratorObject* CGSRegionEnumeratorObj;
+typedef struct CGSRegionObject* CGSRegionObj;
+typedef struct CGSRegionObject* CGRegionRef;
 #endif
 
-extern "C" {
+#ifdef CGFLOAT_IS_DOUBLE
+#define CGRound(value) round((value))
+#define CGFloor(value) floor((value))
+#define CGFAbs(value) fabs((value))
+#else
+#define CGRound(value) roundf((value))
+#define CGFloor(value) floorf((value))
+#define CGFAbs(value) fabsf((value))
+#endif
+
+static inline CGFloat CGFloatMin(CGFloat a, CGFloat b) { return isnan(a) ? b : ((isnan(b) || a < b) ? a : b); }
 
 typedef struct CGFontCache CGFontCache;
 
-void CGFontGetGlyphsForUnichars(CGFontRef, const UniChar u[], CGGlyph glyphs[], size_t count);
-void CGContextSetShouldAntialiasFonts(CGContextRef, bool shouldAntialiasFonts);
-CGColorRef CGContextGetFillColorAsColor(CGContextRef);
-bool CGContextGetShouldSmoothFonts(CGContextRef);
-void CGFontSetShouldUseMulticache(bool);
+#endif // USE(APPLE_INTERNAL_SDK)
 
-#if PLATFORM(WIN)
-CGFontCache *CGFontCacheGetLocalCache();
-void CGFontCacheSetShouldAutoExpire(CGFontCache*, bool);
-void CGFontCacheSetMaxSize(CGFontCache*, size_t);
+EXTERN_C CGColorRef CGColorTransformConvertColor(CGColorTransformRef, CGColorRef, CGColorRenderingIntent);
+EXTERN_C CGColorTransformRef CGColorTransformCreate(CGColorSpaceRef, CFDictionaryRef attributes);
+
+EXTERN_C CGAffineTransform CGContextGetBaseCTM(CGContextRef);
+EXTERN_C CGCompositeOperation CGContextGetCompositeOperation(CGContextRef);
+EXTERN_C CGColorRef CGContextGetFillColorAsColor(CGContextRef);
+EXTERN_C CGFloat CGContextGetLineWidth(CGContextRef);
+EXTERN_C bool CGContextGetShouldSmoothFonts(CGContextRef);
+EXTERN_C void CGContextSetBaseCTM(CGContextRef, CGAffineTransform);
+EXTERN_C void CGContextSetCTM(CGContextRef, CGAffineTransform);
+EXTERN_C void CGContextSetCompositeOperation(CGContextRef, CGCompositeOperation);
+EXTERN_C void CGContextSetShouldAntialiasFonts(CGContextRef, bool shouldAntialiasFonts);
+
+EXTERN_C CFStringRef CGFontCopyFamilyName(CGFontRef);
+EXTERN_C bool CGFontGetDescriptor(CGFontRef, CGFontDescriptor*);
+EXTERN_C bool CGFontGetGlyphAdvancesForStyle(CGFontRef, const CGAffineTransform* , CGFontRenderingStyle, const CGGlyph[], size_t count, CGSize advances[]);
+EXTERN_C void CGFontGetGlyphsForUnichars(CGFontRef, const UniChar[], CGGlyph[], size_t count);
+EXTERN_C const CGFontHMetrics* CGFontGetHMetrics(CGFontRef);
+EXTERN_C const char* CGFontGetPostScriptName(CGFontRef);
+EXTERN_C bool CGFontIsFixedPitch(CGFontRef);
+EXTERN_C void CGFontSetShouldUseMulticache(bool);
+
+EXTERN_C void CGImageSetCachingFlags(CGImageRef, CGImageCachingFlags);
+
+#if PLATFORM(COCOA)
+EXTERN_C CGSRegionEnumeratorObj CGSRegionEnumerator(CGRegionRef);
+EXTERN_C CGRect* CGSNextRect(const CGSRegionEnumeratorObj);
+EXTERN_C CGError CGSReleaseRegionEnumerator(const CGSRegionEnumeratorObj);
 #endif
 
-}
+#if PLATFORM(WIN)
+EXTERN_C CGFontCache* CGFontCacheGetLocalCache();
+EXTERN_C void CGFontCacheSetShouldAutoExpire(CGFontCache*, bool);
+EXTERN_C void CGFontCacheSetMaxSize(CGFontCache*, size_t);
 #endif
+
+#endif // CoreGraphicsSPI_h
index efa16ce26970520c0f4267f7e43ef69c3a3eb374..dee91a04088c114e60ad128268654e41a2ce9e2a 100644 (file)
@@ -58,7 +58,7 @@
 #import "UserAgentScripts.h"
 #import "UserAgentStyleSheets.h"
 #import "WebCoreThreadRun.h"
-#import <CoreGraphics/CGPathPrivate.h>
+#import <CoreGraphics/CoreGraphics.h>
 #import <CoreText/CTFontDescriptorPriv.h>
 #import <objc/runtime.h>
 #import <wtf/NeverDestroyed.h>
index 73341a5de6418d534b87ad8609d6885e9eedcbeb..b9b5af61f200d0bbe380508a3212266ff9510550 100644 (file)
@@ -1,3 +1,14 @@
+2014-11-14  Daniel Bates  <dabates@apple.com>
+
+        [iOS] CoreGraphics SPI not available in public SDK
+        https://bugs.webkit.org/show_bug.cgi?id=138709
+
+        Reviewed by David Kilzer.
+
+        Include header CoreGraphicsSPI.h instead of the private header CGFloat.h.
+
+        * WebCoreSupport/WebFixedPositionContent.mm:
+
 2014-10-20  Andy Estes  <aestes@apple.com>
 
         Fix the iOS build.
index fab73055251503f94f7d621b99d113b25f90afb2..f8b610b0715732529b7b5968513de879655f26f4 100644 (file)
@@ -30,6 +30,7 @@
 
 #import "WebViewInternal.h"
 #import <WebCore/ChromeClient.h>
+#import <WebCore/CoreGraphicsSPI.h>
 #import <WebCore/Frame.h>
 #import <WebCore/IntSize.h>
 #import <WebCore/ScrollingConstraints.h>
@@ -40,9 +41,8 @@
 #import <wtf/StdLibExtras.h>
 #import <wtf/Threading.h>
 
-#import <CoreGraphics/CGFloat.h>
-#import <QuartzCore/QuartzCore.h>
 #import <Foundation/Foundation.h>
+#import <QuartzCore/QuartzCore.h>
 #import <algorithm>
 
 using namespace WebCore;
index b469a111e2daabe7c91061e8ef5888d58541657e..8b9abe712421a92f5d861397de2feb26f550c164 100644 (file)
@@ -1,3 +1,16 @@
+2014-11-14  Daniel Bates  <dabates@apple.com>
+
+        [iOS] CoreGraphics SPI not available in public SDK
+        https://bugs.webkit.org/show_bug.cgi?id=138709
+
+        Reviewed by David Kilzer.
+
+        Include header CoreGraphicsSPI.h instead of including headers of
+        CoreGraphics directly.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        * UIProcess/ios/WKScrollView.mm:
+
 2014-11-14  Tim Horton  <timothy_horton@apple.com>
 
         Move DataDetectors scanning code to WebCore
index 1f3de6f6b628ba171579a8fae8c5c1bded8fec9d..764fb48b8979b5e7e67b6cec24812bc0fdfc76eb 100644 (file)
 #import "WKWebViewContentProviderRegistry.h"
 #import "WebPageMessages.h"
 #import "WebVideoFullscreenManagerProxy.h"
-#import <CoreGraphics/CGFloat.h>
-#import <CoreGraphics/CGPDFDocumentPrivate.h>
 #import <UIKit/UIApplication.h>
 #import <UIKit/UIDevice_Private.h>
 #import <UIKit/UIPeripheralHost_Private.h>
 #import <UIKit/UIWindow_Private.h>
 #import <QuartzCore/CARenderServer.h>
 #import <QuartzCore/QuartzCorePrivate.h>
+#import <WebCore/CoreGraphicsSPI.h>
 #import <WebCore/InspectorOverlay.h>
 
 @interface UIScrollView (UIScrollViewInternal)
index 650865418b8c9793b6c8c2cc039b9a7ad256c722..d75d2f37b603cb4f0b41959824cee520769f56e9 100644 (file)
@@ -29,7 +29,7 @@
 #if PLATFORM(IOS)
 
 #import "WKWebViewInternal.h"
-#import <CoreGraphics/CGFloat.h>
+#import <WebCore/CoreGraphicsSPI.h>
 
 @interface UIScrollView (UIScrollViewInternalHack)
 - (CGFloat)_rubberBandOffsetForOffset:(CGFloat)newOffset maxOffset:(CGFloat)maxOffset minOffset:(CGFloat)minOffset range:(CGFloat)range outside:(BOOL *)outside;