#import <QuartzCore/QuartzCore.h>
#import <WebCore/IOSurfaceSPI.h>
#if USE(APPLE_INTERNAL_SDK)
#include <QuartzCore/CABackingStore.h>
#include <QuartzCore/CAColorMatrix.h>
#include <QuartzCore/CARenderServer.h>
#ifdef __OBJC__
#import <QuartzCore/CAContext.h>
#import <QuartzCore/CALayerHost.h>
#import <QuartzCore/CALayerPrivate.h>
#import <QuartzCore/QuartzCorePrivate.h>
#if PLATFORM(IOS)
#import <QuartzCore/CADisplay.h>
#endif
#endif // __OBJC__
#else
#ifdef __OBJC__
@interface CAContext : NSObject
@end
@interface CAContext ()
+ (NSArray *)allContexts;
+ (CAContext *)remoteContextWithOptions:(NSDictionary *)dict;
+ (id)objectForSlot:(uint32_t)name;
- (uint32_t)createImageSlot:(CGSize)size hasAlpha:(BOOL)flag;
- (void)deleteSlot:(uint32_t)name;
- (void)invalidate;
- (void)invalidateFences;
- (mach_port_t)createFencePort;
- (void)setFencePort:(mach_port_t)port;
- (void)setFencePort:(mach_port_t)port commitHandler:(void(^)(void))block;
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
@property uint32_t commitPriority;
#endif
#if PLATFORM(MAC)
@property BOOL colorMatchUntaggedContent;
#endif
@property (readonly) uint32_t contextId;
@property (strong) CALayer *layer;
@property CGColorSpaceRef colorSpace;
@end
@interface CALayer ()
- (CAContext *)context;
- (CGSize)size;
- (void *)regionBeingDrawn;
- (void)setContentsChanged;
@property BOOL allowsGroupBlending;
@property BOOL canDrawConcurrently;
@property BOOL contentsOpaque;
@property BOOL hitTestsAsOpaque;
@property BOOL needsLayoutOnGeometryChange;
@property BOOL shadowPathIsBounds;
@end
#if PLATFORM(IOS)
@interface CADisplay : NSObject
@end
@interface CADisplay ()
@property (nonatomic, readonly) NSString *name;
@end
#endif
#if ENABLE(FILTERS_LEVEL_2)
@interface CABackdropLayer : CALayer
@property BOOL windowServerAware;
@end
#endif
struct CAColorMatrix {
float m11, m12, m13, m14, m15;
float m21, m22, m23, m24, m25;
float m31, m32, m33, m34, m35;
float m41, m42, m43, m44, m45;
};
typedef struct CAColorMatrix CAColorMatrix;
@interface NSValue (CADetails)
+ (NSValue *)valueWithCAColorMatrix:(CAColorMatrix)t;
@end
@interface CAFilter : NSObject <NSCopying, NSMutableCopying, NSCoding>
@end
@interface CAFilter ()
+ (CAFilter *)filterWithType:(NSString *)type;
@property (copy) NSString *name;
@end
typedef enum {
kCATransactionPhasePreLayout,
kCATransactionPhasePreCommit,
kCATransactionPhasePostCommit,
kCATransactionPhaseNull = ~0u
} CATransactionPhase;
@interface CATransaction ()
+ (void)addCommitHandler:(void(^)(void))block forPhase:(CATransactionPhase)phase;
#if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
+ (CATransactionPhase)currentPhase;
#endif
@end
@interface CALayerHost : CALayer
@property uint32_t contextId;
@property BOOL inheritsSecurity;
@end
@interface CASpringAnimation (Private)
@property CGFloat velocity;
@end
#endif // __OBJC__
#endif
WTF_EXTERN_C_BEGIN
#if !USE(APPLE_INTERNAL_SDK)
void CARenderServerCaptureLayerWithTransform(mach_port_t, uint32_t clientId, uint64_t layerId, uint32_t slotId, int32_t ox, int32_t oy, const CATransform3D*);
#if USE(IOSURFACE)
void CARenderServerRenderLayerWithTransform(mach_port_t server_port, uint32_t client_id, uint64_t layer_id, IOSurfaceRef, int32_t ox, int32_t oy, const CATransform3D*);
void CARenderServerRenderDisplayLayerWithTransformAndTimeOffset(mach_port_t, CFStringRef display_name, uint32_t client_id, uint64_t layer_id, IOSurfaceRef, int32_t ox, int32_t oy, const CATransform3D*, CFTimeInterval);
#else
typedef struct CARenderServerBuffer* CARenderServerBufferRef;
CARenderServerBufferRef CARenderServerCreateBuffer(size_t, size_t);
void CARenderServerDestroyBuffer(CARenderServerBufferRef);
size_t CARenderServerGetBufferWidth(CARenderServerBufferRef);
size_t CARenderServerGetBufferHeight(CARenderServerBufferRef);
size_t CARenderServerGetBufferRowBytes(CARenderServerBufferRef);
uint8_t* CARenderServerGetBufferData(CARenderServerBufferRef);
size_t CARenderServerGetBufferDataSize(CARenderServerBufferRef);
bool CARenderServerRenderLayerWithTransform(mach_port_t, uint32_t client_id, uint64_t layer_id, CARenderServerBufferRef, int32_t ox, int32_t oy, const CATransform3D*);
#endif
#endif
typedef struct _CAMachPort *CAMachPortRef;
CAMachPortRef CAMachPortCreate(mach_port_t);
mach_port_t CAMachPortGetPort(CAMachPortRef);
CFTypeID CAMachPortGetTypeID(void);
void CABackingStoreCollectBlocking(void);
WTF_EXTERN_C_END
extern NSString * const kCAFilterColorInvert;
extern NSString * const kCAFilterColorMatrix;
extern NSString * const kCAFilterColorMonochrome;
extern NSString * const kCAFilterColorHueRotate;
extern NSString * const kCAFilterColorSaturate;
extern NSString * const kCAFilterGaussianBlur;
extern NSString * const kCAFilterPlusD;
extern NSString * const kCAFilterPlusL;
extern NSString * const kCAFilterNormalBlendMode;
extern NSString * const kCAFilterMultiplyBlendMode;
extern NSString * const kCAFilterScreenBlendMode;
extern NSString * const kCAFilterOverlayBlendMode;
extern NSString * const kCAFilterDarkenBlendMode;
extern NSString * const kCAFilterLightenBlendMode;
extern NSString * const kCAFilterColorDodgeBlendMode;
extern NSString * const kCAFilterColorBurnBlendMode;
extern NSString * const kCAFilterSoftLightBlendMode;
extern NSString * const kCAFilterHardLightBlendMode;
extern NSString * const kCAFilterDifferenceBlendMode;
extern NSString * const kCAFilterExclusionBlendMode;
extern NSString * const kCAContextDisplayName;
extern NSString * const kCAContextDisplayId;
extern NSString * const kCAContextIgnoresHitTest;
#if PLATFORM(IOS)
extern NSString * const kCAContentsFormatRGBA10XR;
#endif
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
extern NSString * const kCAContentsFormatRGBA8ColorRGBA8LinearGlyphMask;
#endif
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED < 101200
@protocol CALayerDelegate <NSObject>
@end
@protocol CAAnimationDelegate <NSObject>
@end
#endif // USE(APPLE_INTERNAL_SDK)