Bug 226254

Summary: Premultiplication handled incorrectly for WebGL canvases display and upload
Product: WebKit Reporter: Kai Ninomiya <kainino>
Component: WebGLAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: dino, kbr, kkinnunen, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Mac (Intel)   
OS: macOS 11   
URL: https://codepen.io/kainino0x/pen/oNZwoJQ
Bug Depends on: 156129    
Bug Blocks:    
Attachments:
Description Flags
Reproduction case
none
Screenshot of the expected behavior (in Chrome, but Firefox is same)
none
Screenshot of Safari Technology Preview's (incorrect) behavior none

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 ***