Bug 216860

Summary: [GPU Process] fast/canvas/canvas-blend-image.html and fast/canvas/canvas-blend-solid.html fail on macOS
Product: WebKit Reporter: Wenson Hsieh <wenson_hsieh>
Component: CanvasAssignee: Wenson Hsieh <wenson_hsieh>
Status: RESOLVED FIXED    
Severity: Normal CC: dino, sabouhallawa, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Wenson Hsieh 2020-09-22 17:42:19 PDT
SSIA
Comment 1 Wenson Hsieh 2020-09-22 17:46:53 PDT
Super simple test case:

```
<canvas width="1" height="1"></canvas>
<script>
let canvas = document.querySelector("canvas");
let context = canvas.getContext("2d");
context.fillStyle = "red";
context.fillRect(0, 0, 1, 1);

let data = context.getImageData(0, 0, 1, 1);
document.write(`This is solid red (RGBA): ${data.data[0]}, ${data.data[1]}, ${data.data[2]}, ${data.data[3]}`);
</script>
```

This is expected to output “This is solid red (RGBA): 255, 0, 0, 255”. However, when forcing unaccelerated remote image buffers using the GPU process, we get this instead:

“This is solid red (RGBA): 0, 0, 255, 255”
Comment 2 Wenson Hsieh 2020-09-22 18:22:14 PDT
Created attachment 409434 [details]
Patch
Comment 3 Said Abou-Hallawa 2020-09-22 20:07:08 PDT
Comment on attachment 409434 [details]
Patch

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

> Source/WebKit/WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.h:-63
> -#if PLATFORM(IOS_FAMILY)

This change will affect all platforms including Cairo. But I think this is the right behavior even for the Cairo surface.
Comment 4 Wenson Hsieh 2020-09-22 20:23:48 PDT
Comment on attachment 409434 [details]
Patch

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

>> Source/WebKit/WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.h:-63
>> -#if PLATFORM(IOS_FAMILY)
> 
> This change will affect all platforms including Cairo. But I think this is the right behavior even for the Cairo surface.

👍🏻
Comment 5 EWS 2020-09-22 20:41:48 PDT
Committed r267459: <https://trac.webkit.org/changeset/267459>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 409434 [details].
Comment 6 Radar WebKit Bug Importer 2020-09-22 20:42:18 PDT
<rdar://problem/69410569>