Skip to content
Permalink
Browse files
[iOS] CoreGraphics SPI not available in public SDK
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:

Canonical link: https://commits.webkit.org/156598@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176140 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
dydz committed Nov 14, 2014
1 parent 4cf981d commit 69d6b2f35d16a1c25cf160cebd736aa0f6089dd4
Showing 26 changed files with 232 additions and 82 deletions.
@@ -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
@@ -19914,6 +19914,12 @@
<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" />
@@ -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"
@@ -5746,6 +5746,7 @@
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, ); }; };
@@ -23589,6 +23590,7 @@
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 */,
@@ -55,19 +55,7 @@
#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 {
@@ -39,10 +39,6 @@
#include <ApplicationServices/ApplicationServices.h>
#endif

#if PLATFORM(IOS)
#include <CoreGraphics/CGContextPrivate.h>
#endif

#if PLATFORM(COCOA)
#include "WebCoreSystemInterface.h"
#endif
@@ -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)

@@ -29,17 +29,17 @@
#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>

@@ -52,17 +52,9 @@
#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;

@@ -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
@@ -50,17 +50,6 @@
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");
@@ -30,10 +30,8 @@
#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"
@@ -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>
@@ -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>
@@ -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>

@@ -28,11 +28,11 @@
#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>
@@ -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
@@ -29,6 +29,7 @@

#import "BlockExceptions.h"
#import "Color.h"
#import "CoreGraphicsSPI.h"
#import "CoreTextSPI.h"
#import "FloatRect.h"
#import "Font.h"
@@ -53,13 +54,6 @@
#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;
@@ -28,13 +28,13 @@

#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>
@@ -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);
@@ -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);
}
}

0 comments on commit 69d6b2f

Please sign in to comment.