Bug 218720 - Rename ImageBuffer::flushDisplayList to ImageBuffer::submitDisplayList
Summary: Rename ImageBuffer::flushDisplayList to ImageBuffer::submitDisplayList
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: DoNotImportToRadar
Depends on:
Blocks: 218426
  Show dependency treegraph
 
Reported: 2020-11-09 11:57 PST by Wenson Hsieh
Modified: 2020-11-09 15:12 PST (History)
4 users (show)

See Also:


Attachments
Patch (11.83 KB, patch)
2020-11-09 12:25 PST, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Patch (13.88 KB, patch)
2020-11-09 13:41 PST, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Patch (11.83 KB, patch)
2020-11-09 13:46 PST, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wenson Hsieh 2020-11-09 11:57:18 PST
ImageBuffer's `flushDisplayList` method is currently only responsible for replaying the given display list into the image buffer's drawing context, and doesn't actually guarantee a context flush. A name like `renderDisplayList` seems more fitting.
Comment 1 Said Abou-Hallawa 2020-11-09 12:09:24 PST
(In reply to Wenson Hsieh from comment #0)
> ImageBuffer's `flushDisplayList` method is currently only responsible for
> replaying the given display list into the image buffer's drawing context,
> and doesn't actually guarantee a context flush. A name like
> `renderDisplayList` seems more fitting.

I think this statement is a little inaccurate. The "flushDisplayList" is responsible for replaying the given display list into the image buffer's "backend context".

Using the "drawing context" is a little vague here because DisplayList::DrawingContext refers to the class that wraps the DisplayList::Recorder.

Regarding the new name "renderDisplayList", I am not sure why it is better than flushDisplayList() especially when we deal with cross process operation and where WebP does not really renders the display list to the backend context.
Comment 2 Simon Fraser (smfr) 2020-11-09 12:15:59 PST
flush() implies "play this out until the end", and normally flush is used for a function that doesn't take arguments; it's "flush out existing state".

So flush(DisplayList&) is a bit ambiguous. Is there already some internal DisplayList that gets flushed out first?
Comment 3 Wenson Hsieh 2020-11-09 12:25:55 PST
Created attachment 413618 [details]
Patch
Comment 4 Tim Horton 2020-11-09 12:46:17 PST
How about "submit"?
Comment 5 Wenson Hsieh 2020-11-09 12:48:59 PST
(In reply to Tim Horton from comment #4)
> How about "submit"?

"submitDisplayList" sounds fine to me (I think I actually prefer it to "renderDisplayList", since "submit" is a more accurate word to describe what happens in RemoteImageBufferProxy).
Comment 6 Said Abou-Hallawa 2020-11-09 12:49:19 PST
For me, 'flush' means "When you empty something, you flush it." This means you just get rid of it and you do not have to know where it will end up.

And yes all, we only flush the internal DisplayList of the ImageBuffer to its remote backend. So we should only be flushing the ImageBuffer's existence state.

I think the problem is flushDisplayList() is used in both RemoteImageBufferProxy and RemoteImageBuffer. In RemoteImageBufferProxy, it is used to send the DisplayList to GPUP. But in RemoteImageBuffer, it is used to replay, apply or render the DisplayList into the backend.

My suggestion is:

Remove the virtual function ImageBuffer::flushDisplayList()
Remove RemoteImageBuffer::flushDisplayList() and inline it in RemoteRenderingBackend::applyDisplayList()
Make RemoteImageBufferProxy::flushDisplayList() private none virtual.
Comment 7 Wenson Hsieh 2020-11-09 13:32:23 PST
(In reply to Said Abou-Hallawa from comment #6)
> For me, 'flush' means "When you empty something, you flush it." This means
> you just get rid of it and you do not have to know where it will end up.
> 
> And yes all, we only flush the internal DisplayList of the ImageBuffer to
> its remote backend. So we should only be flushing the ImageBuffer's
> existence state.
> 
> I think the problem is flushDisplayList() is used in both
> RemoteImageBufferProxy and RemoteImageBuffer. In RemoteImageBufferProxy, it
> is used to send the DisplayList to GPUP. But in RemoteImageBuffer, it is
> used to replay, apply or render the DisplayList into the backend.
> 
> My suggestion is:
> 
> Remove the virtual function ImageBuffer::flushDisplayList()
> Remove RemoteImageBuffer::flushDisplayList() and inline it in
> RemoteRenderingBackend::applyDisplayList()
> Make RemoteImageBufferProxy::flushDisplayList() private none virtual.

(We chatted about this on Slack, and decided to use the name "submitDisplayList" for now to deal with the confusion around flushing, and then remove `ImageBuffer::flushDisplayList` later, which will require some additional refactoring around ConcreteImageBuffer)
Comment 8 Wenson Hsieh 2020-11-09 13:41:41 PST Comment hidden (obsolete)
Comment 9 Wenson Hsieh 2020-11-09 13:46:11 PST
Created attachment 413627 [details]
Patch
Comment 10 EWS 2020-11-09 15:12:03 PST
Committed r269606: <https://trac.webkit.org/changeset/269606>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 413627 [details].