Changeset 267382 in webkit
- Timestamp:
- Sep 21, 2020, 4:25:25 PM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
platform/graphics/GraphicsContext.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r267381 r267382 1 2020-09-21 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [GPU Process] Several tests in canvas/philip/tests are failing with text diffs 4 https://bugs.webkit.org/show_bug.cgi?id=216800 5 6 Reviewed by Darin Adler. 7 8 When using the GPU process to render canvas elements, we currently fail the 7 tests in `canvas/philip/tests` 9 below, due to gradient and pattern fill/stroke styles lingering on the 2D graphics context state after a fill or 10 stroke color is set, respectively. 11 12 This happens when: 13 1. The fill color is set to a color `C`. 14 2. A fill pattern or gradient is applied. 15 3. The fill color is set to the color `C` again. 16 17 In this case, after step (2), we propagate a graphics context state change indicating that the fill pattern has 18 changed, but we leave the fill color unchanged (i.e., it remains equal to `C`). In step (3), we then set the 19 fill color to `C` again, which doesn't propagate a state change to the GPU process, since the fill color is the 20 same (`C`). As such, the state in the GPU process keeps its fill gradient, and we end up filling with this old 21 gradient instead of the fill color `C`. 22 23 To fix this, we simply revert `fillColor` and `strokeColor` to the invalid color when setting a gradient or 24 pattern in the same way that we currently clear out the fill/stroke gradient and pattern when setting a fill/ 25 stroke color, which ensures that a state change will be sent to the GPU process during step (3). 26 27 Fixes the following canvas-related layout tests when using the GPU process: 28 - canvas/philip/tests/2d.gradient.radial.cone.shape2.html 29 - canvas/philip/tests/2d.pattern.basic.nocontext.html 30 - canvas/philip/tests/2d.pattern.paint.norepeat.coord3.html 31 - canvas/philip/tests/2d.pattern.paint.repeatx.coord1.html 32 - canvas/philip/tests/2d.pattern.paint.repeatx.outside.html 33 - canvas/philip/tests/2d.pattern.paint.repeaty.coord1.html 34 - canvas/philip/tests/2d.pattern.paint.repeaty.outside.html 35 36 The entire canvas/ directory is currently skipped when enabling the GPU process for canvas rendering, but once 37 we're down to a smaller number of failures, I intend to unskip these directories for GPU process, and 38 individually track any remaining test failures. 39 40 * platform/graphics/GraphicsContext.cpp: 41 (WebCore::GraphicsContext::setStrokePattern): 42 (WebCore::GraphicsContext::setFillPattern): 43 (WebCore::GraphicsContext::setStrokeGradient): 44 (WebCore::GraphicsContext::setFillGradient): 45 1 46 2020-09-21 Chris Dumez <cdumez@apple.com> 2 47 -
trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp
r265261 r267382 603 603 void GraphicsContext::setStrokePattern(Ref<Pattern>&& pattern) 604 604 { 605 m_state.strokeColor = { }; 605 606 m_state.strokeGradient = nullptr; 606 607 m_state.strokePattern = WTFMove(pattern); … … 611 612 void GraphicsContext::setFillPattern(Ref<Pattern>&& pattern) 612 613 { 614 m_state.fillColor = { }; 613 615 m_state.fillGradient = nullptr; 614 616 m_state.fillPattern = WTFMove(pattern); … … 619 621 void GraphicsContext::setStrokeGradient(Ref<Gradient>&& gradient) 620 622 { 623 m_state.strokeColor = { }; 621 624 m_state.strokeGradient = WTFMove(gradient); 622 625 m_state.strokePattern = nullptr; … … 634 637 void GraphicsContext::setFillGradient(Ref<Gradient>&& gradient) 635 638 { 639 m_state.fillColor = { }; 636 640 m_state.fillGradient = WTFMove(gradient); 637 641 m_state.fillPattern = nullptr;
Note:
See TracChangeset
for help on using the changeset viewer.