Bug 225582 - [GPU Process] Simplify DisplayList::Iterator part 9: Migrate DisplayList::Iterator's API to use DisplayListItem rather than ItemHandle, and update callers
Summary: [GPU Process] Simplify DisplayList::Iterator part 9: Migrate DisplayList::Ite...
Status: ASSIGNED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Myles C. Maxfield
URL:
Keywords: InRadar
Depends on: 225579
Blocks: 223560
  Show dependency treegraph
 
Reported: 2021-05-09 15:57 PDT by Myles C. Maxfield
Modified: 2021-05-23 10:55 PDT (History)
3 users (show)

See Also:


Attachments
WIP (47.20 KB, patch)
2021-05-09 15:59 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Patch for reviewing (51.72 KB, patch)
2021-05-09 17:37 PDT, Myles C. Maxfield
sam: review+
Details | Formatted Diff | Diff
Patch for EWS (81.39 KB, patch)
2021-05-09 17:40 PDT, Myles C. Maxfield
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch for committing (55.50 KB, patch)
2021-05-10 02:54 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Patch for committing (54.86 KB, patch)
2021-05-10 02:58 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Updated patch for EWS (83.83 KB, patch)
2021-05-10 02:59 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Myles C. Maxfield 2021-05-09 15:57:36 PDT
Migrate DisplayList::Iterator's API to use DisplayListItem rather than ItemHandle, and update callers
Comment 1 Myles C. Maxfield 2021-05-09 15:59:22 PDT
Created attachment 428142 [details]
WIP
Comment 2 Myles C. Maxfield 2021-05-09 17:37:39 PDT
Created attachment 428145 [details]
Patch for reviewing
Comment 3 Myles C. Maxfield 2021-05-09 17:40:36 PDT
Created attachment 428146 [details]
Patch for EWS
Comment 4 Sam Weinig 2021-05-09 18:36:02 PDT
Comment on attachment 428145 [details]
Patch for reviewing

View in context: https://bugs.webkit.org/attachment.cgi?id=428145&action=review

> Source/WebCore/ChangeLog:12
> +        - DisplayList::append() goes from 134 lines to 3

Feels good, right?

> Source/WebCore/platform/graphics/displaylists/DisplayList.cpp:90
> +    auto visitor = WTF::makeVisitor([&](const SetState& stateItem) -> bool {

I've been encouraging use of the helper WTF::switchOn(variant, ...) which wraps makeVisitor() and just reads a bit nicer in my opinion.

> Source/WebCore/platform/graphics/displaylists/DisplayListItems.h:2385
> +inline constexpr bool isDrawingItem(const DisplayListItem& displayListItem)
> +{
> +    return WTF::visit([](const auto& displayListItem) {
> +        return displayListItem.isDrawingItem;
> +    }, displayListItem);
> +}

This will end up being a bit of a big function due to all the cases it needs to handle so unless it is particularly performance sensitive, I would recommend moving the implementation out of line. I don't think the constexpr will apply in most cases as you usually don't have a constexpr DisplayListItem.

> Source/WebCore/platform/graphics/displaylists/DisplayListReplayer.cpp:115
> +template<typename Item>
> +static inline typename std::enable_if_t<!HasApply<Item>, void> apply(const Item&, GraphicsContext&)

These should go on the same line.

> Source/WebCore/platform/graphics/displaylists/DisplayListReplayer.cpp:120
> +template<typename Item>
> +static inline typename std::enable_if_t<HasApply<Item>, void> apply(const Item& item, GraphicsContext& graphicsContext)

These should go on the same line.
Comment 5 Myles C. Maxfield 2021-05-10 02:54:06 PDT
Created attachment 428159 [details]
Patch for committing
Comment 6 Myles C. Maxfield 2021-05-10 02:58:35 PDT
Created attachment 428160 [details]
Patch for committing
Comment 7 Myles C. Maxfield 2021-05-10 02:59:09 PDT
Created attachment 428161 [details]
Updated patch for EWS
Comment 8 Radar WebKit Bug Importer 2021-05-16 15:58:19 PDT
<rdar://problem/78084300>
Comment 9 Sam Weinig 2021-05-23 08:52:10 PDT
Myles, you still planning on landing these? Would be great to get them in.
Comment 10 Myles C. Maxfield 2021-05-23 10:55:58 PDT
(In reply to Sam Weinig from comment #9)
> Myles, you still planning on landing these? Would be great to get them in.

I am, but they cause a MotionMark regression. I need to figure out why.