RESOLVED FIXED Bug 184336
When recording the drawing, the DisplayList should be initialized with the GraphicsContextState of the underlying GraphicsContext
https://bugs.webkit.org/show_bug.cgi?id=184336
Summary When recording the drawing, the DisplayList should be initialized with the Gr...
Said Abou-Hallawa
Reported 2018-04-05 11:26:16 PDT
The state of the drawing context has to be transfered to the recording DisplayList before recording. Many recording GraphicsContext functions will behave wrongly if get the default state. Here is a scenario of the bug: -- context.m_state.fillColor = RED (context is the underlying GraphicsContext for the recorded DisplayList) -- displayListRecorder is created to start recording. -- displayListRecorder.m_stateStack[0].lastDrawingState.fillColor = BALCK (Because lastDrawingState was initialized by the default GraphicsContextState) -- displayListContext is created which encapsulates the displayListRecorder -- displayListContext.setFillColor(BALCK) is called -- displayListContext.fillRect(rect) is called -- displayListRecorder is replayed back into context Result: -- displayListContext.fillRect() will end up calling Recorder::willAppendItem() which will call GraphicsContextStateChange::changesFromState() -- GraphicsContextStateChange::changesFromState() will not find a change in the fillColor. The recording GraphicsContext has it BALCK and it was BALCK. So there is no change here and the flag FillColorChange will not be returned -- Recorder::willAppendItem() will not append a new SetState item in the DisplayList -- The rectangle is filled with the current fillColor which is RED instead of BALCK as the caller wanted
Attachments
Patch (8.14 KB, patch)
2018-04-05 11:36 PDT, Said Abou-Hallawa
no flags
Patch (8.14 KB, patch)
2018-04-05 11:43 PDT, Said Abou-Hallawa
no flags
Said Abou-Hallawa
Comment 1 2018-04-05 11:36:09 PDT
Said Abou-Hallawa
Comment 2 2018-04-05 11:43:21 PDT
WebKit Commit Bot
Comment 3 2018-04-06 12:19:46 PDT
Comment on attachment 337282 [details] Patch Clearing flags on attachment: 337282 Committed r230347: <https://trac.webkit.org/changeset/230347>
WebKit Commit Bot
Comment 4 2018-04-06 12:19:48 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 5 2018-04-06 12:20:33 PDT
Note You need to log in before you can comment on or make changes to this bug.