canvas: Add vello_cpu backend (#38282)

vello_cpu does not have any tests timeouts, because we do not need
download stuff from GPU as all work happens on CPU. So performance wise
it's better then classic vello at least for our usecase. There are some
vello bugs, but I think we will be able to sort them out within
upstream, eventually. Interestingly enough there are no new PASS like
they were with classic vello.

Difference with raqote can be observed here:
https://github.com/sagudev/servo/actions/runs/16549241085/attempts/1#summary-46802486798

## Known vello problems:

- https://github.com/linebender/vello/issues/1119
- https://github.com/linebender/vello/issues/1056
-
`/html/canvas/element/fill-and-stroke-styles/2d.gradient.interpolate.coloralpha.html`
- `kurbo::Cap::Butt` is defect (only visible with big lineWidth)
https://github.com/linebender/vello/issues/1063
  - `/html/canvas/element/line-styles/2d.line.cross.html`
  - `/html/canvas/element/line-styles/2d.line.miter.acute.html`
- other lack of strong correct problems
(https://github.com/linebender/vello/issues/1063#issuecomment-2998084736):
  - `/html/canvas/element/path-objects/2d.path.rect.selfintersect.html`
- `putImageData(getImageData(...), ...)` is lossy (precision problems,
might be due to ImageData being unmultiplied)
-
`/html/canvas/element/pixel-manipulation/2d.imageData.put.unchanged.html`

Testing: Tested using vello_cpu_canvas subsuite

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
sagudev 2025-07-27 21:56:38 +02:00 committed by GitHub
parent 15be75f955
commit 056b1538c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
39 changed files with 694 additions and 11 deletions

View file

@ -0,0 +1,4 @@
[2d.composite.clip.clear.html]
[fill() does not affect pixels outside the clip region.]
expected:
if subsuite == "vello_cpu_canvas": FAIL

View file

@ -0,0 +1,4 @@
[2d.composite.clip.copy.html]
[fill() does not affect pixels outside the clip region.]
expected:
if subsuite == "vello_cpu_canvas": FAIL

View file

@ -0,0 +1,4 @@
[2d.composite.clip.destination-atop.html]
[fill() does not affect pixels outside the clip region.]
expected:
if subsuite == "vello_cpu_canvas": FAIL

View file

@ -0,0 +1,4 @@
[2d.composite.clip.destination-in.html]
[fill() does not affect pixels outside the clip region.]
expected:
if subsuite == "vello_cpu_canvas": FAIL

View file

@ -0,0 +1,4 @@
[2d.composite.clip.source-in.html]
[fill() does not affect pixels outside the clip region.]
expected:
if subsuite == "vello_cpu_canvas": FAIL

View file

@ -0,0 +1,4 @@
[2d.composite.clip.source-out.html]
[fill() does not affect pixels outside the clip region.]
expected:
if subsuite == "vello_cpu_canvas": FAIL

View file

@ -0,0 +1,4 @@
[2d.composite.uncovered.pattern.copy.html]
[Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
expected:
if subsuite == "vello_cpu_canvas": FAIL

View file

@ -0,0 +1,4 @@
[2d.composite.uncovered.pattern.destination-atop.html]
[Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
expected:
if subsuite == "vello_cpu_canvas": FAIL

View file

@ -0,0 +1,4 @@
[2d.composite.uncovered.pattern.destination-in.html]
[Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
expected:
if subsuite == "vello_cpu_canvas": FAIL

View file

@ -0,0 +1,4 @@
[2d.composite.uncovered.pattern.source-in.html]
[Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
expected:
if subsuite == "vello_cpu_canvas": FAIL

View file

@ -0,0 +1,4 @@
[2d.composite.uncovered.pattern.source-out.html]
[Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
expected:
if subsuite == "vello_cpu_canvas": FAIL

View file

@ -0,0 +1,4 @@
[2d.clearRect.clip.html]
[clearRect is affected by clipping regions]
expected:
if subsuite == "vello_cpu_canvas": FAIL

View file

@ -0,0 +1,4 @@
[2d.clearRect.shadow.html]
[clearRect does not draw shadows]
expected:
if subsuite == "vello_cpu_canvas": FAIL

View file

@ -0,0 +1,4 @@
[2d.clearRect.zero.html]
[clearRect of zero pixels has no effect]
expected:
if subsuite == "vello_cpu_canvas": FAIL

View file

@ -3,3 +3,4 @@
bug: https://github.com/linebender/vello/issues/1056
expected:
if subsuite == "vello_canvas": FAIL
if subsuite == "vello_cpu_canvas": FAIL

View file

@ -0,0 +1,4 @@
[2d.gradient.radial.cone.front.html]
[Canvas test: 2d.gradient.radial.cone.front]
expected:
if subsuite == "vello_cpu_canvas": FAIL

View file

@ -0,0 +1,4 @@
[2d.gradient.radial.cone.top.html]
[Canvas test: 2d.gradient.radial.cone.top]
expected:
if subsuite == "vello_cpu_canvas": FAIL

View file

@ -0,0 +1,4 @@
[2d.gradient.radial.inside2.html]
[Canvas test: 2d.gradient.radial.inside2]
expected:
if subsuite == "vello_cpu_canvas": FAIL

View file

@ -0,0 +1,4 @@
[2d.gradient.radial.inside3.html]
[Canvas test: 2d.gradient.radial.inside3]
expected:
if subsuite == "vello_cpu_canvas": FAIL

View file

@ -0,0 +1,4 @@
[2d.gradient.radial.outside1.html]
[Canvas test: 2d.gradient.radial.outside1]
expected:
if subsuite == "vello_cpu_canvas": FAIL

View file

@ -2,3 +2,4 @@
[Canvas test: 2d.gradient.radial.outside3]
expected:
if subsuite == "": FAIL
if subsuite == "vello_cpu_canvas": FAIL

View file

@ -3,3 +3,4 @@
bug: https://github.com/linebender/vello/issues/1063
expected:
if subsuite == "vello_canvas": FAIL
if subsuite == "vello_cpu_canvas": FAIL

View file

@ -2,3 +2,4 @@
[Non-uniformly scaled arcs are the right shape]
expected:
if subsuite == "vello_canvas": FAIL
if subsuite == "vello_cpu_canvas": FAIL

View file

@ -1,5 +1,6 @@
[2d.path.rect.selfintersect.html]
[Canvas test: 2d.path.rect.selfintersect]
bug: https://github.com/linebender/vello/issues/1063#issuecomment-2998084736
bug: https://github.com/linebender/vello/issues/1063 #issuecomment-2998084736
expected:
if subsuite == "vello_canvas": FAIL
if subsuite == "vello_cpu_canvas": FAIL

View file

@ -2,3 +2,4 @@
[Stroke line widths are scaled by the current transformation matrix]
expected:
if subsuite == "vello_canvas": FAIL
if subsuite == "vello_cpu_canvas": FAIL

View file

@ -0,0 +1,4 @@
[2d.imageData.put.alpha.html]
[putImageData() puts non-solid image data correctly]
expected:
if subsuite == "vello_cpu_canvas": FAIL

View file

@ -1,4 +1,3 @@
[2d.imageData.put.unchanged.html]
[putImageData(getImageData(...), ...) has no effect]
expected:
if subsuite == "": FAIL
expected: FAIL

View file

@ -0,0 +1,8 @@
{
"vello_cpu_canvas": {
"config": {
"binary_args": ["--pref", "dom_canvas_vello_cpu_enabled"]
},
"include": ["/html/canvas/element"]
}
}