Bug 225381 - DisplayList::Recorder::ContextState::wasUsedForDrawing is unused and can probably be removed
Summary: DisplayList::Recorder::ContextState::wasUsedForDrawing is unused and can prob...
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-04 21:41 PDT by Cameron McCormack (:heycam)
Modified: 2021-05-05 16:07 PDT (History)
5 users (show)

See Also:


Attachments
Patch (2.61 KB, patch)
2021-05-04 21:47 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-04 21:41:09 PDT
.
Comment 1 Cameron McCormack (:heycam) 2021-05-04 21:47:48 PDT
Created attachment 427732 [details]
Patch
Comment 2 Said Abou-Hallawa 2021-05-05 11:36:07 PDT
This member was introduced in r194708 and its use was removed in r257958. Its original goal was to remove save/restore pair from DisplayList if no drawing happens in between. For example a sequence like this can be completed removed from the DisplayList since its replaying back has no effect:

context.save();
context.setFillColor(Color::green);
context.restore();

But the problem was in the Canvas case where calling the save() and restore() may happen in different frames. Recording a restore item may try to remove the last save item although the matching save item was pushed to the context of the ImageBuffer many frames earlier.
Comment 3 Cameron McCormack (:heycam) 2021-05-05 15:36:22 PDT
Thanks for the background.  I did do a `grep -G wasUsedForDrawing` to check, but that didn't bring up the r257958 commit (since that removed a use of the `stateUsedForDrawing` local variable).
Comment 4 Cameron McCormack (:heycam) 2021-05-05 15:36:49 PDT
(In reply to Cameron McCormack (:heycam) from comment #3)
> Thanks for the background.  I did do a `grep -G wasUsedForDrawing`

*git grep -G wasUsedForDrawing
Comment 5 EWS 2021-05-05 16:06:28 PDT
Committed r277050 (237360@main): <https://commits.webkit.org/237360@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 427732 [details].
Comment 6 Radar WebKit Bug Importer 2021-05-05 16:07:14 PDT
<rdar://problem/77580546>