Bug 226254 - Premultiplication handled incorrectly for WebGL canvases display and upload
Summary: Premultiplication handled incorrectly for WebGL canvases display and upload
Status: RESOLVED DUPLICATE of bug 200026
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: Safari Technology Preview
Hardware: Mac (Intel) macOS 11
: P2 Normal
Assignee: Nobody
URL: https://codepen.io/kainino0x/pen/oNZwoJQ
Keywords: InRadar
Depends on: 156129
Blocks:
  Show dependency treegraph
 
Reported: 2021-05-25 17:54 PDT by Kai Ninomiya
Modified: 2022-04-22 00:25 PDT (History)
4 users (show)

See Also:


Attachments
Reproduction case (5.58 KB, text/html)
2021-05-25 17:54 PDT, Kai Ninomiya
no flags Details
Screenshot of the expected behavior (in Chrome, but Firefox is same) (49.96 KB, image/png)
2021-05-25 17:55 PDT, Kai Ninomiya
no flags Details
Screenshot of Safari Technology Preview's (incorrect) behavior (51.08 KB, image/png)
2021-05-25 17:55 PDT, Kai Ninomiya
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kai Ninomiya 2021-05-25 17:54:55 PDT
Created attachment 429720 [details]
Reproduction case

1. Open https://codepen.io/kainino0x/pen/oNZwoJQ (or the attached file)

Expected result:
The six WebGL-rendered canvases should match the six 2d-rendered canvases (with the exception described in the test case).

Actual result:
See attached. From inspection, I think (but I'm not sure):
- Canvases with premultiplyAlpha:false are treated as if they have premultiplyAlpha:true
  (both when they are displayed, and when they are used as sources to texImage2D).
- texImage2D from webgl canvas sources with premultiplyAlpha:false are incorrectly y-flipped.

On macOS 11.3.1 (20E241):

- Pass: Chrome - 92.0.4515.7 (Official Build) canary (x86_64)
- Pass: Firefox - 90.0a1 (2021-05-18) (64-bit)
- FAIL: Safari Stable - Version 14.1 (16611.1.21.161.6)
- FAIL: Safari Technology Preview - Release 124 (Safari 14.2, WebKit 16612.1.11.10)
Comment 1 Kai Ninomiya 2021-05-25 17:55:25 PDT
Created attachment 429721 [details]
Screenshot of the expected behavior (in Chrome, but Firefox is same)
Comment 2 Kai Ninomiya 2021-05-25 17:55:55 PDT
Created attachment 429722 [details]
Screenshot of Safari Technology Preview's (incorrect) behavior
Comment 3 Kimmo Kinnunen 2021-05-26 01:36:01 PDT
Thanks for the repro. I believe the bugs in depends on are the earlier reports of these.
Comment 4 Radar WebKit Bug Importer 2021-06-01 17:55:17 PDT
<rdar://problem/78741173>
Comment 5 Kimmo Kinnunen 2022-04-22 00:25:17 PDT

*** This bug has been marked as a duplicate of bug 200026 ***