Bug 216860 - [GPU Process] fast/canvas/canvas-blend-image.html and fast/canvas/canvas-blend-solid.html fail on macOS
Summary: [GPU Process] fast/canvas/canvas-blend-image.html and fast/canvas/canvas-blen...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-09-22 17:42 PDT by Wenson Hsieh
Modified: 2020-09-22 20:42 PDT (History)
4 users (show)

See Also:


Attachments
Patch (2.25 KB, patch)
2020-09-22 18:22 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>