Bug 223847

Summary: Plumb DisplayUpdate through the display refresh monitors
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: WebCore Misc.Assignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: annulen, cdumez, cmarcelo, ews-watchlist, graouts, gyuyoung.kim, japhet, luiz, ryuan.choi, sabouhallawa, sam, sergio, simon.fraser, thorton, webkit-bug-importer, zeno
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
ews-feeder: commit-queue-
Patch
ews-feeder: commit-queue-
Patch
ews-feeder: commit-queue-
Patch
none
Patch sam: review+

Simon Fraser (smfr)
Reported 2021-03-27 21:08:23 PDT
Plumb DisplayUpdate through the display refresh monitors
Attachments
Patch (51.18 KB, patch)
2021-03-27 21:23 PDT, Simon Fraser (smfr)
ews-feeder: commit-queue-
Patch (51.77 KB, patch)
2021-03-27 22:07 PDT, Simon Fraser (smfr)
ews-feeder: commit-queue-
Patch (51.77 KB, patch)
2021-03-27 23:19 PDT, Simon Fraser (smfr)
ews-feeder: commit-queue-
Patch (51.78 KB, patch)
2021-03-27 23:38 PDT, Simon Fraser (smfr)
no flags
Patch (51.78 KB, patch)
2021-03-28 08:53 PDT, Simon Fraser (smfr)
sam: review+
Simon Fraser (smfr)
Comment 1 2021-03-27 21:23:16 PDT
Simon Fraser (smfr)
Comment 2 2021-03-27 22:07:25 PDT
Simon Fraser (smfr)
Comment 3 2021-03-27 23:19:32 PDT
Simon Fraser (smfr)
Comment 4 2021-03-27 23:38:23 PDT
Simon Fraser (smfr)
Comment 5 2021-03-28 08:53:57 PDT
Sam Weinig
Comment 6 2021-03-28 15:06:02 PDT
Comment on attachment 424498 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=424498&action=review > Source/WebCore/ChangeLog:15 > + that's that's necessary for downstream clients. that's that's -> that's > Source/WebKit/ChangeLog:15 > + the highest possible frequency; at various stages of propagation the rate might be halved if > + that's that's necessary for downstream clients. that's that's -> that's > Source/WebKit/ChangeLog:18 > + To make this frequency splitting logic simple, this patch introduces DisplayUpdate, which > + represents the fractional second for the current update. The numerator is the frame index, The first sentence here is a bit confusing here: "...DisplayUpdate, which represents the fractional second for the current update". It seems more like "DisplayUpdate represents an update of the display, and contains data about it in the form of ...", is that correct? > Source/WebCore/platform/graphics/DisplayUpdate.h:46 > + void didUpdate() > + { > + updateIndex = (updateIndex + 1) % updatesPerSecond; > + } I think this would be a bit more easy to understand if this returned a new DisplayUpdate and was called something like nextUpdate(). That way we could treat these as immutable values, which is a bit easier to think about. > Source/WebCore/platform/graphics/ios/DisplayRefreshMonitorIOS.mm:40 > +constexpr WebCore::FramesPerSecond DisplayLinkFramesPerSecond = 60; Should this be named something like preferredDisplayLinkFramesPerSecond or maximumDisplayLinkFramesPerSecond? It's a bit sad this is hard coded here and not something more configurable per-page. > Source/WebCore/platform/graphics/mac/LegacyDisplayRefreshMonitorMac.h:46 > + const DisplayUpdate& currentUpdate() const { return m_currentUpdate; } I think this could just return DisplayUpdate, rather than a reference, give how small it is.
Radar WebKit Bug Importer
Comment 7 2021-03-29 09:40:55 PDT
Simon Fraser (smfr)
Comment 8 2021-03-29 10:07:52 PDT
(In reply to Sam Weinig from comment #6) > Comment on attachment 424498 [details] > > Source/WebCore/platform/graphics/DisplayUpdate.h:46 > > + void didUpdate() > > + { > > + updateIndex = (updateIndex + 1) % updatesPerSecond; > > + } > > I think this would be a bit more easy to understand if this returned a new > DisplayUpdate and was called something like nextUpdate(). That way we could > treat these as immutable values, which is a bit easier to think about. Done. > > Source/WebCore/platform/graphics/ios/DisplayRefreshMonitorIOS.mm:40 > > +constexpr WebCore::FramesPerSecond DisplayLinkFramesPerSecond = 60; > > Should this be named something like preferredDisplayLinkFramesPerSecond or > maximumDisplayLinkFramesPerSecond? It's a bit sad this is hard coded here > and not something more configurable per-page. DisplayRefreshMonitorIOS is only used in UIWebView so I think is OK to hardcode 60. > > > Source/WebCore/platform/graphics/mac/LegacyDisplayRefreshMonitorMac.h:46 > > + const DisplayUpdate& currentUpdate() const { return m_currentUpdate; } Was unused, so I removed it.
Tim Horton
Comment 9 2021-03-29 10:20:29 PDT
(In reply to Simon Fraser (smfr) from comment #8) > (In reply to Sam Weinig from comment #6) > > Comment on attachment 424498 [details] > > > Source/WebCore/platform/graphics/ios/DisplayRefreshMonitorIOS.mm:40 > > > +constexpr WebCore::FramesPerSecond DisplayLinkFramesPerSecond = 60; > > > > Should this be named something like preferredDisplayLinkFramesPerSecond or > > maximumDisplayLinkFramesPerSecond? It's a bit sad this is hard coded here > > and not something more configurable per-page. > > DisplayRefreshMonitorIOS is only used in UIWebView so I think is OK to > hardcode 60. Maybe you should Legacy- this one like you did the WebView one?
Simon Fraser (smfr)
Comment 10 2021-03-29 10:21:50 PDT
Note You need to log in before you can comment on or make changes to this bug.