Diff
Modified: trunk/Source/WTF/ChangeLog (228852 => 228853)
--- trunk/Source/WTF/ChangeLog 2018-02-21 01:08:28 UTC (rev 228852)
+++ trunk/Source/WTF/ChangeLog 2018-02-21 01:32:26 UTC (rev 228853)
@@ -1,3 +1,13 @@
+2018-02-20 Tim Horton <[email protected]>
+
+ Introduce HAVE(IOSURFACE_ACCELERATOR)
+ https://bugs.webkit.org/show_bug.cgi?id=182955
+ <rdar://problem/37699510>
+
+ Reviewed by Sam Weinig.
+
+ * wtf/Platform.h:
+
2018-02-20 Chris Dumez <[email protected]>
Provisional load may get committed before receiving the decidePolicyForNavigationResponse response
Modified: trunk/Source/WTF/wtf/Platform.h (228852 => 228853)
--- trunk/Source/WTF/wtf/Platform.h 2018-02-21 01:08:28 UTC (rev 228852)
+++ trunk/Source/WTF/wtf/Platform.h 2018-02-21 01:32:26 UTC (rev 228853)
@@ -1204,9 +1204,13 @@
#endif
#if PLATFORM(COCOA) && !PLATFORM(IOS_SIMULATOR)
-#define USE_IOSURFACE 1
+#define HAVE_IOSURFACE 1
#endif
+#if PLATFORM(IOS) && !PLATFORM(IOS_SIMULATOR)
+#define HAVE_IOSURFACE_ACCELERATOR 1
+#endif
+
#if PLATFORM(COCOA)
#define ENABLE_RESOURCE_USAGE 1
#endif
Modified: trunk/Source/WebCore/ChangeLog (228852 => 228853)
--- trunk/Source/WebCore/ChangeLog 2018-02-21 01:08:28 UTC (rev 228852)
+++ trunk/Source/WebCore/ChangeLog 2018-02-21 01:32:26 UTC (rev 228853)
@@ -1,3 +1,29 @@
+2018-02-20 Tim Horton <[email protected]>
+
+ Introduce HAVE(IOSURFACE_ACCELERATOR)
+ https://bugs.webkit.org/show_bug.cgi?id=182955
+ <rdar://problem/37699510>
+
+ Reviewed by Sam Weinig.
+
+ No new tests, no change in behavior.
+
+ Introduce HAVE(IOSURFACE_ACCELERATOR) and guard all uses of
+ IOSurfaceAccelerator behind it.
+
+ Rename USE(IOSURFACE) to HAVE(IOSURFACE) for accuracy.
+
+ * page/cocoa/MemoryReleaseCocoa.mm:
+ * platform/graphics/ca/TileController.cpp:
+ * platform/graphics/cg/IOSurfacePool.cpp:
+ * platform/graphics/cg/IOSurfacePool.h:
+ * platform/graphics/cg/ImageBufferCG.cpp:
+ * platform/graphics/cocoa/IOSurface.h:
+ * platform/graphics/cocoa/IOSurface.mm:
+ * platform/graphics/cocoa/IOSurfacePoolCocoa.mm:
+ * platform/graphics/cv/VideoTextureCopierCV.cpp:
+ * platform/graphics/cv/VideoTextureCopierCV.h:
+
2018-02-20 Chris Dumez <[email protected]>
Provisional load may get committed before receiving the decidePolicyForNavigationResponse response
Modified: trunk/Source/WebCore/Configurations/WebCore.xcconfig (228852 => 228853)
--- trunk/Source/WebCore/Configurations/WebCore.xcconfig 2018-02-21 01:08:28 UTC (rev 228852)
+++ trunk/Source/WebCore/Configurations/WebCore.xcconfig 2018-02-21 01:32:26 UTC (rev 228853)
@@ -80,7 +80,7 @@
OTHER_LDFLAGS_BASE = -lsqlite3 -lobjc -lANGLE -framework CoreAudio -framework Metal -allowable_client WebCoreTestSupport -allowable_client WebKitLegacy -force_load $(BUILT_PRODUCTS_DIR)/libPAL.a;
// FIXME: Reduce the number of allowable_client <rdar://problem/31823969>
OTHER_LDFLAGS_BASE_ios = $(OTHER_LDFLAGS_BASE) -framework CFNetwork -framework CoreGraphics -framework CoreText -framework Foundation -framework ImageIO -framework MobileCoreServices -framework OpenGLES -lMobileGestalt $(WK_IOS_BINCOMPAT_LDFLAGS) -allowable_client WebKit -allowable_client iTunesU -allowable_client Casablanca -allowable_client Remote -allowable_client TVBooks -allowable_client DumpRenderTree -allowable_client WebKitTestRunner -allowable_client TestWebKitAPI;
-OTHER_LDFLAGS_PLATFORM[sdk=iphoneos*] = $(OTHER_LDFLAGS_BASE_ios) -framework IOSurface -framework GraphicsServices $(LIBWEBRTC_LDFLAGS);
+OTHER_LDFLAGS_PLATFORM[sdk=iphoneos*] = $(OTHER_LDFLAGS_BASE_ios) -framework IOSurface -framework IOSurfaceAccelerator -framework GraphicsServices $(LIBWEBRTC_LDFLAGS);
OTHER_LDFLAGS_PLATFORM[sdk=iphonesimulator*] = $(OTHER_LDFLAGS_BASE_ios) $(LIBWEBRTC_LDFLAGS);
OTHER_LDFLAGS_PLATFORM[sdk=macosx*] = $(OTHER_LDFLAGS_BASE) -sub_library libobjc -umbrella WebKit -framework ApplicationServices -framework AudioUnit -framework Carbon -framework Cocoa -framework DataDetectorsCore -framework IOSurface -framework OpenGL -framework SystemConfiguration $(LIBWEBRTC_LDFLAGS);
Modified: trunk/Source/WebCore/PAL/ChangeLog (228852 => 228853)
--- trunk/Source/WebCore/PAL/ChangeLog 2018-02-21 01:08:28 UTC (rev 228852)
+++ trunk/Source/WebCore/PAL/ChangeLog 2018-02-21 01:32:26 UTC (rev 228853)
@@ -1,3 +1,15 @@
+2018-02-20 Tim Horton <[email protected]>
+
+ Introduce HAVE(IOSURFACE_ACCELERATOR)
+ https://bugs.webkit.org/show_bug.cgi?id=182955
+ <rdar://problem/37699510>
+
+ Reviewed by Sam Weinig.
+
+ * pal/spi/cg/CoreGraphicsSPI.h:
+ * pal/spi/cocoa/IOSurfaceSPI.h:
+ * pal/spi/cocoa/QuartzCoreSPI.h:
+
2018-02-15 Tim Horton <[email protected]>
Stop using EXCLUDED_SOURCE_FILE_NAMES for actual source files in WebCore
Modified: trunk/Source/WebCore/PAL/pal/spi/cg/CoreGraphicsSPI.h (228852 => 228853)
--- trunk/Source/WebCore/PAL/pal/spi/cg/CoreGraphicsSPI.h 2018-02-21 01:08:28 UTC (rev 228852)
+++ trunk/Source/WebCore/PAL/pal/spi/cg/CoreGraphicsSPI.h 2018-02-21 01:32:26 UTC (rev 228853)
@@ -28,7 +28,7 @@
#include <CoreFoundation/CoreFoundation.h>
#include <CoreGraphics/CoreGraphics.h>
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
#include <pal/spi/cocoa/IOSurfaceSPI.h>
#endif
@@ -249,7 +249,7 @@
bool CGContextDrawsWithCorrectShadowOffsets(CGContextRef);
CGPatternRef CGPatternCreateWithImage2(CGImageRef, CGAffineTransform, CGPatternTiling);
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
CGContextRef CGIOSurfaceContextCreate(IOSurfaceRef, size_t, size_t, size_t, size_t, CGColorSpaceRef, CGBitmapInfo);
CGImageRef CGIOSurfaceContextCreateImage(CGContextRef);
CGImageRef CGIOSurfaceContextCreateImageReference(CGContextRef);
Modified: trunk/Source/WebCore/PAL/pal/spi/cocoa/IOSurfaceSPI.h (228852 => 228853)
--- trunk/Source/WebCore/PAL/pal/spi/cocoa/IOSurfaceSPI.h 2018-02-21 01:08:28 UTC (rev 228852)
+++ trunk/Source/WebCore/PAL/pal/spi/cocoa/IOSurfaceSPI.h 2018-02-21 01:32:26 UTC (rev 228853)
@@ -25,7 +25,7 @@
#pragma once
-#if !PLATFORM(IOS_SIMULATOR)
+#if HAVE(IOSURFACE)
#if PLATFORM(MAC) || USE(APPLE_INTERNAL_SDK)
@@ -113,7 +113,7 @@
WTF_EXTERN_C_END
-#if PLATFORM(IOS)
+#if HAVE(IOSURFACE_ACCELERATOR)
#if USE(APPLE_INTERNAL_SDK)
#import <IOSurfaceAccelerator/IOSurfaceAccelerator.h>
@@ -128,6 +128,8 @@
WTF_EXTERN_C_BEGIN
+extern const CFStringRef kIOSurfaceAcceleratorUnwireSurfaceKey;
+
IOReturn IOSurfaceAcceleratorCreate(CFAllocatorRef, CFDictionaryRef properties, IOSurfaceAcceleratorRef* acceleratorOut);
CFRunLoopSourceRef IOSurfaceAcceleratorGetRunLoopSource(IOSurfaceAcceleratorRef);
@@ -144,6 +146,6 @@
WTF_EXTERN_C_END
#endif // USE(APPLE_INTERNAL_SDK)
-#endif // PLATFORM(IOS)
+#endif // HAVE(IOSURFACE_ACCELERATOR)
-#endif // !PLATFORM(IOS_SIMULATOR)
+#endif // HAVE(IOSURFACE)
Modified: trunk/Source/WebCore/PAL/pal/spi/cocoa/QuartzCoreSPI.h (228852 => 228853)
--- trunk/Source/WebCore/PAL/pal/spi/cocoa/QuartzCoreSPI.h 2018-02-21 01:08:28 UTC (rev 228852)
+++ trunk/Source/WebCore/PAL/pal/spi/cocoa/QuartzCoreSPI.h 2018-02-21 01:32:26 UTC (rev 228853)
@@ -170,7 +170,7 @@
#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)
+#if HAVE(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
Modified: trunk/Source/WebCore/page/cocoa/MemoryReleaseCocoa.mm (228852 => 228853)
--- trunk/Source/WebCore/page/cocoa/MemoryReleaseCocoa.mm 2018-02-21 01:08:28 UTC (rev 228852)
+++ trunk/Source/WebCore/page/cocoa/MemoryReleaseCocoa.mm 2018-02-21 01:32:26 UTC (rev 228853)
@@ -56,7 +56,7 @@
tileControllerMemoryHandler().trimUnparentedTilesToTarget(0);
#endif
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
IOSurfacePool::sharedPool().discardAllSurfaces();
#endif
}
Modified: trunk/Source/WebCore/platform/graphics/ca/TileController.cpp (228852 => 228853)
--- trunk/Source/WebCore/platform/graphics/ca/TileController.cpp 2018-02-21 01:08:28 UTC (rev 228852)
+++ trunk/Source/WebCore/platform/graphics/ca/TileController.cpp 2018-02-21 01:32:26 UTC (rev 228853)
@@ -38,7 +38,7 @@
#include <wtf/MainThread.h>
#include <wtf/text/TextStream.h>
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
#include "IOSurface.h"
#endif
@@ -534,7 +534,7 @@
const int kLowestCommonDenominatorMaxTileSize = 4 * 1024;
IntSize maxTileSize(kLowestCommonDenominatorMaxTileSize, kLowestCommonDenominatorMaxTileSize);
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
IntSize surfaceSizeLimit = IOSurface::maximumSize();
surfaceSizeLimit.scale(1 / m_deviceScaleFactor);
maxTileSize = maxTileSize.shrunkTo(surfaceSizeLimit);
Modified: trunk/Source/WebCore/platform/graphics/cg/IOSurfacePool.cpp (228852 => 228853)
--- trunk/Source/WebCore/platform/graphics/cg/IOSurfacePool.cpp 2018-02-21 01:08:28 UTC (rev 228852)
+++ trunk/Source/WebCore/platform/graphics/cg/IOSurfacePool.cpp 2018-02-21 01:32:26 UTC (rev 228853)
@@ -26,7 +26,7 @@
#include "config.h"
#include "IOSurfacePool.h"
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
#include "GraphicsContextCG.h"
#include <CoreGraphics/CoreGraphics.h>
@@ -383,4 +383,4 @@
}
}
-#endif // USE(IOSURFACE)
+#endif // HAVE(IOSURFACE)
Modified: trunk/Source/WebCore/platform/graphics/cg/IOSurfacePool.h (228852 => 228853)
--- trunk/Source/WebCore/platform/graphics/cg/IOSurfacePool.h 2018-02-21 01:08:28 UTC (rev 228852)
+++ trunk/Source/WebCore/platform/graphics/cg/IOSurfacePool.h 2018-02-21 01:32:26 UTC (rev 228853)
@@ -25,7 +25,7 @@
#pragma once
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
#include "IOSurface.h"
#include "IntSize.h"
@@ -103,4 +103,4 @@
};
}
-#endif // USE(IOSURFACE)
+#endif // HAVE(IOSURFACE)
Modified: trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp (228852 => 228853)
--- trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp 2018-02-21 01:08:28 UTC (rev 228852)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp 2018-02-21 01:32:26 UTC (rev 228853)
@@ -79,7 +79,7 @@
case kCGContextTypeBitmap:
colorSpace = CGBitmapContextGetColorSpace(cgContext);
break;
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
case kCGContextTypeIOSurface:
colorSpace = CGIOSurfaceContextGetColorSpace(cgContext);
break;
Modified: trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h (228852 => 228853)
--- trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h 2018-02-21 01:08:28 UTC (rev 228852)
+++ trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h 2018-02-21 01:32:26 UTC (rev 228853)
@@ -25,7 +25,7 @@
#pragma once
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
#include <objc/objc.h>
#include "GraphicsContext.h"
@@ -134,10 +134,10 @@
// an accurate result from isInUse(), it needs to be released.
WEBCORE_EXPORT void releaseGraphicsContext();
-#if PLATFORM(IOS)
+#if HAVE(IOSURFACE_ACCELERATOR)
WEBCORE_EXPORT static bool allowConversionFromFormatToFormat(Format, Format);
WEBCORE_EXPORT static void convertToFormat(std::unique_ptr<WebCore::IOSurface>&& inSurface, Format, WTF::Function<void(std::unique_ptr<WebCore::IOSurface>)>&&);
-#endif
+#endif // HAVE(IOSURFACE_ACCELERATOR)
void migrateColorSpaceToProperties();
@@ -164,5 +164,5 @@
} // namespace WebCore
-#endif // USE(IOSURFACE)
+#endif // HAVE(IOSURFACE)
Modified: trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm (228852 => 228853)
--- trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm 2018-02-21 01:08:28 UTC (rev 228852)
+++ trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm 2018-02-21 01:32:26 UTC (rev 228853)
@@ -26,7 +26,7 @@
#import "config.h"
#import "IOSurface.h"
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
#import "GraphicsContextCG.h"
#import "IOSurfacePool.h"
@@ -40,11 +40,6 @@
#import <wtf/MathExtras.h>
#import <wtf/text/TextStream.h>
-#if PLATFORM(IOS)
-// Move this into the SPI header once it's possible to put inside the APPLE_INTERNAL_SDK block.
-NSString * const WebIOSurfaceAcceleratorUnwireSurfaceKey = @"UnwireSurface";
-#endif
-
namespace WebCore {
inline std::unique_ptr<IOSurface> IOSurface::surfaceFromPool(IntSize size, IntSize contextSize, CGColorSpaceRef colorSpace, Format pixelFormat)
@@ -388,7 +383,8 @@
m_cgContext = nullptr;
}
-#if PLATFORM(IOS)
+#if HAVE(IOSURFACE_ACCELERATOR)
+
bool IOSurface::allowConversionFromFormatToFormat(Format sourceFormat, Format destFormat)
{
if ((sourceFormat == Format::RGB10 || sourceFormat == Format::RGB10A8) && destFormat == Format::YUV422)
@@ -430,13 +426,14 @@
delete callback;
};
- NSDictionary *options = @{ WebIOSurfaceAcceleratorUnwireSurfaceKey : @YES };
+ NSDictionary *options = @{ (id)kIOSurfaceAcceleratorUnwireSurfaceKey : @YES };
IOReturn ret = IOSurfaceAcceleratorTransformSurface(accelerator, inSurface->surface(), destinationIOSurfaceRef, (CFDictionaryRef)options, nullptr, &completion, nullptr, nullptr);
ASSERT_UNUSED(ret, ret == kIOReturnSuccess);
}
-#endif // PLATFORM(IOS)
+#endif // HAVE(IOSURFACE_ACCELERATOR)
+
void IOSurface::migrateColorSpaceToProperties()
{
auto colorSpaceProperties = adoptCF(CGColorSpaceCopyPropertyList(m_colorSpace.get()));
@@ -482,4 +479,4 @@
} // namespace WebCore
-#endif // USE(IOSURFACE)
+#endif // HAVE(IOSURFACE)
Modified: trunk/Source/WebCore/platform/graphics/cocoa/IOSurfacePoolCocoa.mm (228852 => 228853)
--- trunk/Source/WebCore/platform/graphics/cocoa/IOSurfacePoolCocoa.mm 2018-02-21 01:08:28 UTC (rev 228852)
+++ trunk/Source/WebCore/platform/graphics/cocoa/IOSurfacePoolCocoa.mm 2018-02-21 01:32:26 UTC (rev 228853)
@@ -26,7 +26,7 @@
#import "config.h"
#import "IOSurfacePool.h"
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
#include <QuartzCore/QuartzCore.h>
@@ -40,4 +40,4 @@
}
-#endif // USE(IOSURFACE)
+#endif // HAVE(IOSURFACE)
Modified: trunk/Source/WebCore/platform/graphics/cv/VideoTextureCopierCV.cpp (228852 => 228853)
--- trunk/Source/WebCore/platform/graphics/cv/VideoTextureCopierCV.cpp 2018-02-21 01:08:28 UTC (rev 228852)
+++ trunk/Source/WebCore/platform/graphics/cv/VideoTextureCopierCV.cpp 2018-02-21 01:32:26 UTC (rev 228853)
@@ -41,7 +41,7 @@
namespace WebCore {
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
enum class PixelRange {
Unknown,
Video,
@@ -368,7 +368,7 @@
ASSERT(iterator != matrices.get().end());
return iterator->second;
}
-#endif // USE(IOSURFACE)
+#endif // HAVE(IOSURFACE)
VideoTextureCopierCV::VideoTextureCopierCV(GraphicsContext3D& context)
: m_sharedContext(context)
@@ -728,7 +728,7 @@
return copyVideoTextureToPlatformTexture(texture.get(), width, height, outputTexture, outputTarget, level, internalFormat, format, type, premultiplyAlpha, flipY, swapColorChannels);
}
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
// FIXME: This currently only supports '420v' and '420f' pixel formats. Investigate supporting more pixel formats.
OSType pixelFormat = CVPixelBufferGetPixelFormatType(image);
if (pixelFormat != kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange && pixelFormat != kCVPixelFormatType_420YpCbCr8BiPlanarFullRange) {
@@ -846,7 +846,7 @@
return true;
#else
return false;
-#endif // USE(IOSURFACE)
+#endif // HAVE(IOSURFACE)
}
bool VideoTextureCopierCV::copyVideoTextureToPlatformTexture(TextureType inputVideoTexture, size_t width, size_t height, Platform3DObject outputTexture, GC3Denum outputTarget, GC3Dint level, GC3Denum internalFormat, GC3Denum format, GC3Denum type, bool premultiplyAlpha, bool flipY, bool swapColorChannels)
Modified: trunk/Source/WebCore/platform/graphics/cv/VideoTextureCopierCV.h (228852 => 228853)
--- trunk/Source/WebCore/platform/graphics/cv/VideoTextureCopierCV.h 2018-02-21 01:08:28 UTC (rev 228852)
+++ trunk/Source/WebCore/platform/graphics/cv/VideoTextureCopierCV.h 2018-02-21 01:32:26 UTC (rev 228853)
@@ -60,7 +60,7 @@
bool initializeContextObjects();
bool initializeUVContextObjects();
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
unsigned lastTextureSeed(GC3Duint texture)
{
auto iterator = m_lastTextureSeed.find(texture);
@@ -90,7 +90,7 @@
GC3Dint m_yTextureSizeUniformLocation { -1 };
GC3Dint m_uvTextureSizeUniformLocation { -1 };
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
bool m_lastFlipY { false };
UnsafePointer<IOSurfaceRef> m_lastSurface;
uint32_t m_lastSurfaceSeed { 0 };
Modified: trunk/Source/WebKit/ChangeLog (228852 => 228853)
--- trunk/Source/WebKit/ChangeLog 2018-02-21 01:08:28 UTC (rev 228852)
+++ trunk/Source/WebKit/ChangeLog 2018-02-21 01:32:26 UTC (rev 228853)
@@ -1,3 +1,20 @@
+2018-02-20 Tim Horton <[email protected]>
+
+ Introduce HAVE(IOSURFACE_ACCELERATOR)
+ https://bugs.webkit.org/show_bug.cgi?id=182955
+ <rdar://problem/37699510>
+
+ Reviewed by Sam Weinig.
+
+ * Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
+ * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
+ * Shared/cg/ShareableBitmapCG.cpp:
+ * UIProcess/API/Cocoa/WKWebView.mm:
+ * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
+ * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
+ * UIProcess/mac/ViewSnapshotStore.h:
+ * UIProcess/mac/ViewSnapshotStore.mm:
+
2018-02-20 Chris Dumez <[email protected]>
Provisional load may get committed before receiving the decidePolicyForNavigationResponse response
Modified: trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.h (228852 => 228853)
--- trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.h 2018-02-21 01:08:28 UTC (rev 228852)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.h 2018-02-21 01:32:26 UTC (rev 228853)
@@ -75,7 +75,7 @@
bool hasFrontBuffer() const
{
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
if (m_acceleratesDrawing)
return !!m_frontBuffer.surface;
#endif
@@ -99,7 +99,7 @@
void clearBackingStore();
void swapToValidFrontBuffer();
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
WebCore::IOSurface::Format surfaceBufferFormat() const;
#endif
@@ -115,7 +115,7 @@
struct Buffer {
RefPtr<ShareableBitmap> bitmap;
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
std::unique_ptr<WebCore::IOSurface> surface;
bool isVolatile = false;
#endif
@@ -122,7 +122,7 @@
explicit operator bool() const
{
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
if (surface)
return true;
#endif
@@ -137,7 +137,7 @@
Buffer m_frontBuffer;
Buffer m_backBuffer;
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
Buffer m_secondaryBackBuffer;
WebCore::MachSendRight m_frontBufferSendRight;
#endif
Modified: trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm (228852 => 228853)
--- trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm 2018-02-21 01:08:28 UTC (rev 228852)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm 2018-02-21 01:32:26 UTC (rev 228853)
@@ -40,7 +40,7 @@
#import <WebCore/WebLayer.h>
#import <pal/spi/cocoa/QuartzCoreSPI.h>
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
#import <mach/mach_port.h>
#endif
@@ -72,7 +72,7 @@
void RemoteLayerBackingStore::ensureBackingStore(FloatSize size, float scale, bool acceleratesDrawing, bool deepColor, bool isOpaque)
{
-#if !USE(IOSURFACE)
+#if !HAVE(IOSURFACE)
acceleratesDrawing = false;
#endif
if (m_size == size && m_scale == scale && m_deepColor == deepColor && m_acceleratesDrawing == acceleratesDrawing && m_isOpaque == isOpaque)
@@ -97,7 +97,7 @@
{
m_frontBuffer.discard();
m_backBuffer.discard();
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
m_secondaryBackBuffer.discard();
#endif
}
@@ -109,7 +109,7 @@
encoder << m_acceleratesDrawing;
encoder << m_isOpaque;
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
if (m_acceleratesDrawing) {
if (m_frontBuffer.surface)
encoder << m_frontBuffer.surface->createSendRight();
@@ -140,7 +140,7 @@
if (!decoder.decode(result.m_isOpaque))
return false;
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
if (result.m_acceleratesDrawing) {
MachSendRight sendRight;
if (!decoder.decode(sendRight))
@@ -179,7 +179,7 @@
unsigned RemoteLayerBackingStore::bytesPerPixel() const
{
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
switch (surfaceBufferFormat()) {
case WebCore::IOSurface::Format::RGBA: return 4;
case WebCore::IOSurface::Format::YUV422: return 2;
@@ -194,7 +194,7 @@
{
IntSize expandedScaledSize = backingStoreSize();
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
if (m_acceleratesDrawing) {
if (!m_backBuffer.surface || m_backBuffer.surface->isInUse()) {
std::swap(m_backBuffer, m_secondaryBackBuffer);
@@ -254,7 +254,7 @@
swapToValidFrontBuffer();
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
if (m_acceleratesDrawing) {
RetainPtr<CGImageRef> backImage;
if (m_backBuffer.surface && !willPaintEntireBackingStore)
@@ -399,7 +399,7 @@
{
layer.contentsOpaque = m_isOpaque;
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
if (acceleratesDrawing()) {
switch (contentsType) {
case LayerContentsType::IOSurface:
@@ -427,7 +427,7 @@
return WTFMove(m_frontContextPendingFlush);
}
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
bool RemoteLayerBackingStore::setBufferVolatility(BufferType type, bool isVolatile)
{
switch (type) {
@@ -480,7 +480,7 @@
void RemoteLayerBackingStore::Buffer::discard()
{
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
if (surface)
WebCore::IOSurface::moveToPool(WTFMove(surface));
isVolatile = false;
@@ -488,7 +488,7 @@
bitmap = nullptr;
}
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
WebCore::IOSurface::Format RemoteLayerBackingStore::surfaceBufferFormat() const
{
if (m_deepColor)
@@ -496,6 +496,6 @@
return WebCore::IOSurface::Format::RGBA;
}
-#endif // USE(IOSURFACE)
+#endif // HAVE(IOSURFACE)
} // namespace WebKit
Modified: trunk/Source/WebKit/Shared/cg/ShareableBitmapCG.cpp (228852 => 228853)
--- trunk/Source/WebKit/Shared/cg/ShareableBitmapCG.cpp 2018-02-21 01:08:28 UTC (rev 228852)
+++ trunk/Source/WebKit/Shared/cg/ShareableBitmapCG.cpp 2018-02-21 01:32:26 UTC (rev 228853)
@@ -73,7 +73,7 @@
Checked<unsigned, RecordOverflow> ShareableBitmap::calculateBytesPerRow(WebCore::IntSize size, const Configuration& configuration)
{
unsigned bytesPerRow = calculateBytesPerPixel(configuration) * size.width();
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
return IOSurfaceAlignProperty(kIOSurfaceBytesPerRow, bytesPerRow);
#else
return bytesPerRow;
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (228852 => 228853)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm 2018-02-21 01:08:28 UTC (rev 228852)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm 2018-02-21 01:32:26 UTC (rev 228853)
@@ -1871,7 +1871,7 @@
CATransform3D transform = CATransform3DMakeScale(deviceScale, deviceScale, 1);
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
WebCore::IOSurface::Format snapshotFormat = WebCore::screenSupportsExtendedColor() ? WebCore::IOSurface::Format::RGB10 : WebCore::IOSurface::Format::RGBA;
auto surface = WebCore::IOSurface::create(WebCore::expandedIntSize(snapshotSize), WebCore::sRGBColorSpaceRef(), snapshotFormat);
if (!surface)
@@ -1878,6 +1878,7 @@
return nullptr;
CARenderServerRenderLayerWithTransform(MACH_PORT_NULL, self.layer.context.contextId, reinterpret_cast<uint64_t>(self.layer), surface->surface(), 0, 0, &transform);
+#if HAVE(IOSURFACE_ACCELERATOR)
WebCore::IOSurface::Format compressedFormat = WebCore::IOSurface::Format::YUV422;
if (WebCore::IOSurface::allowConversionFromFormatToFormat(snapshotFormat, compressedFormat)) {
RefPtr<WebKit::ViewSnapshot> viewSnapshot = WebKit::ViewSnapshot::create(nullptr);
@@ -1888,9 +1889,10 @@
return viewSnapshot;
}
+#endif // HAVE(IOSURFACE_ACCELERATOR)
return WebKit::ViewSnapshot::create(WTFMove(surface));
-#else
+#else // HAVE(IOSURFACE)
uint32_t slotID = [WebKit::ViewSnapshotStore::snapshottingContext() createImageSlot:snapshotSize hasAlpha:YES];
if (!slotID)
@@ -1899,7 +1901,7 @@
CARenderServerCaptureLayerWithTransform(MACH_PORT_NULL, self.layer.context.contextId, (uint64_t)self.layer, slotID, 0, 0, &transform);
WebCore::IntSize imageSize = WebCore::expandedIntSize(WebCore::FloatSize(snapshotSize));
return WebKit::ViewSnapshot::create(slotID, imageSize, (imageSize.area() * 4).unsafeGet());
-#endif
+#endif // HAVE(IOSURFACE)
}
- (void)_zoomToPoint:(WebCore::FloatPoint)point atScale:(double)scale animated:(BOOL)animated
@@ -5261,7 +5263,7 @@
CGFloat imageHeight = imageScale * snapshotRectInContentCoordinates.size.height;
CGSize imageSize = CGSizeMake(imageWidth, imageHeight);
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
// If we are parented and thus won't incur a significant penalty from paging in tiles, snapshot the view hierarchy directly.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
Modified: trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm (228852 => 228853)
--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm 2018-02-21 01:08:28 UTC (rev 228852)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm 2018-02-21 01:32:26 UTC (rev 228853)
@@ -110,7 +110,7 @@
: DrawingAreaProxy(DrawingAreaTypeRemoteLayerTree, webPageProxy)
, m_remoteLayerTreeHost(*this)
{
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
// We don't want to pool surfaces in the UI process.
// FIXME: We should do this somewhere else.
IOSurfacePool::sharedPool().setPoolSize(0);
Modified: trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm (228852 => 228853)
--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm 2018-02-21 01:08:28 UTC (rev 228852)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm 2018-02-21 01:32:26 UTC (rev 228853)
@@ -289,7 +289,7 @@
m_rootLayer = nullptr;
}
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
static void recursivelyMapIOSurfaceBackingStore(CALayer *layer)
{
if (layer.contents && CFGetTypeID(layer.contents) == CAMachPortGetTypeID()) {
@@ -305,7 +305,7 @@
void RemoteLayerTreeHost::mapAllIOSurfaceBackingStore()
{
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
recursivelyMapIOSurfaceBackingStore(asLayer(m_rootLayer));
#endif
}
Modified: trunk/Source/WebKit/UIProcess/mac/ViewSnapshotStore.h (228852 => 228853)
--- trunk/Source/WebKit/UIProcess/mac/ViewSnapshotStore.h 2018-02-21 01:08:28 UTC (rev 228852)
+++ trunk/Source/WebKit/UIProcess/mac/ViewSnapshotStore.h 2018-02-21 01:32:26 UTC (rev 228853)
@@ -53,7 +53,7 @@
class ViewSnapshot : public RefCounted<ViewSnapshot> {
public:
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
static Ref<ViewSnapshot> create(std::unique_ptr<WebCore::IOSurface>);
#else
static Ref<ViewSnapshot> create(uint32_t slotID, WebCore::IntSize, size_t imageSizeInBytes);
@@ -78,7 +78,7 @@
void setDeviceScaleFactor(float deviceScaleFactor) { m_deviceScaleFactor = deviceScaleFactor; }
float deviceScaleFactor() const { return m_deviceScaleFactor; }
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
WebCore::IOSurface* surface() const { return m_surface.get(); }
size_t imageSizeInBytes() const { return m_surface ? m_surface->totalBytes() : 0; }
@@ -93,7 +93,7 @@
#endif
private:
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
explicit ViewSnapshot(std::unique_ptr<WebCore::IOSurface>);
std::unique_ptr<WebCore::IOSurface> m_surface;
@@ -127,7 +127,7 @@
void setDisableSnapshotVolatilityForTesting(bool disable) { m_disableSnapshotVolatility = disable; }
bool disableSnapshotVolatilityForTesting() const { return m_disableSnapshotVolatility; }
-#if !USE(IOSURFACE)
+#if !HAVE(IOSURFACE)
static CAContext *snapshottingContext();
#endif
Modified: trunk/Source/WebKit/UIProcess/mac/ViewSnapshotStore.mm (228852 => 228853)
--- trunk/Source/WebKit/UIProcess/mac/ViewSnapshotStore.mm 2018-02-21 01:08:28 UTC (rev 228852)
+++ trunk/Source/WebKit/UIProcess/mac/ViewSnapshotStore.mm 2018-02-21 01:32:26 UTC (rev 228853)
@@ -60,7 +60,7 @@
return store;
}
-#if !USE(IOSURFACE)
+#if !HAVE(IOSURFACE)
CAContext *ViewSnapshotStore::snapshottingContext()
{
static CAContext *context;
@@ -131,7 +131,7 @@
m_snapshotsWithImages.first()->clearImage();
}
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
Ref<ViewSnapshot> ViewSnapshot::create(std::unique_ptr<WebCore::IOSurface> surface)
{
return adoptRef(*new ViewSnapshot(WTFMove(surface)));
@@ -143,7 +143,7 @@
}
#endif
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
ViewSnapshot::ViewSnapshot(std::unique_ptr<WebCore::IOSurface> surface)
: m_surface(WTFMove(surface))
#else
@@ -162,7 +162,7 @@
clearImage();
}
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
void ViewSnapshot::setSurface(std::unique_ptr<WebCore::IOSurface> surface)
{
ASSERT(!m_surface);
@@ -178,7 +178,7 @@
bool ViewSnapshot::hasImage() const
{
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
return !!m_surface;
#else
return m_slotID;
@@ -192,7 +192,7 @@
ViewSnapshotStore::singleton().willRemoveImageFromSnapshot(*this);
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
m_surface = nullptr;
#else
[ViewSnapshotStore::snapshottingContext() deleteSlot:m_slotID];
@@ -201,7 +201,7 @@
#endif
}
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
WebCore::IOSurface::SurfaceState ViewSnapshot::setVolatile(bool becomeVolatile)
{
if (ViewSnapshotStore::singleton().disableSnapshotVolatilityForTesting())
@@ -216,7 +216,7 @@
id ViewSnapshot::asLayerContents()
{
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
if (!m_surface)
return nullptr;
@@ -233,7 +233,7 @@
RetainPtr<CGImageRef> ViewSnapshot::asImageForTesting()
{
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
if (!m_surface)
return nullptr;
Modified: trunk/Tools/ChangeLog (228852 => 228853)
--- trunk/Tools/ChangeLog 2018-02-21 01:08:28 UTC (rev 228852)
+++ trunk/Tools/ChangeLog 2018-02-21 01:32:26 UTC (rev 228853)
@@ -1,3 +1,16 @@
+2018-02-20 Tim Horton <[email protected]>
+
+ Introduce HAVE(IOSURFACE_ACCELERATOR)
+ https://bugs.webkit.org/show_bug.cgi?id=182955
+ <rdar://problem/37699510>
+
+ Reviewed by Sam Weinig.
+
+ * DumpRenderTree/ios/PixelDumpSupportIOS.mm:
+ (createBitmapContextFromWebView):
+ * WebKitTestRunner/ios/PlatformWebViewIOS.mm:
+ (WTR::PlatformWebView::windowSnapshotImage):
+
2018-02-20 Chris Dumez <[email protected]>
Provisional load may get committed before receiving the decidePolicyForNavigationResponse response
Modified: trunk/Tools/DumpRenderTree/ios/PixelDumpSupportIOS.mm (228852 => 228853)
--- trunk/Tools/DumpRenderTree/ios/PixelDumpSupportIOS.mm 2018-02-21 01:08:28 UTC (rev 228852)
+++ trunk/Tools/DumpRenderTree/ios/PixelDumpSupportIOS.mm 2018-02-21 01:32:26 UTC (rev 228853)
@@ -66,7 +66,7 @@
int bufferWidth = ceil(viewSize.width * deviceScaleFactor);
int bufferHeight = ceil(viewSize.height * deviceScaleFactor);
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
WebCore::FloatSize snapshotSize(viewSize);
snapshotSize.scale(deviceScaleFactor);
Modified: trunk/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm (228852 => 228853)
--- trunk/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm 2018-02-21 01:08:28 UTC (rev 228852)
+++ trunk/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm 2018-02-21 01:32:26 UTC (rev 228853)
@@ -294,7 +294,7 @@
// Retina only surface.
}
-#if !USE(IOSURFACE)
+#if !HAVE(IOSURFACE)
static void releaseDataProviderData(void* info, const void*, size_t)
{
CARenderServerDestroyBuffer(static_cast<CARenderServerBufferRef>(info));
@@ -304,7 +304,7 @@
RetainPtr<CGImageRef> PlatformWebView::windowSnapshotImage()
{
BEGIN_BLOCK_OBJC_EXCEPTIONS;
-#if USE(IOSURFACE)
+#if HAVE(IOSURFACE)
__block bool isDone = false;
__block RetainPtr<CGImageRef> result;
Modified: trunk/WebKitLibraries/ChangeLog (228852 => 228853)
--- trunk/WebKitLibraries/ChangeLog 2018-02-21 01:08:28 UTC (rev 228852)
+++ trunk/WebKitLibraries/ChangeLog 2018-02-21 01:32:26 UTC (rev 228853)
@@ -1,3 +1,16 @@
+2018-02-20 Tim Horton <[email protected]>
+
+ Introduce HAVE(IOSURFACE_ACCELERATOR)
+ https://bugs.webkit.org/show_bug.cgi?id=182955
+ <rdar://problem/37699510>
+
+ Reviewed by Sam Weinig.
+
+ * WebKitPrivateFrameworkStubs/iOS/10/IOSurface.framework/IOSurface.tbd:
+ * WebKitPrivateFrameworkStubs/iOS/10/IOSurfaceAccelerator.framework/IOSurfaceAccelerator.tbd: Added.
+ * WebKitPrivateFrameworkStubs/iOS/11/IOSurfaceAccelerator.framework/IOSurfaceAccelerator.tbd: Added.
+ Switch IOSurfaceAccelerator symbols over to the still-private IOSurfaceAccelerator framework.
+
2018-01-19 Ryan Haddad <[email protected]>
Unreviewed, rolling out r227211.
Modified: trunk/WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/10/IOSurface.framework/IOSurface.tbd (228852 => 228853)
--- trunk/WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/10/IOSurface.framework/IOSurface.tbd 2018-02-21 01:08:28 UTC (rev 228852)
+++ trunk/WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/10/IOSurface.framework/IOSurface.tbd 2018-02-21 01:32:26 UTC (rev 228853)
@@ -14,9 +14,6 @@
- i386
- x86_64
symbols:
- - _IOSurfaceAcceleratorCreate
- - _IOSurfaceAcceleratorGetRunLoopSource
- - _IOSurfaceAcceleratorTransformSurface
- _IOSurfaceAlignProperty
- _IOSurfaceCreate
- _IOSurfaceCreateMachPort
Added: trunk/WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/10/IOSurfaceAccelerator.framework/IOSurfaceAccelerator.tbd (0 => 228853)
--- trunk/WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/10/IOSurfaceAccelerator.framework/IOSurfaceAccelerator.tbd (rev 0)
+++ trunk/WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/10/IOSurfaceAccelerator.framework/IOSurfaceAccelerator.tbd 2018-02-21 01:32:26 UTC (rev 228853)
@@ -0,0 +1,24 @@
+--- !tapi-tbd-v2
+archs:
+ - armv7
+ - armv7s
+ - arm64
+ - i386
+ - x86_64
+exports:
+ -
+ archs:
+ - armv7
+ - armv7s
+ - arm64
+ - i386
+ - x86_64
+ symbols:
+ - _IOSurfaceAcceleratorCreate
+ - _IOSurfaceAcceleratorGetRunLoopSource
+ - _IOSurfaceAcceleratorTransformSurface
+ - _kIOSurfaceAcceleratorUnwireSurfaceKey
+install-name: /System/Library/PrivateFrameworks/IOSurfaceAccelerator.framework/IOSurfaceAccelerator
+objc-constraint: none
+platform: ios
+...
Added: trunk/WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/11/IOSurfaceAccelerator.framework/IOSurfaceAccelerator.tbd (0 => 228853)
--- trunk/WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/11/IOSurfaceAccelerator.framework/IOSurfaceAccelerator.tbd (rev 0)
+++ trunk/WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/11/IOSurfaceAccelerator.framework/IOSurfaceAccelerator.tbd 2018-02-21 01:32:26 UTC (rev 228853)
@@ -0,0 +1,24 @@
+--- !tapi-tbd-v2
+archs:
+ - armv7
+ - armv7s
+ - arm64
+ - i386
+ - x86_64
+exports:
+ -
+ archs:
+ - armv7
+ - armv7s
+ - arm64
+ - i386
+ - x86_64
+ symbols:
+ - _IOSurfaceAcceleratorCreate
+ - _IOSurfaceAcceleratorGetRunLoopSource
+ - _IOSurfaceAcceleratorTransformSurface
+ - _kIOSurfaceAcceleratorUnwireSurfaceKey
+install-name: /System/Library/PrivateFrameworks/IOSurfaceAccelerator.framework/IOSurfaceAccelerator
+objc-constraint: none
+platform: ios
+...