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.
Created attachment 393331 [details] test case
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
The same bug happens when enabling Settings/Enable Display List Drawing.
Created attachment 393332 [details] Patch
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
Comment on attachment 393332 [details] Patch Should there be a TestExpectations change?
(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.
Created attachment 393341 [details] Patch
Comment on attachment 393341 [details] Patch Clearing flags on attachment: 393341 Committed r258317: <https://trac.webkit.org/changeset/258317>
All reviewed patches have been landed. Closing bug.
<rdar://problem/60360906>