Bug 225424

Summary: DisplayList::Recorder::canAppendItemOfType shouldn't be responsible for appending context state change items
Product: WebKit Reporter: Cameron McCormack (:heycam) <heycam>
Component: Layout and RenderingAssignee: Cameron McCormack (:heycam) <heycam>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Cameron McCormack (:heycam) 2021-05-05 17:07:16 PDT
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.
Comment 1 Cameron McCormack (:heycam) 2021-05-05 17:16:09 PDT
Created attachment 427824 [details]
Patch
Comment 2 Simon Fraser (smfr) 2021-05-05 20:01:55 PDT
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
Comment 3 Cameron McCormack (:heycam) 2021-05-06 00:33:38 PDT
Created attachment 427855 [details]
Patch
Comment 4 EWS 2021-05-06 01:53:00 PDT
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].
Comment 5 Radar WebKit Bug Importer 2021-05-06 01:53:13 PDT
<rdar://problem/77598075>