Turn on IOSurface support in the iOS Simulator
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Nov 2019 00:08:25 +0000 (00:08 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Nov 2019 00:08:25 +0000 (00:08 +0000)
commitb6d06a4ace12a08ad5b7ac6e92eb86a53acec400
tree43092e217e150817d34624a2e7fcdeb9357c4238
parent8d1a02cff484a511db2ebc77d5d42eabddb48cc4
Turn on IOSurface support in the iOS Simulator
https://bugs.webkit.org/show_bug.cgi?id=203026
<rdar://problem/56320993>

Reviewed by Simon Fraser.

Source/WebCore:

* Configurations/WebCore.xcconfig:
Always link IOSurface now that we always have it. We continue to only link
IOSurfaceAccelerator on iOS hardware, since it's only available there.

* platform/graphics/cocoa/IOSurface.h:
Turn off RGB10 in the Simulator.

* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::paintSystemPreviewBadge):
Disable CoreImage rendering via IOSurface for the system preview badge,
since it does not seem to work in the simulator.

Source/WebKit:

* Configurations/WebKit.xcconfig:
Always link IOSurface now that we always have it.

* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h:
Turn on Accelerated Drawing and Accelerated Drawing for Canvas by default.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _takeViewSnapshot]):
Don't use RGB10 if we don't have it.

(-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
Don't use render server snapshotting in hidden windows, because it
(correctly, but unhelpfully) cannot capture contents in that case.

Source/WTF:

* wtf/Platform.h:
Turn on HAVE(IOSURFACE) and USE(IOSURFACE_CANVAS_BACKING_STORE) in the simulator.
Add HAVE(IOSURFACE_COREIMAGE_SUPPORT).

Tools:

* DumpRenderTree/ios/PixelDumpSupportIOS.mm:
(createBitmapContextFromWebView):
Don't use RGB10 if we don't have it.

* TestWebKitAPI/Tests/WebKitCocoa/WKWebViewSnapshot.mm:
(TEST):
Don't allocate many megabytes on the stack.
This isn't currently a problem, but if you accidentally run the tests on
a 3x simulator it starts crashing.

LayoutTests:

* compositing/canvas/accelerated-canvas-compositing-size-limit-expected.txt:
* platform/ios-device/TestExpectations:
* platform/ios/TestExpectations:
* platform/ios/compositing/canvas/accelerated-canvas-compositing-expected.txt: Added.
* platform/ios/compositing/canvas/accelerated-canvas-compositing-size-limit-expected.txt: Removed.
* platform/ios/fast/canvas/canvas-render-layer-expected.txt: Added.
* platform/ios/fast/canvas/canvas-scale-shadowBlur-expected.txt: Added.
* platform/ios/fast/canvas/canvas-scale-strokePath-shadow-expected.txt: Added.
* platform/ios/imported/w3c/web-platform-tests/2dcontext/drawing-images-to-the-canvas/drawimage_html_image-expected.txt: Removed.
Move and expand the scope of some TestExpectations for canvas tests
that fail due to noise introduced in the hardware accelerated drawing path.
We will separately investigate how to mitigate this, but it already affects
iOS on-device testing (as well as macOS in most cases). The tiny reduction
in coverage here is well worth the massive improvement in coverage of
accelerated drawing code paths.

* fast/images/exif-orientation-canvas-expected.html:
Due to rdar://problem/56755864, <canvas> and <img> render slightly differently.
Use <canvas> for the reference as well, but use transforms to translate it
instead of depending on EXIF orientation support, to continue testing
the intended behavior.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251896 268f45cc-cd09-0410-ab3c-d52691b4dbfc
24 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/images/exif-orientation-canvas-expected.html
LayoutTests/platform/ios-device/TestExpectations
LayoutTests/platform/ios/TestExpectations
LayoutTests/platform/ios/compositing/canvas/accelerated-canvas-compositing-expected.txt [new file with mode: 0644]
LayoutTests/platform/ios/compositing/canvas/accelerated-canvas-compositing-size-limit-expected.txt
LayoutTests/platform/ios/fast/canvas/canvas-render-layer-expected.txt [new file with mode: 0644]
LayoutTests/platform/ios/fast/canvas/canvas-scale-shadowBlur-expected.txt [new file with mode: 0644]
LayoutTests/platform/ios/fast/canvas/canvas-scale-strokePath-shadow-expected.txt [new file with mode: 0644]
LayoutTests/platform/ios/imported/w3c/web-platform-tests/2dcontext/drawing-images-to-the-canvas/drawimage_html_image-expected.txt [deleted file]
Source/WTF/ChangeLog
Source/WTF/wtf/Platform.h
Source/WebCore/ChangeLog
Source/WebCore/Configurations/WebCore.xcconfig
Source/WebCore/platform/graphics/cocoa/IOSurface.h
Source/WebCore/rendering/RenderThemeIOS.mm
Source/WebKit/ChangeLog
Source/WebKit/Configurations/WebKit.xcconfig
Source/WebKit/Shared/WebPreferences.yaml
Source/WebKit/Shared/WebPreferencesDefaultValues.h
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Tools/ChangeLog
Tools/DumpRenderTree/ios/PixelDumpSupportIOS.mm
Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewSnapshot.mm