Bug 184843 - tex[Sub]Image2D slow when passing in a <canvas>, faster with ImageData
Summary: tex[Sub]Image2D slow when passing in a <canvas>, faster with ImageData
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-04-20 15:10 PDT by Justin Fan
Modified: 2018-04-26 19:00 PDT (History)
7 users (show)

See Also:


Attachments
Patch (3.45 KB, patch)
2018-04-20 15:58 PDT, Justin Fan
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews103 for mac-sierra (2.80 MB, application/zip)
2018-04-20 16:46 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews107 for mac-sierra-wk2 (3.14 MB, application/zip)
2018-04-20 17:26 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews113 for mac-sierra (3.06 MB, application/zip)
2018-04-20 18:45 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews121 for ios-simulator-wk2 (13.34 MB, application/zip)
2018-04-20 19:51 PDT, EWS Watchlist
no flags Details
Patch (3.36 KB, patch)
2018-04-24 15:57 PDT, Justin Fan
no flags Details | Formatted Diff | Diff
Patch (3.30 KB, patch)
2018-04-26 18:27 PDT, Justin Fan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Fan 2018-04-20 15:10:24 PDT
There are some performance issues with html 2D canvas rendering involving FormatConverter::convert()'s pixel packing methods.
Comment 1 Justin Fan 2018-04-20 15:11:56 PDT
<rdar://problem/34898868>
Comment 2 Justin Fan 2018-04-20 15:58:48 PDT
Created attachment 338475 [details]
Patch
Comment 3 Simon Fraser (smfr) 2018-04-20 16:34:19 PDT
Comment on attachment 338475 [details]
Patch

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

> Source/WebCore/platform/graphics/FormatConverter.cpp:1
> -/*
> +  /*

Ooops.

> Source/WebCore/platform/graphics/FormatConverter.cpp:1263
> +        // FIXME: [34898868] Experimental Accelerate Alpha Unmultiplicaton for this specific case; general performance improvements later.

I don't think this radar links adds anything.
Comment 4 EWS Watchlist 2018-04-20 16:46:18 PDT
Comment on attachment 338475 [details]
Patch

Attachment 338475 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/7389225

New failing tests:
webgl/1.0.2/conformance/textures/tex-image-and-sub-image-2d-with-array-buffer-view.html
webgl/1.0.2/conformance/textures/tex-image-and-sub-image-2d-with-video-rgb565.html
webgl/1.0.2/conformance/textures/tex-image-and-sub-image-2d-with-image-data-rgba5551.html
webgl/1.0.2/conformance/textures/gl-teximage.html
fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgb565.html
webgl/1.0.2/conformance/textures/tex-image-and-sub-image-2d-with-image-data-rgba4444.html
webgl/1.0.2/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba4444.html
fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgba4444.html
webgl/1.0.2/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba5551.html
fast/canvas/webgl/tex-image-and-sub-image-2d-with-video-rgb565.html
fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgba5551.html
webgl/1.0.2/conformance/textures/tex-image-and-sub-image-2d-with-image-data-rgb565.html
fast/canvas/webgl/tex-image-with-format-and-type.html
webgl/1.0.2/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba5551.html
fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgba4444.html
webgl/1.0.2/conformance/textures/tex-image-and-sub-image-2d-with-image-rgb565.html
webgl/1.0.2/conformance/textures/tex-image-and-sub-image-2d-with-video.html
webgl/1.0.2/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba4444.html
webgl/1.0.2/conformance/textures/tex-image-and-sub-image-2d-with-image-data.html
webgl/1.0.2/conformance/textures/tex-image-with-format-and-type.html
Comment 5 EWS Watchlist 2018-04-20 16:46:19 PDT
Created attachment 338489 [details]
Archive of layout-test-results from ews103 for mac-sierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews103  Port: mac-sierra  Platform: Mac OS X 10.12.6
Comment 6 EWS Watchlist 2018-04-20 17:26:51 PDT
Comment on attachment 338475 [details]
Patch

Attachment 338475 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/7389284

Number of test failures exceeded the failure limit.
Comment 7 EWS Watchlist 2018-04-20 17:26:52 PDT
Created attachment 338501 [details]
Archive of layout-test-results from ews107 for mac-sierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews107  Port: mac-sierra-wk2  Platform: Mac OS X 10.12.6
Comment 8 EWS Watchlist 2018-04-20 18:45:56 PDT
Comment on attachment 338475 [details]
Patch

Attachment 338475 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/7390760

Number of test failures exceeded the failure limit.
Comment 9 EWS Watchlist 2018-04-20 18:45:58 PDT
Created attachment 338506 [details]
Archive of layout-test-results from ews113 for mac-sierra

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews113  Port: mac-sierra  Platform: Mac OS X 10.12.6
Comment 10 EWS Watchlist 2018-04-20 19:51:15 PDT
Comment on attachment 338475 [details]
Patch

Attachment 338475 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/7391504

New failing tests:
webgl/1.0.2/conformance/textures/tex-image-and-sub-image-2d-with-array-buffer-view.html
fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-rgba5551.html
fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgb565.html
fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-rgba4444.html
fast/canvas/webgl/tex-image-and-sub-image-2d-with-array-buffer-view.html
webgl/1.0.2/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba5551.html
webgl/1.0.2/conformance/textures/tex-image-and-sub-image-2d-with-image-data-rgba4444.html
fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgba4444.html
fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data-rgb565.html
fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-rgba5551.html
fast/canvas/webgl/tex-image-and-sub-image-2d-with-image-data.html
webgl/1.0.2/conformance/textures/tex-image-and-sub-image-2d-with-image-data-rgb565.html
fast/canvas/webgl/tex-image-with-format-and-type.html
webgl/1.0.2/conformance/textures/tex-image-and-sub-image-2d-with-image-rgba4444.html
webgl/1.0.2/conformance/textures/tex-image-with-format-and-type.html
webgl/1.0.2/conformance/textures/tex-image-and-sub-image-2d-with-image-rgb565.html
webgl/1.0.2/conformance/textures/tex-image-and-sub-image-2d-with-image-data-rgba5551.html
webgl/1.0.2/conformance/textures/tex-image-and-sub-image-2d-with-image-data.html
Comment 11 EWS Watchlist 2018-04-20 19:51:16 PDT
Created attachment 338512 [details]
Archive of layout-test-results from ews121 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews121  Port: ios-simulator-wk2  Platform: Mac OS X 10.13.4
Comment 12 Justin Fan 2018-04-24 15:57:24 PDT
Created attachment 338682 [details]
Patch
Comment 13 Simon Fraser (smfr) 2018-04-26 17:26:16 PDT
Comment on attachment 338682 [details]
Patch

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

> Source/WebCore/ChangeLog:11
> +        This improves this rendering path by a factor of ~4. The rest of FormatConverter may require similar improvements.

The best thing to do here would be to file a bugzilla bug for the rest of the improvements, and reference it. Like "Filed webkit.org/b/9999 for further improvements".

> Source/WebCore/platform/graphics/FormatConverter.cpp:1265
> +        // FIXME: Experimental Accelerate Alpha Unmultiplicaton for this specific case; general performance improvements later.

Remove the comment. It only means something to you.
Comment 14 Justin Fan 2018-04-26 18:27:43 PDT
Created attachment 338946 [details]
Patch
Comment 15 WebKit Commit Bot 2018-04-26 19:00:31 PDT
Comment on attachment 338946 [details]
Patch

Clearing flags on attachment: 338946

Committed r231084: <https://trac.webkit.org/changeset/231084>
Comment 16 WebKit Commit Bot 2018-04-26 19:00:32 PDT
All reviewed patches have been landed.  Closing bug.