Bug 203026 - Turn on IOSurface support in the iOS Simulator
Summary: Turn on IOSurface support in the iOS Simulator
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Horton
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-10-15 23:02 PDT by Tim Horton
Modified: 2019-10-31 17:08 PDT (History)
18 users (show)

See Also:


Attachments
Patch (20.79 KB, patch)
2019-10-15 23:04 PDT, Tim Horton
no flags Details | Formatted Diff | Diff
Patch (20.79 KB, patch)
2019-10-15 23:07 PDT, Tim Horton
no flags Details | Formatted Diff | Diff
Patch (21.71 KB, patch)
2019-10-22 21:30 PDT, Tim Horton
no flags Details | Formatted Diff | Diff
Patch (24.84 KB, patch)
2019-10-28 18:02 PDT, Tim Horton
no flags Details | Formatted Diff | Diff
Patch (55.84 KB, patch)
2019-10-30 16:03 PDT, Tim Horton
no flags Details | Formatted Diff | Diff
Patch (54.93 KB, patch)
2019-10-30 16:40 PDT, Tim Horton
no flags Details | Formatted Diff | Diff
Patch (54.12 KB, patch)
2019-10-31 13:17 PDT, Tim Horton
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Horton 2019-10-15 23:02:32 PDT
Turn on IOSurface support in the iOS Simulator
Comment 1 Tim Horton 2019-10-15 23:04:43 PDT
Created attachment 381055 [details]
Patch
Comment 2 Tim Horton 2019-10-15 23:04:46 PDT
<rdar://problem/46098948>
Comment 3 Tim Horton 2019-10-15 23:05:24 PDT
Comment on attachment 381055 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=381055&action=review

> LayoutTests/platform/ios/TestExpectations:3389
> +# https://bugs.webkit.org/show_bug.cgi?id=175736

See also rdar://problem/31177990 and related
Comment 4 Tim Horton 2019-10-15 23:06:43 PDT
Actually we'll use <rdar://problem/56320993> for this.
Comment 5 Tim Horton 2019-10-15 23:07:46 PDT
Created attachment 381056 [details]
Patch
Comment 6 Tim Horton 2019-10-16 00:16:26 PDT
API test failures look real
Comment 7 Alexey Proskuryakov 2019-10-16 10:03:28 PDT
We need to move iOS testers to macOS Catalina and re-test.
Comment 8 Tim Horton 2019-10-16 16:21:09 PDT
Actually I can repro the API test failures locally... so I have more digging to do.
Comment 9 Tim Horton 2019-10-22 21:30:36 PDT
Created attachment 381651 [details]
Patch
Comment 10 Alexey Proskuryakov 2019-10-23 09:19:51 PDT
Comment on attachment 381651 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=381651&action=review

Exciting!

Still need to update host OS in the infrastructure to properly test (even in EWS)...

> Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:6391
> +    // FIXME: We should be able to use hardware snapshotting in the simulator.

Bug link?
Comment 11 Tim Horton 2019-10-28 18:02:59 PDT
Created attachment 382143 [details]
Patch
Comment 12 EWS Watchlist 2019-10-28 21:09:20 PDT
Comment on attachment 382143 [details]
Patch

Attachment 382143 [details] did not pass jsc-ews (mac):
Output: https://webkit-queues.webkit.org/results/13187034

New failing tests:
mozilla-tests.yaml/js1_5/Array/regress-101964.js.mozilla-dfg-eager-no-cjit-validate-phases
Comment 13 Tim Horton 2019-10-30 16:03:12 PDT
Created attachment 382382 [details]
Patch
Comment 14 Said Abou-Hallawa 2019-10-30 16:36:08 PDT
Comment on attachment 382382 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=382382&action=review

> LayoutTests/fast/images/exif-orientation-canvas-expected.html:115
> +            var names = [
> +                { resource: "resources/exif-orientation-1-ul.jpg",  id : "canvas1" },
> +                { resource: "resources/exif-orientation-1-ul.jpg",  id : "canvas2" },
> +                { resource: "resources/exif-orientation-1-ul.jpg",  id : "canvas3" },
> +                { resource: "resources/exif-orientation-1-ul.jpg",  id : "canvas4" },
> +                { resource: "resources/exif-orientation-1-ul.jpg",  id : "canvas5" },
> +                { resource: "resources/exif-orientation-1-ul.jpg",  id : "canvas6" },
> +                { resource: "resources/exif-orientation-1-ul.jpg",  id : "canvas7" },
> +                { resource: "resources/exif-orientation-1-ul.jpg",  id : "canvas8" },
> +                { resource: "resources/exif-orientation-1-ul.jpg",  id : "canvas9" }
> +            ];
> +
> +            var drawCount = 0;
> +
> +            names.forEach(function(name) {
> +                var image = new Image;
> +                image.src = name.resource;
> +                image.decode().then(() => {
> +                    let canvas = document.getElementById(name.id);
> +                    canvas.width = image.width;
> +                    canvas.height = image.height;
> +                    let context = canvas.getContext("2d");
> +                    context.drawImage(image, 0, 0, canvas.width, canvas.height);
> +                    if (++drawCount == names.length) {
> +                        if (window.testRunner)
> +                            window.testRunner.notifyDone();
> +                    }
> +                });
> +            });

Since the canvases are drawing the same image, this code can be simplified like this:

    var image = new Image;
    image.src = "resources/exif-orientation-1-ul.jpg";
    image.decode().then(() => {
        const canvases = document.getElementsByTagName('canvas');
        for (let canvas of canvases) {
            canvas.width = image.width;
            canvas.height = image.height;
            let context = canvas.getContext("2d");
            context.drawImage(image, 0, 0, canvas.width, canvas.height);
        }
        if (window.testRunner)
            window.testRunner.notifyDone();
    });
Comment 15 Tim Horton 2019-10-30 16:40:42 PDT
Created attachment 382390 [details]
Patch
Comment 16 Dean Jackson 2019-10-30 17:08:13 PDT
Comment on attachment 382390 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=382390&action=review

> Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewSnapshot.mm:342
> +        unsigned char *rgba = (unsigned char *)calloc(viewWidthInPixels * viewHeightInPixels * 4, sizeof(unsigned char));

uint8_t?

or Uint8ClampedArray::tryCreateUninitialized?
Comment 17 Dean Jackson 2019-10-30 17:11:11 PDT
Comment on attachment 382390 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=382390&action=review

> LayoutTests/fast/images/exif-orientation-canvas-expected.html:91
> +                const canvases = document.getElementsByTagName('canvas');
> +                for (let canvas of canvases) {

document.querySelectorAll("canvas").forEach(canvas => {
  // draw
});
Comment 18 Tim Horton 2019-10-31 13:17:11 PDT
Created attachment 382492 [details]
Patch
Comment 19 EWS Watchlist 2019-10-31 16:09:46 PDT
Comment on attachment 382492 [details]
Patch

Attachment 382492 [details] did not pass jsc-ews (mac):
Output: https://webkit-queues.webkit.org/results/13196833

New failing tests:
mozilla-tests.yaml/js1_5/Array/regress-101964.js.mozilla-dfg-eager-no-cjit-validate-phases
Comment 20 WebKit Commit Bot 2019-10-31 17:08:32 PDT
Comment on attachment 382492 [details]
Patch

Clearing flags on attachment: 382492

Committed r251896: <https://trac.webkit.org/changeset/251896>
Comment 21 WebKit Commit Bot 2019-10-31 17:08:34 PDT
All reviewed patches have been landed.  Closing bug.