Commit b8faeec
committed
[GPU Process] Several tests in canvas/philip/tests are failing with text diffs
https://bugs.webkit.org/show_bug.cgi?id=216800
Reviewed by Darin Adler.
When using the GPU process to render canvas elements, we currently fail the 7 tests in `canvas/philip/tests`
below, due to gradient and pattern fill/stroke styles lingering on the 2D graphics context state after a fill or
stroke color is set, respectively.
This happens when:
1. The fill color is set to a color `C`.
2. A fill pattern or gradient is applied.
3. The fill color is set to the color `C` again.
In this case, after step (2), we propagate a graphics context state change indicating that the fill pattern has
changed, but we leave the fill color unchanged (i.e., it remains equal to `C`). In step (3), we then set the
fill color to `C` again, which doesn't propagate a state change to the GPU process, since the fill color is the
same (`C`). As such, the state in the GPU process keeps its fill gradient, and we end up filling with this old
gradient instead of the fill color `C`.
To fix this, we simply revert `fillColor` and `strokeColor` to the invalid color when setting a gradient or
pattern in the same way that we currently clear out the fill/stroke gradient and pattern when setting a fill/
stroke color, which ensures that a state change will be sent to the GPU process during step (3).
Fixes the following canvas-related layout tests when using the GPU process:
- canvas/philip/tests/2d.gradient.radial.cone.shape2.html
- canvas/philip/tests/2d.pattern.basic.nocontext.html
- canvas/philip/tests/2d.pattern.paint.norepeat.coord3.html
- canvas/philip/tests/2d.pattern.paint.repeatx.coord1.html
- canvas/philip/tests/2d.pattern.paint.repeatx.outside.html
- canvas/philip/tests/2d.pattern.paint.repeaty.coord1.html
- canvas/philip/tests/2d.pattern.paint.repeaty.outside.html
The entire canvas/ directory is currently skipped when enabling the GPU process for canvas rendering, but once
we're down to a smaller number of failures, I intend to unskip these directories for GPU process, and
individually track any remaining test failures.
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::setStrokePattern):
(WebCore::GraphicsContext::setFillPattern):
(WebCore::GraphicsContext::setStrokeGradient):
(WebCore::GraphicsContext::setFillGradient):
Canonical link: https://commits.webkit.org/229596@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267382 268f45cc-cd09-0410-ab3c-d52691b4dbfc1 parent a083f1a commit b8faeec
2 files changed
Lines changed: 49 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
1 | 46 | | |
2 | 47 | | |
3 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
602 | 602 | | |
603 | 603 | | |
604 | 604 | | |
| 605 | + | |
605 | 606 | | |
606 | 607 | | |
607 | 608 | | |
| |||
610 | 611 | | |
611 | 612 | | |
612 | 613 | | |
| 614 | + | |
613 | 615 | | |
614 | 616 | | |
615 | 617 | | |
| |||
618 | 620 | | |
619 | 621 | | |
620 | 622 | | |
| 623 | + | |
621 | 624 | | |
622 | 625 | | |
623 | 626 | | |
| |||
633 | 636 | | |
634 | 637 | | |
635 | 638 | | |
| 639 | + | |
636 | 640 | | |
637 | 641 | | |
638 | 642 | | |
| |||
0 commit comments