#ifndef IOSurfaceSPI_h
#define IOSurfaceSPI_h
#if !PLATFORM(IOS_SIMULATOR)
#if PLATFORM(MAC) || USE(APPLE_INTERNAL_SDK)
#include <IOSurface/IOSurface.h>
#else
#include "IOReturnSPI.h"
#include "IOTypesSPI.h"
#include <CoreFoundation/CFBase.h>
#include <mach/mach_port.h>
typedef struct __IOSurface *IOSurfaceRef;
enum {
kIOSurfaceLockReadOnly = 0x00000001,
};
#endif
WTF_EXTERN_C_BEGIN
extern const CFStringRef kIOSurfaceAllocSize;
extern const CFStringRef kIOSurfaceBytesPerElement;
extern const CFStringRef kIOSurfaceBytesPerRow;
extern const CFStringRef kIOSurfaceCacheMode;
extern const CFStringRef kIOSurfaceHeight;
extern const CFStringRef kIOSurfacePixelFormat;
extern const CFStringRef kIOSurfaceWidth;
size_t IOSurfaceAlignProperty(CFStringRef property, size_t value);
IOSurfaceRef IOSurfaceCreate(CFDictionaryRef properties);
mach_port_t IOSurfaceCreateMachPort(IOSurfaceRef buffer);
size_t IOSurfaceGetAllocSize(IOSurfaceRef buffer);
void *IOSurfaceGetBaseAddress(IOSurfaceRef buffer);
size_t IOSurfaceGetBytesPerRow(IOSurfaceRef buffer);
size_t IOSurfaceGetHeight(IOSurfaceRef buffer);
size_t IOSurfaceGetPropertyMaximum(CFStringRef property);
size_t IOSurfaceGetWidth(IOSurfaceRef buffer);
Boolean IOSurfaceIsInUse(IOSurfaceRef buffer);
IOReturn IOSurfaceLock(IOSurfaceRef buffer, uint32_t options, uint32_t *seed);
IOSurfaceRef IOSurfaceLookupFromMachPort(mach_port_t);
IOReturn IOSurfaceUnlock(IOSurfaceRef buffer, uint32_t options, uint32_t *seed);
WTF_EXTERN_C_END
#if USE(APPLE_INTERNAL_SDK)
#import <IOSurface/IOSurfacePrivate.h>
#else
enum {
kIOSurfacePurgeableNonVolatile = 0,
kIOSurfacePurgeableVolatile = 1,
kIOSurfacePurgeableEmpty = 2,
kIOSurfacePurgeableKeepCurrent = 3,
};
#endif
WTF_EXTERN_C_BEGIN
IOReturn IOSurfaceSetPurgeable(IOSurfaceRef buffer, uint32_t newState, uint32_t *oldState);
WTF_EXTERN_C_END
#endif
#endif // IOSurfaceSPI_h