RESOLVED FIXED 208971
[GPU Process] GraphicsContextStateChange must accumulate fill and stroke fields as single properties
https://bugs.webkit.org/show_bug.cgi?id=208971
Summary [GPU Process] GraphicsContextStateChange must accumulate fill and stroke fiel...
Said Abou-Hallawa
Reported 2020-03-11 19:46:26 PDT
The fill and stroke can be color, gradient or pattern. When setting the fill or the stroke of the GraphicsContextState to any of them, the other two are nullified. GraphicsContextStateChange should behave similarly when any of the fill or the stroke flags is true.
Attachments
test case (746 bytes, text/html)
2020-03-11 19:49 PDT, Said Abou-Hallawa
no flags
Patch (6.19 KB, patch)
2020-03-11 20:24 PDT, Said Abou-Hallawa
no flags
Patch (9.52 KB, patch)
2020-03-11 22:27 PDT, Said Abou-Hallawa
no flags
Said Abou-Hallawa
Comment 1 2020-03-11 19:49:24 PDT
Created attachment 393331 [details] test case
Said Abou-Hallawa
Comment 2 2020-03-11 19:49:43 PDT
Repro steps: 1. Launch mini-browser 2. Enable Settings/Internal Features/Render Canvas in GPU Process 3. Open the attached test case Result: the test case shows a red rectangle Expected: the test case shows a green rectangle
Said Abou-Hallawa
Comment 3 2020-03-11 19:55:06 PDT
The same bug happens when enabling Settings/Enable Display List Drawing.
Said Abou-Hallawa
Comment 4 2020-03-11 20:24:45 PDT
Said Abou-Hallawa
Comment 5 2020-03-11 20:26:10 PDT
This fixes the following tests: canvas/philip/tests/2d.pattern.modify.canvas2.html canvas/philip/tests/2d.pattern.modify.image2.html when using the following command: run-webkit-tests --debug --no-retry --internal-feature RenderCanvasInGPUProcessEnabled LayoutTests/canvas/philip/tests/2d.pattern.modify.canvas2.html LayoutTests/canvas/philip/tests/2d.pattern.modify.image2.html
Simon Fraser (smfr)
Comment 6 2020-03-11 20:44:38 PDT
Comment on attachment 393332 [details] Patch Should there be a TestExpectations change?
Said Abou-Hallawa
Comment 7 2020-03-11 22:15:57 PDT
(In reply to Simon Fraser (smfr) from comment #6) > Comment on attachment 393332 [details] > Patch > > Should there be a TestExpectations change? The two tests I mentioned above fail only when running 'run-webkit-tests --internal-feature RenderCanvasInGPUProcessEnabled'. The attached test case fails in the browser when enabling GPU reddening or DisplayList rendering. The patch fixes the following scenario: var pattern = ctx1.createPattern(canvas2, 'no-repeat'); ctx1.fillStyle = pattern; ctx1.fillRect(0, 0, canvas1.width, canvas1.height); ctx1.fillStyle = 'red'; ctx1.fillRect(0, 0, canvas1.width, canvas1.height); ctx1.fillStyle = pattern; ctx1.fillRect(0, 0, canvas1.width, canvas1.height); The bug is in the last fillStyle. GraphicsContextStateChange::changesFromState() returns 0 because although the flag GraphicsContextState::FillPatternChange is set, the value of the property 'fillPattern' is the same in m_state and state. So no SetState item is created for the last fillRect.
Said Abou-Hallawa
Comment 8 2020-03-11 22:27:43 PDT
WebKit Commit Bot
Comment 9 2020-03-12 01:10:20 PDT
Comment on attachment 393341 [details] Patch Clearing flags on attachment: 393341 Committed r258317: <https://trac.webkit.org/changeset/258317>
WebKit Commit Bot
Comment 10 2020-03-12 01:10:22 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 11 2020-03-12 01:11:15 PDT
Note You need to log in before you can comment on or make changes to this bug.