Bug 225424 - DisplayList::Recorder::canAppendItemOfType shouldn't be responsible for appending context state change items
Summary: DisplayList::Recorder::canAppendItemOfType shouldn't be responsible for appen...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Cameron McCormack (:heycam)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-05-05 17:07 PDT by Cameron McCormack (:heycam)
Modified: 2021-05-06 01:53 PDT (History)
4 users (show)

See Also:


Attachments
Patch (5.06 KB, patch)
2021-05-05 17:16 PDT, Cameron McCormack (:heycam)
no flags Details | Formatted Diff | Diff
Patch (5.23 KB, patch)
2021-05-06 00:33 PDT, Cameron McCormack (:heycam)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>