Skip to content

extend_mode_normalized and extend_mode#974

Merged
DJMcNab merged 6 commits intolinebender:mainfrom
sagudev:extend_mode_norm
May 29, 2025
Merged

extend_mode_normalized and extend_mode#974
DJMcNab merged 6 commits intolinebender:mainfrom
sagudev:extend_mode_norm

Conversation

@sagudev
Copy link
Contributor

@sagudev sagudev commented May 7, 2025

Current extend_mode is renamed to extend_mode_normalized (because it require normalized coordinates). To avoid rounding errors we introduce extend_mode that relaxes normalization requirement. Currently only EXTEND_PAD is implemented differently, others fallback to extend_mode_normalized for now.

partial fix #972

@sagudev sagudev force-pushed the extend_mode_norm branch from 1465e2d to 5059273 Compare May 7, 2025 12:29
@sagudev sagudev marked this pull request as ready for review May 7, 2025 12:37
Copy link
Member

@DJMcNab DJMcNab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thought on testing. Once that's addressed, I'll be happy to land. I don't think this is going to be meaningfully reviewed by anyone else anytime soon.

@sagudev
Copy link
Contributor Author

sagudev commented May 20, 2025

It works on my local ubuntu machine but not in CI. Is this the case for #[cfg_attr(skip_gpu_tests, ignore)]?

@DJMcNab
Copy link
Member

DJMcNab commented May 21, 2025

The windows failure certainly would be caused by the lack of GPU support for those runners. I'm not sure what the ubuntu failure is. Unfortunately, #892 means that the "current version" uploading of the snapshots is currently broken. I'll open a PR to fix that today.

@DJMcNab
Copy link
Member

DJMcNab commented May 26, 2025

And if you can rebase #1018, that would make debugging the failure on ubuntu more plausible to debug

sagudev added 3 commits May 26, 2025 19:42
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
@sagudev sagudev force-pushed the extend_mode_norm branch from 94c02dd to efb8af0 Compare May 26, 2025 17:42
@sagudev
Copy link
Contributor Author

sagudev commented May 26, 2025

rebased!

@DJMcNab
Copy link
Member

DJMcNab commented May 29, 2025

I'm assuming that the failure on Ubuntu is because we're using a fallback CPU implementation of Vulkan, and therefore the precision is too high. What isn't at all clear to me is why the similar test from #971 passed on that version.

I think just marking the new tests as #[ignore] unconditionally is the least bad option to unblock us. We should however setup the usual skip_gpu_tests for them, so it doesn't fail on windows.

sagudev added 2 commits May 29, 2025 10:56
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
because CI uses SW which is more accurate then real GPUs

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Copy link
Member

@DJMcNab DJMcNab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small detail then we can land this. Thanks!

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
@DJMcNab DJMcNab added this pull request to the merge queue May 29, 2025
Merged via the queue into linebender:main with commit 7b32dc2 May 29, 2025
17 checks passed
github-merge-queue bot pushed a commit to servo/servo that referenced this pull request Jul 26, 2025
Add vello backend by implementing Backend traits in canvas crate (so
this lives in canvas_paint_thread - embedded process). Current
implementation uses normal wgpu, so we block on GPU work. Vello backend
is gated behind `vello` feature and `dom_canvas_vello_enabled` pref.

Feature-wise this backend is on on par with raqote (sometimes better
sometimes worse), but performance wise it's worse.

## Known vello problems:

- image roundtrip does not work (fixed in
linebender/vello#974)
- linebender/vello#1066 (fixed)
- clip layers are not working properly:
linebender/vello#1061
  - `/html/canvas/element/pixel-manipulation/2d.imageData.put.*`
  - `/html/canvas/element/path-objects/2d.path.clip.intersect.html`
- linebender/vello#1056
-
`/html/canvas/element/fill-and-stroke-styles/2d.gradient.interpolate.coloralpha.html`
- `kurbo::Cap::Butt` is defect (only visible with big lineWidth)
linebender/vello#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
(linebender/vello#1063 (comment)):
  - `/html/canvas/element/path-objects/2d.path.rect.selfintersect.html`
- There is currently no way to do put image properly in vello as we
would need to ignore all clips and other stuff (we try to work around
this on best effort basis)
linebender/vello#1088
  - `/html/canvas/element/pixel-manipulation/2d.imageData.put.*`
- precision problems
  - `/html/canvas/element/path-objects/2d.path.stroke.scale2.html`
  - `/html/canvas/element/path-objects/2d.path.arc.scale.1.html`

## Known servo problems

- bad performance due to blocking on GPU work
  - some get/put intensive tests `TIMEOUT`
- proper shadow support (non-blocker as we already are living without it
now)
- support for rect shadow is there but unimplemented currently as that's
the state in raqote

Testing: `mach try vello` will run normal WPT (with raqote) +
vello_canvas subsuite that runs only on `/html/canvas/element`. All
subsuite expectations are stored separately.
Fixes: #36823
Fixes: #35230

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
minghuaw pushed a commit to minghuaw/servo that referenced this pull request Aug 1, 2025
Add vello backend by implementing Backend traits in canvas crate (so
this lives in canvas_paint_thread - embedded process). Current
implementation uses normal wgpu, so we block on GPU work. Vello backend
is gated behind `vello` feature and `dom_canvas_vello_enabled` pref.

Feature-wise this backend is on on par with raqote (sometimes better
sometimes worse), but performance wise it's worse.

## Known vello problems:

- image roundtrip does not work (fixed in
linebender/vello#974)
- linebender/vello#1066 (fixed)
- clip layers are not working properly:
linebender/vello#1061
  - `/html/canvas/element/pixel-manipulation/2d.imageData.put.*`
  - `/html/canvas/element/path-objects/2d.path.clip.intersect.html`
- linebender/vello#1056
-
`/html/canvas/element/fill-and-stroke-styles/2d.gradient.interpolate.coloralpha.html`
- `kurbo::Cap::Butt` is defect (only visible with big lineWidth)
linebender/vello#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
(linebender/vello#1063 (comment)):
  - `/html/canvas/element/path-objects/2d.path.rect.selfintersect.html`
- There is currently no way to do put image properly in vello as we
would need to ignore all clips and other stuff (we try to work around
this on best effort basis)
linebender/vello#1088
  - `/html/canvas/element/pixel-manipulation/2d.imageData.put.*`
- precision problems
  - `/html/canvas/element/path-objects/2d.path.stroke.scale2.html`
  - `/html/canvas/element/path-objects/2d.path.arc.scale.1.html`

## Known servo problems

- bad performance due to blocking on GPU work
  - some get/put intensive tests `TIMEOUT`
- proper shadow support (non-blocker as we already are living without it
now)
- support for rect shadow is there but unimplemented currently as that's
the state in raqote

Testing: `mach try vello` will run normal WPT (with raqote) +
vello_canvas subsuite that runs only on `/html/canvas/element`. All
subsuite expectations are stored separately.
Fixes: servo#36823
Fixes: servo#35230

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Images do not roundtrip

2 participants