Bug 219468 - [GPU Process] Record changes in GraphicsContextState as individual DisplayList items
Summary: [GPU Process] Record changes in GraphicsContextState as individual DisplayLis...
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Said Abou-Hallawa
URL:
Keywords: InRadar
Depends on: 220079 221550 221637
Blocks:
  Show dependency treegraph
 
Reported: 2020-12-02 17:55 PST by Tim Horton
Modified: 2021-03-23 16:59 PDT (History)
23 users (show)

See Also:


Attachments
WIP (112.13 KB, patch)
2020-12-19 12:06 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
WIP (135.41 KB, patch)
2020-12-20 11:00 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (134.89 KB, patch)
2020-12-21 01:33 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
WIP (117.26 KB, patch)
2021-02-05 01:48 PST, Said Abou-Hallawa
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
WIP (118.24 KB, patch)
2021-02-05 02:06 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
WIP (123.74 KB, patch)
2021-02-05 11:22 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
WIP (122.25 KB, patch)
2021-02-05 14:48 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (127.67 KB, patch)
2021-02-05 21:57 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (129.03 KB, patch)
2021-02-06 00:50 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (42.74 KB, patch)
2021-02-14 00:50 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (46.25 KB, patch)
2021-02-14 12:52 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (45.72 KB, patch)
2021-02-15 11:38 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (95.95 KB, patch)
2021-02-16 22:53 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (97.52 KB, patch)
2021-02-17 01:45 PST, Said Abou-Hallawa
sabouhallawa: review?
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Horton 2020-12-02 17:55:16 PST
SHOULD NEVER BE REACHED
Source/WebKit/Platform/IPC/Encoder.h(110) : static RefPtr<WebCore::SharedBuffer> IPC::Encoder::encodeSingleObject(const T &) [T = WebCore::DisplayList::SetState]
WTFCrash
WTFCrashWithInfo(int, char const*, char const*, int)
WTF::RefPtr<WebCore::SharedBuffer, WTF::RawPtrTraits<WebCore::SharedBuffer>, WTF::DefaultRefDerefTraits<WebCore::SharedBuffer> > IPC::Encoder::encodeSingleObject<WebCore::DisplayList::SetState>(WebCore::DisplayList::SetState const&)
WebKit::RemoteImageBufferProxy<WebKit::ImageBufferShareableMappedIOSurfaceBackend>::encodeItem(WebCore::DisplayList::ItemHandle) const
non-virtual thunk to WebKit::RemoteImageBufferProxy<WebKit::ImageBufferShareableMappedIOSurfaceBackend>::encodeItem(WebCore::DisplayList::ItemHandle) const
WebCore::DisplayList::ItemBuffer::appendEncodedData(WebCore::DisplayList::ItemHandle)
void WebCore::DisplayList::ItemBuffer::append<WebCore::DisplayList::SetState, WebCore::GraphicsContextState const&, WTF::OptionSet<WebCore::GraphicsContextState::Change>&>(WebCore::GraphicsContextState const&, WTF::OptionSet<WebCore::GraphicsContextState::Change>&)
void WebCore::DisplayList::DisplayList::append<WebCore::DisplayList::SetState, WebCore::GraphicsContextState const&, WTF::OptionSet<WebCore::GraphicsContextState::Change>&>(WebCore::GraphicsContextState const&, WTF::OptionSet<WebCore::GraphicsContextState::Change>&)
void WebCore::DisplayList::Recorder::append<WebCore::DisplayList::SetState, WebCore::GraphicsContextState const&, WTF::OptionSet<WebCore::GraphicsContextState::Change>&>(WebCore::GraphicsContextState const&, WTF::OptionSet<WebCore::GraphicsContextState::Change>&)
WebCore::DisplayList::Recorder::appendStateChangeItem(WebCore::GraphicsContextStateChange const&, WTF::OptionSet<WebCore::GraphicsContextState::Change>)
Comment 1 Tim Horton 2020-12-02 17:55:32 PST
For example, canvas/philip/tests/2d.composite.globalAlpha.canvaspattern.html
Comment 2 Tim Horton 2020-12-02 17:56:04 PST
The problem is, SetState is encoded using encodeSingleObject, but it has things like Pattern hanging off of it.
Comment 3 Radar WebKit Bug Importer 2020-12-02 19:22:48 PST
<rdar://problem/71921036>
Comment 4 Tim Horton 2020-12-02 19:28:23 PST
And Pattern has an Image that it encodes with ImageHandle. We either need a subdisplaylist for the pattern or to instead cache that image ahead of time.
Comment 5 Said Abou-Hallawa 2020-12-19 12:06:45 PST
Created attachment 416572 [details]
WIP
Comment 6 Said Abou-Hallawa 2020-12-20 11:00:50 PST
Created attachment 416584 [details]
WIP
Comment 7 Said Abou-Hallawa 2020-12-21 01:33:12 PST
Created attachment 416597 [details]
Patch
Comment 8 Said Abou-Hallawa 2021-02-05 01:48:59 PST
Created attachment 419374 [details]
WIP
Comment 9 Said Abou-Hallawa 2021-02-05 02:06:37 PST
Created attachment 419375 [details]
WIP
Comment 10 Said Abou-Hallawa 2021-02-05 11:22:11 PST
Created attachment 419437 [details]
WIP
Comment 11 Said Abou-Hallawa 2021-02-05 14:48:41 PST
Created attachment 419468 [details]
WIP
Comment 12 Said Abou-Hallawa 2021-02-05 21:57:26 PST
Created attachment 419493 [details]
Patch
Comment 13 Said Abou-Hallawa 2021-02-06 00:50:25 PST
Created attachment 419497 [details]
Patch
Comment 14 Wenson Hsieh 2021-02-08 14:02:14 PST
Comment on attachment 419497 [details]
Patch

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

> Source/WebCore/platform/graphics/displaylists/DisplayListItems.h:170
> +class SetInlineState {

It looks like SetInlineState doesn't include RGBA (non-extended) stroke color or fill changes, which (IIRC) make up the bulk of state changes in Paths, Lines and Arcs in MotionMark. I think this could encompass changes to fill and stroke color that only use SRGBA<uint8_t> as well, to keep most of the state change items in these fully inline in those three subtests.

Though, perhaps this could be done as a followup.
Comment 15 Said Abou-Hallawa 2021-02-09 12:44:15 PST
Comment on attachment 419497 [details]
Patch

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

>> Source/WebCore/platform/graphics/displaylists/DisplayListItems.h:170
>> +class SetInlineState {
> 
> It looks like SetInlineState doesn't include RGBA (non-extended) stroke color or fill changes, which (IIRC) make up the bulk of state changes in Paths, Lines and Arcs in MotionMark. I think this could encompass changes to fill and stroke color that only use SRGBA<uint8_t> as well, to keep most of the state change items in these fully inline in those three subtests.
> 
> Though, perhaps this could be done as a followup.

Yes this is right. I wrote a similar comment in the ChangeLog above. "Future work is to make SetInlineState handle more cases for colors and gradients." But I will try to do this inline changes in the patch of this bug to avoid introducing regression.
Comment 16 Said Abou-Hallawa 2021-02-14 00:50:20 PST
Created attachment 420236 [details]
Patch
Comment 17 Said Abou-Hallawa 2021-02-14 12:52:29 PST
Created attachment 420249 [details]
Patch
Comment 18 Said Abou-Hallawa 2021-02-15 11:38:32 PST
Created attachment 420343 [details]
Patch
Comment 19 Said Abou-Hallawa 2021-02-16 22:53:45 PST
Created attachment 420601 [details]
Patch
Comment 20 Said Abou-Hallawa 2021-02-17 01:45:58 PST
Created attachment 420617 [details]
Patch