It's non-obvious from the name that canAppendItemOfType can also end up appending an item. So let's split out the context state change item out into a separate function.
Created attachment 427824 [details] Patch
Comment on attachment 427824 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=427824&action=review > Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp:124 > bool Recorder::canAppendItemOfType(ItemType type) This function can now be const. > Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp:129 > +void Recorder::appendStateChangeItemIfStateHasChanged() Usually we say "IfNecessary" > Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp:131 > + GraphicsContextStateChange& stateChanges = currentState().stateChange; auto& > Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp:132 > + GraphicsContextState::StateChangeFlags changesFromLastState = stateChanges.changesFromState(currentState().lastDrawingState); auto
Created attachment 427855 [details] Patch
Committed r277075 (237378@main): <https://commits.webkit.org/237378@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 427855 [details].
<rdar://problem/77598075>