Changeset 251896 in webkit
- Timestamp:
- Oct 31, 2019 5:08:25 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 1 deleted
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r251895 r251896 1 2019-10-31 Tim Horton <timothy_horton@apple.com> 2 3 Turn on IOSurface support in the iOS Simulator 4 https://bugs.webkit.org/show_bug.cgi?id=203026 5 <rdar://problem/56320993> 6 7 Reviewed by Simon Fraser. 8 9 * compositing/canvas/accelerated-canvas-compositing-size-limit-expected.txt: 10 * platform/ios-device/TestExpectations: 11 * platform/ios/TestExpectations: 12 * platform/ios/compositing/canvas/accelerated-canvas-compositing-expected.txt: Added. 13 * platform/ios/compositing/canvas/accelerated-canvas-compositing-size-limit-expected.txt: Removed. 14 * platform/ios/fast/canvas/canvas-render-layer-expected.txt: Added. 15 * platform/ios/fast/canvas/canvas-scale-shadowBlur-expected.txt: Added. 16 * platform/ios/fast/canvas/canvas-scale-strokePath-shadow-expected.txt: Added. 17 * platform/ios/imported/w3c/web-platform-tests/2dcontext/drawing-images-to-the-canvas/drawimage_html_image-expected.txt: Removed. 18 Move and expand the scope of some TestExpectations for canvas tests 19 that fail due to noise introduced in the hardware accelerated drawing path. 20 We will separately investigate how to mitigate this, but it already affects 21 iOS on-device testing (as well as macOS in most cases). The tiny reduction 22 in coverage here is well worth the massive improvement in coverage of 23 accelerated drawing code paths. 24 25 * fast/images/exif-orientation-canvas-expected.html: 26 Due to rdar://problem/56755864, <canvas> and <img> render slightly differently. 27 Use <canvas> for the reference as well, but use transforms to translate it 28 instead of depending on EXIF orientation support, to continue testing 29 the intended behavior. 30 1 31 2019-10-31 Jer Noble <jer.noble@apple.com> 2 32 -
trunk/LayoutTests/fast/images/exif-orientation-canvas-expected.html
r249489 r251896 16 16 height: 102px; 17 17 } 18 img{18 canvas { 19 19 border: 1px solid black; 20 20 } … … 26 26 <div class="container"> 27 27 <div class="horizontal"> 28 < img src="resources/exif-orientation-1-ul.jpg">28 <canvas class="horizontal" id="canvas1" ></canvas> 29 29 </div> 30 30 <br>Normal … … 32 32 <div class="container"> 33 33 <div class="horizontal"> 34 < img src="resources/exif-orientation-1-ul.jpg" style="transform: scaleX(-1);">34 <canvas class="horizontal" id="canvas2" style="transform: scaleX(-1);"></canvas> 35 35 </div> 36 36 <br>Flipped horizontally … … 38 38 <div class="container"> 39 39 <div class="horizontal"> 40 < img src="resources/exif-orientation-1-ul.jpg" style="transform: rotate(180deg);">40 <canvas class="horizontal" id="canvas3" style="transform: rotate(180deg);"></canvas> 41 41 </div> 42 42 <br>Rotated 180° … … 44 44 <div class="container"> 45 45 <div class="horizontal"> 46 < img src="resources/exif-orientation-1-ul.jpg" style="transform: scaleX(-1) rotate(180deg);">46 <canvas class="horizontal" id="canvas4" style="transform: scaleX(-1) rotate(180deg);"></canvas> 47 47 </div> 48 48 <br>Flipped vertically … … 51 51 <div class="container"> 52 52 <div class="vertical"> 53 < img src="resources/exif-orientation-1-ul.jpg" style="transform: translate(-25px, 25px) rotate(90deg) scaleY(-1);">53 <canvas class="vertical" id="canvas5" style="transform: translate(-25px, 25px) rotate(90deg) scaleY(-1);"></canvas> 54 54 </div> 55 55 <br>Rotated 90° CCW and flipped vertically … … 57 57 <div class="container"> 58 58 <div class="vertical"> 59 < img src="resources/exif-orientation-1-ul.jpg" style="transform: translate(-25px, 25px) rotate(90deg);">59 <canvas class="vertical" id="canvas6" style="transform: translate(-25px, 25px) rotate(90deg);"></canvas> 60 60 </div> 61 61 <br>Rotated 90° CCW … … 63 63 <div class="container"> 64 64 <div class="vertical"> 65 < img src="resources/exif-orientation-1-ul.jpg" style="transform: translate(-25px, 25px) rotate(270deg) scaleY(-1);">65 <canvas class="vertical" id="canvas7" style="transform: translate(-25px, 25px) rotate(270deg) scaleY(-1);"></canvas> 66 66 </div> 67 67 <br>Rotated 90° CW and flipped vertically … … 69 69 <div class="container"> 70 70 <div class="vertical"> 71 < img src="resources/exif-orientation-1-ul.jpg" style="transform: translate(-25px, 25px) rotate(270deg);">71 <canvas class="vertical" id="canvas8" style="transform: translate(-25px, 25px) rotate(270deg);"></canvas> 72 72 </div> 73 73 <br>Rotated 90° CW … … 76 76 <div class="container"> 77 77 <div class="horizontal"> 78 < img src="resources/exif-orientation-1-ul.jpg">78 <canvas class="horizontal" id="canvas9"></canvas> 79 79 </div> 80 80 <br>Undefined (invalid value) 81 81 </div> 82 <script> 83 if (window.testRunner) 84 window.testRunner.waitUntilDone(); 85 86 window.onload = function() { 87 var image = new Image; 88 image.src = "resources/exif-orientation-1-ul.jpg"; 89 image.decode().then(() => { 90 document.querySelectorAll("canvas").forEach(canvas => { 91 canvas.width = image.width; 92 canvas.height = image.height; 93 canvas.getContext("2d").drawImage(image, 0, 0, canvas.width, canvas.height); 94 }); 95 96 if (window.testRunner) 97 window.testRunner.notifyDone(); 98 }); 99 } 100 </script> 82 101 </body> -
trunk/LayoutTests/platform/ios-device/TestExpectations
r246412 r251896 139 139 140 140 # https://bugs.webkit.org/show_bug.cgi?id=175736 141 canvas/philip/tests/2d.path.stroke.scale2.html [ Failure ]142 fast/canvas/canvas-currentColor.html [ Failure ]143 141 fast/canvas/webgl/gl-teximage.html [ Failure ] 144 142 fast/canvas/webgl/match-page-color-space.html [ ImageOnlyFailure ] -
trunk/LayoutTests/platform/ios/TestExpectations
r251770 r251896 3374 3374 imported/w3c/web-platform-tests/2dcontext/drawing-paths-to-the-canvas/drawFocusIfNeeded_005.html [ Skip ] 3375 3375 3376 # https://bugs.webkit.org/show_bug.cgi?id=175736 3377 canvas/philip/tests/2d.path.stroke.scale2.html [ Failure ] 3378 fast/canvas/canvas-currentColor.html [ Failure ] 3379 fast/canvas/canvas-radial-gradient-spreadMethod.html [ Failure ] 3380 imported/w3c/canvas/2d.gradient.radial.cone.bottom.html [ Failure ] 3381 imported/w3c/canvas/2d.gradient.radial.cone.cylinder.html [ Failure ] 3382 imported/w3c/canvas/2d.gradient.radial.cone.front.html [ Failure ] 3383 imported/w3c/canvas/2d.gradient.radial.cone.shape1.html [ Failure ] 3384 imported/w3c/canvas/2d.gradient.radial.cone.top.html [ Failure ] 3385 imported/w3c/canvas/2d.gradient.radial.inside1.html [ Failure ] 3386 imported/w3c/canvas/2d.gradient.radial.inside2.html [ Failure ] 3387 imported/w3c/canvas/2d.gradient.radial.inside3.html [ Failure ] 3388 imported/w3c/canvas/2d.gradient.radial.outside1.html [ Failure ] 3389 imported/w3c/canvas/2d.gradient.radial.outside2.html [ Failure ] 3390 imported/w3c/canvas/2d.gradient.radial.outside3.html [ Failure ] 3391 imported/w3c/canvas/2d.gradient.radial.touch1.html [ Failure ] 3392 imported/w3c/canvas/2d.gradient.radial.touch2.html [ Failure ] 3393 imported/w3c/canvas/2d.gradient.radial.touch3.html [ Failure ] 3394 imported/w3c/canvas/2d.path.stroke.scale2.html [ Failure ] 3395 3396 webkit.org/b/202460 imported/w3c/web-platform-tests/2dcontext/image-smoothing/imagesmoothing.html [ Failure ] 3397 3398 webkit.org/b/202523 imported/w3c/web-platform-tests/2dcontext/path-objects/2d.path.stroke.scale2.html [ Failure ] 3399 3376 3400 # canvas tests that fail with small antialiasing diffs 3377 3401 imported/w3c/web-platform-tests/2dcontext/building-paths/canvas_complexshapes_arcto_001.htm [ ImageOnlyFailure ] -
trunk/LayoutTests/platform/ios/compositing/canvas/accelerated-canvas-compositing-size-limit-expected.txt
r211949 r251896 14 14 (bounds 512.00 288.00) 15 15 (drawsContent 1) 16 (acceleratesDrawing 1) 16 17 ) 17 18 (GraphicsLayer … … 20 21 (usingTiledLayer 1) 21 22 (drawsContent 1) 23 (acceleratesDrawing 1) 22 24 ) 23 25 (GraphicsLayer -
trunk/Source/WTF/ChangeLog
r251895 r251896 1 2019-10-31 Tim Horton <timothy_horton@apple.com> 2 3 Turn on IOSurface support in the iOS Simulator 4 https://bugs.webkit.org/show_bug.cgi?id=203026 5 <rdar://problem/56320993> 6 7 Reviewed by Simon Fraser. 8 9 * wtf/Platform.h: 10 Turn on HAVE(IOSURFACE) and USE(IOSURFACE_CANVAS_BACKING_STORE) in the simulator. 11 Add HAVE(IOSURFACE_COREIMAGE_SUPPORT). 12 1 13 2019-10-31 Jer Noble <jer.noble@apple.com> 2 14 -
trunk/Source/WTF/wtf/Platform.h
r251862 r251896 1280 1280 #endif 1281 1281 1282 #if PLATFORM(COCOA) && !PLATFORM(IOS_FAMILY_SIMULATOR)1282 #if PLATFORM(COCOA) 1283 1283 #define HAVE_IOSURFACE 1 1284 #endif 1285 1286 #if PLATFORM(IOS_FAMILY) && !PLATFORM(IOS_FAMILY_SIMULATOR) 1287 #define HAVE_IOSURFACE_COREIMAGE_SUPPORT 1 1284 1288 #endif 1285 1289 … … 1411 1415 #endif 1412 1416 1413 #if PLATFORM(COCOA) && USE(CA) && !PLATFORM(IOS_FAMILY_SIMULATOR)1417 #if PLATFORM(COCOA) && USE(CA) 1414 1418 #define USE_IOSURFACE_CANVAS_BACKING_STORE 1 1415 1419 #endif -
trunk/Source/WebCore/ChangeLog
r251895 r251896 1 2019-10-31 Tim Horton <timothy_horton@apple.com> 2 3 Turn on IOSurface support in the iOS Simulator 4 https://bugs.webkit.org/show_bug.cgi?id=203026 5 <rdar://problem/56320993> 6 7 Reviewed by Simon Fraser. 8 9 * Configurations/WebCore.xcconfig: 10 Always link IOSurface now that we always have it. We continue to only link 11 IOSurfaceAccelerator on iOS hardware, since it's only available there. 12 13 * platform/graphics/cocoa/IOSurface.h: 14 Turn off RGB10 in the Simulator. 15 16 * rendering/RenderThemeIOS.mm: 17 (WebCore::RenderThemeIOS::paintSystemPreviewBadge): 18 Disable CoreImage rendering via IOSurface for the system preview badge, 19 since it does not seem to work in the simulator. 20 1 21 2019-10-31 Jer Noble <jer.noble@apple.com> 2 22 -
trunk/Source/WebCore/Configurations/WebCore.xcconfig
r246892 r251896 89 89 WK_GRAPHICS_SERVICES_LDFLAGS_cocoatouch = -framework GraphicsServices; 90 90 91 WK_IOSURFACE_LDFLAGS = $(WK_IOSURFACE_LDFLAGS_$(WK_PLATFORM_NAME)); 92 WK_IOSURFACE_LDFLAGS_iphoneos = -framework IOSurface -framework IOSurfaceAccelerator; 93 WK_IOSURFACE_LDFLAGS_watchos = $(WK_IOSURFACE_LDFLAGS_iphoneos); 94 WK_IOSURFACE_LDFLAGS_appletvos = $(WK_IOSURFACE_LDFLAGS_iphoneos); 95 WK_IOSURFACE_LDFLAGS_maccatalyst = -framework IOSurface; 96 WK_IOSURFACE_LDFLAGS_macosx = -framework IOSurface; 91 WK_IOSURFACE_ACCELERATOR_LDFLAGS = $(WK_IOSURFACE_ACCELERATOR_LDFLAGS_$(WK_PLATFORM_NAME)); 92 WK_IOSURFACE_ACCELERATOR_LDFLAGS_iphoneos = -framework IOSurfaceAccelerator; 97 93 98 94 WK_LIBWEBRTC_LDFLAGS = $(WK_LIBWEBRTC_LDFLAGS_$(ENABLE_WEB_RTC)); … … 126 122 127 123 // FIXME: Reduce the number of allowable_clients <rdar://problem/31823969> 128 OTHER_LDFLAGS = $(inherited) $(WK_RELOCATABLE_FRAMEWORK_LDFLAGS) $(WK_UNDEFINED_SYMBOLS_LDFLAGS) -lsqlite3 -lobjc -lANGLE -allowable_client WebCoreTestSupport -allowable_client WebKitLegacy -force_load $(BUILT_PRODUCTS_DIR)/libPAL.a -framework CFNetwork -framework CoreAudio -framework CoreGraphics -framework CoreText -framework Foundation -framework I mageIO -framework Metal $(OTHER_LDFLAGS_PLATFORM_$(WK_COCOA_TOUCH)) $(OTHER_LDFLAGS_PLATFORM_$(WK_PLATFORM_NAME)) $(WK_APPKIT_LDFLAGS) $(WK_APPSUPPORT_LDFLAGS) $(WK_AUDIO_UNIT_LDFLAGS) $(WK_CARBON_LDFLAGS) $(WK_CORE_UI_LDFLAGS) $(WK_DATA_DETECTORS_CORE_LDFLAGS) $(WK_GRAPHICS_SERVICES_LDFLAGS) $(WK_IOSURFACE_LDFLAGS) $(WK_LIBWEBRTC_LDFLAGS) $(WK_MOBILE_CORE_SERVICES_LDFLAGS) $(WK_MOBILE_GESTALT_LDFLAGS) $(WK_OPENGL_LDFLAGS) $(WK_SYSTEM_CONFIGURATION_LDFLAGS) $(WK_SYSTEM_PREVIEW_LDFLAGS) $(WK_URL_FORMATTING_LDFLAGS);124 OTHER_LDFLAGS = $(inherited) $(WK_RELOCATABLE_FRAMEWORK_LDFLAGS) $(WK_UNDEFINED_SYMBOLS_LDFLAGS) -lsqlite3 -lobjc -lANGLE -allowable_client WebCoreTestSupport -allowable_client WebKitLegacy -force_load $(BUILT_PRODUCTS_DIR)/libPAL.a -framework CFNetwork -framework CoreAudio -framework CoreGraphics -framework CoreText -framework Foundation -framework IOSurface -framework ImageIO -framework Metal $(OTHER_LDFLAGS_PLATFORM_$(WK_COCOA_TOUCH)) $(OTHER_LDFLAGS_PLATFORM_$(WK_PLATFORM_NAME)) $(WK_APPKIT_LDFLAGS) $(WK_APPSUPPORT_LDFLAGS) $(WK_AUDIO_UNIT_LDFLAGS) $(WK_CARBON_LDFLAGS) $(WK_CORE_UI_LDFLAGS) $(WK_DATA_DETECTORS_CORE_LDFLAGS) $(WK_GRAPHICS_SERVICES_LDFLAGS) $(WK_IOSURFACE_ACCELERATOR_LDFLAGS) $(WK_LIBWEBRTC_LDFLAGS) $(WK_MOBILE_CORE_SERVICES_LDFLAGS) $(WK_MOBILE_GESTALT_LDFLAGS) $(WK_OPENGL_LDFLAGS) $(WK_SYSTEM_CONFIGURATION_LDFLAGS) $(WK_SYSTEM_PREVIEW_LDFLAGS) $(WK_URL_FORMATTING_LDFLAGS); 129 125 130 126 OTHER_LDFLAGS_PLATFORM_cocoatouch = -allowable_client WebKit -allowable_client iTunesU -allowable_client Casablanca -allowable_client Remote -allowable_client TVBooks -allowable_client DumpRenderTree -allowable_client WebKitTestRunner -allowable_client TestWebKitAPI; -
trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h
r251361 r251896 32 32 #include "IntSize.h" 33 33 34 #if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST) 34 #if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST) && !PLATFORM(IOS_FAMILY_SIMULATOR) 35 35 #define HAVE_IOSURFACE_RGB10 1 36 36 #endif -
trunk/Source/WebCore/rendering/RenderThemeIOS.mm
r249507 r251896 2038 2038 2039 2039 RetainPtr<CGImageRef> cgImage; 2040 #if HAVE(IOSURFACE )2040 #if HAVE(IOSURFACE_COREIMAGE_SUPPORT) 2041 2041 // Crop the result to the badge location. 2042 2042 CIImage *croppedImage = [sourceOverFilter.outputImage imageByCroppingToRect:flippedInsetBadgeRect]; -
trunk/Source/WebKit/ChangeLog
r251889 r251896 1 2019-10-31 Tim Horton <timothy_horton@apple.com> 2 3 Turn on IOSurface support in the iOS Simulator 4 https://bugs.webkit.org/show_bug.cgi?id=203026 5 <rdar://problem/56320993> 6 7 Reviewed by Simon Fraser. 8 9 * Configurations/WebKit.xcconfig: 10 Always link IOSurface now that we always have it. 11 12 * Shared/WebPreferences.yaml: 13 * Shared/WebPreferencesDefaultValues.h: 14 Turn on Accelerated Drawing and Accelerated Drawing for Canvas by default. 15 16 * UIProcess/API/Cocoa/WKWebView.mm: 17 (-[WKWebView _takeViewSnapshot]): 18 Don't use RGB10 if we don't have it. 19 20 (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): 21 Don't use render server snapshotting in hidden windows, because it 22 (correctly, but unhelpfully) cannot capture contents in that case. 23 1 24 2019-10-31 Dean Jackson <dino@apple.com> 2 25 -
trunk/Source/WebKit/Configurations/WebKit.xcconfig
r251889 r251896 70 70 WK_GRAPHICS_SERVICES_LDFLAGS_cocoatouch = -framework GraphicsServices; 71 71 72 WK_IOSURFACE_LDFLAGS = $(WK_IOSURFACE_LDFLAGS_$(WK_PLATFORM_NAME));73 WK_IOSURFACE_LDFLAGS_iphoneos = -framework IOSurface;74 WK_IOSURFACE_LDFLAGS_maccatalyst = $(WK_IOSURFACE_LDFLAGS_iphoneos);75 WK_IOSURFACE_LDFLAGS_watchos = $(WK_IOSURFACE_LDFLAGS_iphoneos);76 WK_IOSURFACE_LDFLAGS_appletvos = $(WK_IOSURFACE_LDFLAGS_iphoneos);77 WK_IOSURFACE_LDFLAGS_macosx = -framework IOSurface;78 79 72 WK_LIBWEBRTC_LDFLAGS = $(WK_LIBWEBRTC_LDFLAGS_$(ENABLE_WEB_RTC)); 80 73 WK_LIBWEBRTC_LDFLAGS_ = ; … … 134 127 WK_AUTHKIT_LDFLAGS_MACOS_SINCE_1015 = -framework AuthKit; 135 128 136 FRAMEWORK_AND_LIBRARY_LDFLAGS = -lobjc -framework CFNetwork -framework CoreAudio -framework CoreFoundation -framework CoreGraphics -framework CoreText -framework Foundation -framework ImageIO -framework IOKit -framework WebKitLegacy -lnetwork $(WK_ACCESSIBILITY_LDFLAGS) $(WK_APPKIT_LDFLAGS) $(WK_ASSERTION_SERVICES_LDFLAGS) $(WK_AUTHKIT_LDFLAGS) $(WK_CARBON_LDFLAGS) $(WK_CORE_PDF_LDFLAGS) $(WK_CORE_PREDICTION_LDFLAGS) $(WK_CORE_SERVICES_LDFLAGS) $(WK_DEVICE_IDENTITY_LDFLAGS) $(WK_GRAPHICS_SERVICES_LDFLAGS) $(WK_IOSURFACE_LDFLAGS) $(WK_LIBSANDBOX_LDFLAGS) $(WK_LIBWEBRTC_LDFLAGS) $(WK_MOBILE_CORE_SERVICES_LDFLAGS) $(WK_MOBILE_GESTALT_LDFLAGS) $(WK_OPENGL_LDFLAGS) $(WK_PDFKIT_LDFLAGS) $(WK_SAFE_BROWSING_LDFLAGS) $(WK_SECURITY_INTERFACE_LDFLAGS) $(WK_UIKIT_LDFLAGS) $(WK_URL_FORMATTING_LDFLAGS) $(WK_WEBINSPECTORUI_LDFLAGS);129 FRAMEWORK_AND_LIBRARY_LDFLAGS = -lobjc -framework CFNetwork -framework CoreAudio -framework CoreFoundation -framework CoreGraphics -framework CoreText -framework Foundation -framework ImageIO -framework IOKit -framework IOSurface -framework WebKitLegacy -lnetwork $(WK_ACCESSIBILITY_LDFLAGS) $(WK_APPKIT_LDFLAGS) $(WK_ASSERTION_SERVICES_LDFLAGS) $(WK_AUTHKIT_LDFLAGS) $(WK_CARBON_LDFLAGS) $(WK_CORE_PDF_LDFLAGS) $(WK_CORE_PREDICTION_LDFLAGS) $(WK_CORE_SERVICES_LDFLAGS) $(WK_DEVICE_IDENTITY_LDFLAGS) $(WK_GRAPHICS_SERVICES_LDFLAGS) $(WK_LIBSANDBOX_LDFLAGS) $(WK_LIBWEBRTC_LDFLAGS) $(WK_MOBILE_CORE_SERVICES_LDFLAGS) $(WK_MOBILE_GESTALT_LDFLAGS) $(WK_OPENGL_LDFLAGS) $(WK_PDFKIT_LDFLAGS) $(WK_SAFE_BROWSING_LDFLAGS) $(WK_SECURITY_INTERFACE_LDFLAGS) $(WK_UIKIT_LDFLAGS) $(WK_URL_FORMATTING_LDFLAGS) $(WK_WEBINSPECTORUI_LDFLAGS); 137 130 138 131 // Prevent C++ standard library basic_stringstream, operator new, delete and their related exception types from being exported as weak symbols. -
trunk/Source/WebKit/Shared/WebPreferences.yaml
r251822 r251896 120 120 CanvasUsesAcceleratedDrawing: 121 121 type: bool 122 defaultValue: DEFAULT_CANVAS_USES_ACCELERATED_DRAWING122 defaultValue: true 123 123 124 124 WebGLEnabled: … … 1046 1046 AcceleratedDrawingEnabled: 1047 1047 type: bool 1048 defaultValue: DEFAULT_ACCELERATED_DRAWING_ENABLED1048 defaultValue: true 1049 1049 category: debug 1050 1050 -
trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h
r251686 r251896 121 121 122 122 #if PLATFORM(IOS_FAMILY_SIMULATOR) 123 #define DEFAULT_ACCELERATED_DRAWING_ENABLED false124 #define DEFAULT_CANVAS_USES_ACCELERATED_DRAWING false125 123 #define DEFAULT_MOCK_CAPTURE_DEVICES_ENABLED true 126 124 #else 127 #define DEFAULT_ACCELERATED_DRAWING_ENABLED true128 #define DEFAULT_CANVAS_USES_ACCELERATED_DRAWING true129 125 #define DEFAULT_MOCK_CAPTURE_DEVICES_ENABLED false 130 126 #endif -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
r251673 r251896 2230 2230 2231 2231 #if HAVE(IOSURFACE) 2232 #if HAVE(IOSURFACE_RGB10) 2232 2233 WebCore::IOSurface::Format snapshotFormat = WebCore::screenSupportsExtendedColor() ? WebCore::IOSurface::Format::RGB10 : WebCore::IOSurface::Format::RGBA; 2234 #else 2235 WebCore::IOSurface::Format snapshotFormat = WebCore::IOSurface::Format::RGBA; 2236 #endif 2233 2237 auto surface = WebCore::IOSurface::create(WebCore::expandedIntSize(snapshotSize), WebCore::sRGBColorSpaceRef(), snapshotFormat); 2234 2238 if (!surface) … … 6423 6427 6424 6428 #if HAVE(CORE_ANIMATION_RENDER_SERVER) && HAVE(IOSURFACE) 6425 // If we are parented and thus won't incur a significant penalty from paging in tiles, snapshot the view hierarchy directly. 6426 if (NSString *displayName = self.window.screen.displayConfiguration.name) { 6429 // If we are parented and not hidden, and thus won't incur a significant penalty from paging in tiles, snapshot the view hierarchy directly. 6430 NSString *displayName = self.window.screen.displayConfiguration.name; 6431 if (displayName && !self.window.hidden) { 6427 6432 auto surface = WebCore::IOSurface::create(WebCore::expandedIntSize(WebCore::FloatSize(imageSize)), WebCore::sRGBColorSpaceRef()); 6428 6433 if (!surface) { -
trunk/Tools/ChangeLog
r251886 r251896 1 2019-10-31 Tim Horton <timothy_horton@apple.com> 2 3 Turn on IOSurface support in the iOS Simulator 4 https://bugs.webkit.org/show_bug.cgi?id=203026 5 <rdar://problem/56320993> 6 7 Reviewed by Simon Fraser. 8 9 * DumpRenderTree/ios/PixelDumpSupportIOS.mm: 10 (createBitmapContextFromWebView): 11 Don't use RGB10 if we don't have it. 12 13 * TestWebKitAPI/Tests/WebKitCocoa/WKWebViewSnapshot.mm: 14 (TEST): 15 Don't allocate many megabytes on the stack. 16 This isn't currently a problem, but if you accidentally run the tests on 17 a 3x simulator it starts crashing. 18 1 19 2019-10-31 Tadeu Zagallo <tzagallo@apple.com> 2 20 -
trunk/Tools/DumpRenderTree/ios/PixelDumpSupportIOS.mm
r244955 r251896 71 71 snapshotSize.scale(deviceScaleFactor); 72 72 73 #if HAVE(IOSURFACE_RGB10) 73 74 WebCore::IOSurface::Format snapshotFormat = WebCore::screenSupportsExtendedColor() ? WebCore::IOSurface::Format::RGB10 : WebCore::IOSurface::Format::RGBA; 75 #else 76 WebCore::IOSurface::Format snapshotFormat = WebCore::IOSurface::Format::RGBA; 77 #endif 74 78 auto surface = WebCore::IOSurface::create(WebCore::expandedIntSize(snapshotSize), WebCore::sRGBColorSpaceRef(), snapshotFormat); 75 79 RetainPtr<CGImageRef> cgImage = surface->createImage(); -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewSnapshot.mm
r242339 r251896 121 121 NSInteger viewHeightInPixels = viewHeight * backingScaleFactor; 122 122 123 u nsigned char rgba[viewWidthInPixels * viewHeightInPixels * 4];123 uint8_t *rgba = (unsigned char *)calloc(viewWidthInPixels * viewHeightInPixels * 4, sizeof(unsigned char)); 124 124 RetainPtr<CGContextRef> context = CGBitmapContextCreate(rgba, viewWidthInPixels, viewHeightInPixels, 8, 4 * viewWidthInPixels, colorSpace.get(), kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big); 125 125 CGContextDrawImage(context.get(), CGRectMake(0, 0, viewWidthInPixels, viewHeightInPixels), cgImage.get()); … … 141 141 EXPECT_EQ(0, rgba[pixelIndex + 2]); 142 142 143 free(rgba); 144 143 145 isDone = true; 144 146 }]; … … 265 267 RetainPtr<CGColorSpaceRef> colorSpace = adoptCF(CGColorSpaceCreateDeviceRGB()); 266 268 267 u nsigned char rgba[viewWidth * viewHeight * 4];269 uint8_t *rgba = (unsigned char *)calloc(viewWidth * viewHeight * 4, sizeof(unsigned char)); 268 270 RetainPtr<CGContextRef> context = CGBitmapContextCreate(rgba, viewWidth, viewHeight, 8, 4 * viewWidth, colorSpace.get(), kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big); 269 271 CGContextDrawImage(context.get(), CGRectMake(0, 0, viewWidth, viewHeight), cgImage.get()); … … 286 288 EXPECT_EQ(255, rgba[pixelIndex + 1]); 287 289 EXPECT_EQ(255, rgba[pixelIndex + 2]); 290 291 free(rgba); 288 292 289 293 isDone = true; … … 338 342 NSInteger viewHeightInPixels = viewHeight * backingScaleFactor; 339 343 340 u nsigned char rgba[viewWidthInPixels * viewHeightInPixels * 4];344 uint8_t *rgba = (unsigned char *)calloc(viewWidthInPixels * viewHeightInPixels * 4, sizeof(unsigned char)); 341 345 RetainPtr<CGContextRef> context = CGBitmapContextCreate(rgba, viewWidthInPixels, viewHeightInPixels, 8, 4 * viewWidthInPixels, colorSpace.get(), kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big); 342 346 CGContextDrawImage(context.get(), CGRectMake(0, 0, viewWidthInPixels, viewHeightInPixels), cgImage.get()); … … 346 350 EXPECT_EQ(0, rgba[pixelIndex + 1]); 347 351 EXPECT_EQ(255, rgba[pixelIndex + 2]); 352 353 free(rgba); 348 354 349 355 isDone = true; … … 399 405 NSInteger viewHeightInPixels = viewHeight * backingScaleFactor; 400 406 401 u nsigned char rgba[viewWidthInPixels * viewHeightInPixels * 4];407 uint8_t *rgba = (unsigned char *)calloc(viewWidthInPixels * viewHeightInPixels * 4, sizeof(unsigned char)); 402 408 RetainPtr<CGContextRef> context = CGBitmapContextCreate(rgba, viewWidthInPixels, viewHeightInPixels, 8, 4 * viewWidthInPixels, colorSpace.get(), kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big); 403 409 CGContextDrawImage(context.get(), CGRectMake(0, 0, viewWidthInPixels, viewHeightInPixels), cgImage.get()); 404 410 405 411 NSInteger pixelIndex = getPixelIndex(0, 0, viewWidthInPixels); 406 412 EXPECT_EQ(0, rgba[pixelIndex]); 407 413 EXPECT_EQ(0, rgba[pixelIndex + 1]); 408 414 EXPECT_EQ(255, rgba[pixelIndex + 2]); 409 410 isDone = true; 411 }]; 412 413 TestWebKitAPI::Util::run(&isDone); 414 } 415 416 free(rgba); 417 418 isDone = true; 419 }]; 420 421 TestWebKitAPI::Util::run(&isDone); 422 }
Note: See TracChangeset
for help on using the changeset viewer.