Changeset 251896 in webkit


Ignore:
Timestamp:
Oct 31, 2019 5:08:25 PM (4 years ago)
Author:
timothy_horton@apple.com
Message:

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.

Location:
trunk
Files:
4 added
1 deleted
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r251895 r251896  
     12019-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
    1312019-10-31  Jer Noble  <jer.noble@apple.com>
    232
  • trunk/LayoutTests/fast/images/exif-orientation-canvas-expected.html

    r249489 r251896  
    1616        height: 102px;
    1717    }
    18     img {
     18    canvas {
    1919        border: 1px solid black;
    2020    }
     
    2626    <div class="container">
    2727        <div class="horizontal">
    28             <img src="resources/exif-orientation-1-ul.jpg">
     28            <canvas class="horizontal" id="canvas1" ></canvas>
    2929        </div>
    3030        <br>Normal
     
    3232    <div class="container">
    3333        <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>
    3535        </div>
    3636        <br>Flipped horizontally
     
    3838    <div class="container">
    3939        <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>
    4141        </div>
    4242        <br>Rotated 180&deg;
     
    4444    <div class="container">
    4545        <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>
    4747        </div>
    4848        <br>Flipped vertically
     
    5151    <div class="container">
    5252        <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>
    5454        </div>
    5555        <br>Rotated 90&deg; CCW and flipped vertically
     
    5757    <div class="container">
    5858        <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>
    6060        </div>
    6161        <br>Rotated 90&deg; CCW
     
    6363    <div class="container">
    6464        <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>
    6666        </div>
    6767        <br>Rotated 90&deg; CW and flipped vertically
     
    6969    <div class="container">
    7070        <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>
    7272        </div>
    7373        <br>Rotated 90&deg; CW
     
    7676    <div class="container">
    7777        <div class="horizontal">
    78             <img src="resources/exif-orientation-1-ul.jpg">
     78            <canvas class="horizontal" id="canvas9"></canvas>
    7979        </div>
    8080        <br>Undefined (invalid value)
    8181    </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>
    82101</body>
  • trunk/LayoutTests/platform/ios-device/TestExpectations

    r246412 r251896  
    139139
    140140# 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 ]
    143141fast/canvas/webgl/gl-teximage.html [ Failure ]
    144142fast/canvas/webgl/match-page-color-space.html [ ImageOnlyFailure ]
  • trunk/LayoutTests/platform/ios/TestExpectations

    r251770 r251896  
    33743374imported/w3c/web-platform-tests/2dcontext/drawing-paths-to-the-canvas/drawFocusIfNeeded_005.html [ Skip ]
    33753375
     3376# https://bugs.webkit.org/show_bug.cgi?id=175736
     3377canvas/philip/tests/2d.path.stroke.scale2.html [ Failure ]
     3378fast/canvas/canvas-currentColor.html [ Failure ]
     3379fast/canvas/canvas-radial-gradient-spreadMethod.html [ Failure ]
     3380imported/w3c/canvas/2d.gradient.radial.cone.bottom.html [ Failure ]
     3381imported/w3c/canvas/2d.gradient.radial.cone.cylinder.html [ Failure ]
     3382imported/w3c/canvas/2d.gradient.radial.cone.front.html [ Failure ]
     3383imported/w3c/canvas/2d.gradient.radial.cone.shape1.html [ Failure ]
     3384imported/w3c/canvas/2d.gradient.radial.cone.top.html [ Failure ]
     3385imported/w3c/canvas/2d.gradient.radial.inside1.html [ Failure ]
     3386imported/w3c/canvas/2d.gradient.radial.inside2.html [ Failure ]
     3387imported/w3c/canvas/2d.gradient.radial.inside3.html [ Failure ]
     3388imported/w3c/canvas/2d.gradient.radial.outside1.html [ Failure ]
     3389imported/w3c/canvas/2d.gradient.radial.outside2.html [ Failure ]
     3390imported/w3c/canvas/2d.gradient.radial.outside3.html [ Failure ]
     3391imported/w3c/canvas/2d.gradient.radial.touch1.html [ Failure ]
     3392imported/w3c/canvas/2d.gradient.radial.touch2.html [ Failure ]
     3393imported/w3c/canvas/2d.gradient.radial.touch3.html [ Failure ]
     3394imported/w3c/canvas/2d.path.stroke.scale2.html [ Failure ]
     3395
     3396webkit.org/b/202460 imported/w3c/web-platform-tests/2dcontext/image-smoothing/imagesmoothing.html [ Failure ]
     3397
     3398webkit.org/b/202523 imported/w3c/web-platform-tests/2dcontext/path-objects/2d.path.stroke.scale2.html [ Failure ]
     3399
    33763400# canvas tests that fail with small antialiasing diffs
    33773401imported/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  
    1414          (bounds 512.00 288.00)
    1515          (drawsContent 1)
     16          (acceleratesDrawing 1)
    1617        )
    1718        (GraphicsLayer
     
    2021          (usingTiledLayer 1)
    2122          (drawsContent 1)
     23          (acceleratesDrawing 1)
    2224        )
    2325        (GraphicsLayer
  • trunk/Source/WTF/ChangeLog

    r251895 r251896  
     12019-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
    1132019-10-31  Jer Noble  <jer.noble@apple.com>
    214
  • trunk/Source/WTF/wtf/Platform.h

    r251862 r251896  
    12801280#endif
    12811281
    1282 #if PLATFORM(COCOA) && !PLATFORM(IOS_FAMILY_SIMULATOR)
     1282#if PLATFORM(COCOA)
    12831283#define HAVE_IOSURFACE 1
     1284#endif
     1285
     1286#if PLATFORM(IOS_FAMILY) && !PLATFORM(IOS_FAMILY_SIMULATOR)
     1287#define HAVE_IOSURFACE_COREIMAGE_SUPPORT 1
    12841288#endif
    12851289
     
    14111415#endif
    14121416
    1413 #if PLATFORM(COCOA) && USE(CA) && !PLATFORM(IOS_FAMILY_SIMULATOR)
     1417#if PLATFORM(COCOA) && USE(CA)
    14141418#define USE_IOSURFACE_CANVAS_BACKING_STORE 1
    14151419#endif
  • trunk/Source/WebCore/ChangeLog

    r251895 r251896  
     12019-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
    1212019-10-31  Jer Noble  <jer.noble@apple.com>
    222
  • trunk/Source/WebCore/Configurations/WebCore.xcconfig

    r246892 r251896  
    8989WK_GRAPHICS_SERVICES_LDFLAGS_cocoatouch = -framework GraphicsServices;
    9090
    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;
     91WK_IOSURFACE_ACCELERATOR_LDFLAGS = $(WK_IOSURFACE_ACCELERATOR_LDFLAGS_$(WK_PLATFORM_NAME));
     92WK_IOSURFACE_ACCELERATOR_LDFLAGS_iphoneos = -framework IOSurfaceAccelerator;
    9793
    9894WK_LIBWEBRTC_LDFLAGS = $(WK_LIBWEBRTC_LDFLAGS_$(ENABLE_WEB_RTC));
     
    126122
    127123// 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 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_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);
     124OTHER_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);
    129125
    130126OTHER_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  
    3232#include "IntSize.h"
    3333
    34 #if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
     34#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST) && !PLATFORM(IOS_FAMILY_SIMULATOR)
    3535#define HAVE_IOSURFACE_RGB10 1
    3636#endif
  • trunk/Source/WebCore/rendering/RenderThemeIOS.mm

    r249507 r251896  
    20382038
    20392039    RetainPtr<CGImageRef> cgImage;
    2040 #if HAVE(IOSURFACE)
     2040#if HAVE(IOSURFACE_COREIMAGE_SUPPORT)
    20412041    // Crop the result to the badge location.
    20422042    CIImage *croppedImage = [sourceOverFilter.outputImage imageByCroppingToRect:flippedInsetBadgeRect];
  • trunk/Source/WebKit/ChangeLog

    r251889 r251896  
     12019-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
    1242019-10-31  Dean Jackson  <dino@apple.com>
    225
  • trunk/Source/WebKit/Configurations/WebKit.xcconfig

    r251889 r251896  
    7070WK_GRAPHICS_SERVICES_LDFLAGS_cocoatouch = -framework GraphicsServices;
    7171
    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 
    7972WK_LIBWEBRTC_LDFLAGS = $(WK_LIBWEBRTC_LDFLAGS_$(ENABLE_WEB_RTC));
    8073WK_LIBWEBRTC_LDFLAGS_ = ;
     
    134127WK_AUTHKIT_LDFLAGS_MACOS_SINCE_1015 = -framework AuthKit;
    135128
    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);
     129FRAMEWORK_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);
    137130
    138131// 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  
    120120CanvasUsesAcceleratedDrawing:
    121121  type: bool
    122   defaultValue: DEFAULT_CANVAS_USES_ACCELERATED_DRAWING
     122  defaultValue: true
    123123
    124124WebGLEnabled:
     
    10461046AcceleratedDrawingEnabled:
    10471047  type: bool
    1048   defaultValue: DEFAULT_ACCELERATED_DRAWING_ENABLED
     1048  defaultValue: true
    10491049  category: debug
    10501050
  • trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h

    r251686 r251896  
    121121
    122122#if PLATFORM(IOS_FAMILY_SIMULATOR)
    123 #define DEFAULT_ACCELERATED_DRAWING_ENABLED false
    124 #define DEFAULT_CANVAS_USES_ACCELERATED_DRAWING false
    125123#define DEFAULT_MOCK_CAPTURE_DEVICES_ENABLED true
    126124#else
    127 #define DEFAULT_ACCELERATED_DRAWING_ENABLED true
    128 #define DEFAULT_CANVAS_USES_ACCELERATED_DRAWING true
    129125#define DEFAULT_MOCK_CAPTURE_DEVICES_ENABLED false
    130126#endif
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm

    r251673 r251896  
    22302230
    22312231#if HAVE(IOSURFACE)
     2232#if HAVE(IOSURFACE_RGB10)
    22322233    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
    22332237    auto surface = WebCore::IOSurface::create(WebCore::expandedIntSize(snapshotSize), WebCore::sRGBColorSpaceRef(), snapshotFormat);
    22342238    if (!surface)
     
    64236427
    64246428#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) {
    64276432        auto surface = WebCore::IOSurface::create(WebCore::expandedIntSize(WebCore::FloatSize(imageSize)), WebCore::sRGBColorSpaceRef());
    64286433        if (!surface) {
  • trunk/Tools/ChangeLog

    r251886 r251896  
     12019-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
    1192019-10-31  Tadeu Zagallo  <tzagallo@apple.com>
    220
  • trunk/Tools/DumpRenderTree/ios/PixelDumpSupportIOS.mm

    r244955 r251896  
    7171    snapshotSize.scale(deviceScaleFactor);
    7272
     73#if HAVE(IOSURFACE_RGB10)
    7374    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
    7478    auto surface = WebCore::IOSurface::create(WebCore::expandedIntSize(snapshotSize), WebCore::sRGBColorSpaceRef(), snapshotFormat);
    7579    RetainPtr<CGImageRef> cgImage = surface->createImage();
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewSnapshot.mm

    r242339 r251896  
    121121        NSInteger viewHeightInPixels = viewHeight * backingScaleFactor;
    122122
    123         unsigned char rgba[viewWidthInPixels * viewHeightInPixels * 4];
     123        uint8_t *rgba = (unsigned char *)calloc(viewWidthInPixels * viewHeightInPixels * 4, sizeof(unsigned char));
    124124        RetainPtr<CGContextRef> context = CGBitmapContextCreate(rgba, viewWidthInPixels, viewHeightInPixels, 8, 4 * viewWidthInPixels, colorSpace.get(), kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big);
    125125        CGContextDrawImage(context.get(), CGRectMake(0, 0, viewWidthInPixels, viewHeightInPixels), cgImage.get());
     
    141141        EXPECT_EQ(0, rgba[pixelIndex + 2]);
    142142
     143        free(rgba);
     144
    143145        isDone = true;
    144146    }];
     
    265267        RetainPtr<CGColorSpaceRef> colorSpace = adoptCF(CGColorSpaceCreateDeviceRGB());
    266268
    267         unsigned char rgba[viewWidth * viewHeight * 4];
     269        uint8_t *rgba = (unsigned char *)calloc(viewWidth * viewHeight * 4, sizeof(unsigned char));
    268270        RetainPtr<CGContextRef> context = CGBitmapContextCreate(rgba, viewWidth, viewHeight, 8, 4 * viewWidth, colorSpace.get(), kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big);
    269271        CGContextDrawImage(context.get(), CGRectMake(0, 0, viewWidth, viewHeight), cgImage.get());
     
    286288        EXPECT_EQ(255, rgba[pixelIndex + 1]);
    287289        EXPECT_EQ(255, rgba[pixelIndex + 2]);
     290
     291        free(rgba);
    288292
    289293        isDone = true;
     
    338342        NSInteger viewHeightInPixels = viewHeight * backingScaleFactor;
    339343       
    340         unsigned char rgba[viewWidthInPixels * viewHeightInPixels * 4];
     344        uint8_t *rgba = (unsigned char *)calloc(viewWidthInPixels * viewHeightInPixels * 4, sizeof(unsigned char));
    341345        RetainPtr<CGContextRef> context = CGBitmapContextCreate(rgba, viewWidthInPixels, viewHeightInPixels, 8, 4 * viewWidthInPixels, colorSpace.get(), kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big);
    342346        CGContextDrawImage(context.get(), CGRectMake(0, 0, viewWidthInPixels, viewHeightInPixels), cgImage.get());
     
    346350        EXPECT_EQ(0, rgba[pixelIndex + 1]);
    347351        EXPECT_EQ(255, rgba[pixelIndex + 2]);
     352
     353        free(rgba);
    348354       
    349355        isDone = true;
     
    399405        NSInteger viewHeightInPixels = viewHeight * backingScaleFactor;
    400406       
    401         unsigned char rgba[viewWidthInPixels * viewHeightInPixels * 4];
     407        uint8_t *rgba = (unsigned char *)calloc(viewWidthInPixels * viewHeightInPixels * 4, sizeof(unsigned char));
    402408        RetainPtr<CGContextRef> context = CGBitmapContextCreate(rgba, viewWidthInPixels, viewHeightInPixels, 8, 4 * viewWidthInPixels, colorSpace.get(), kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big);
    403409        CGContextDrawImage(context.get(), CGRectMake(0, 0, viewWidthInPixels, viewHeightInPixels), cgImage.get());
    404        
     410
    405411        NSInteger pixelIndex = getPixelIndex(0, 0, viewWidthInPixels);
    406412        EXPECT_EQ(0, rgba[pixelIndex]);
    407413        EXPECT_EQ(0, rgba[pixelIndex + 1]);
    408414        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.