WebKit Bugzilla
Attachment 368684 Details for
Bug 197451
: REGRESSION (r244182): RenderingUpdate should not be scheduled for invisible pages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-197451-20190501102638.patch (text/plain), 6.61 KB, created by
Said Abou-Hallawa
on 2019-05-01 10:26:39 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Said Abou-Hallawa
Created:
2019-05-01 10:26:39 PDT
Size:
6.61 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 244816) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,41 @@ >+2019-04-30 Said Abou-Hallawa <sabouhallawa@apple.com> >+ >+ REGRESSION (r244182): RenderingUpdate should not be scheduled for invisible pages >+ https://bugs.webkit.org/show_bug.cgi?id=197451 >+ >+ Reviewed by Simon Fraser. >+ >+ Before r244182, some web pages never need to schedule a RenderingUpdate. >+ Only pages with rAF callbacks, web animations, intersection and resize >+ observers needed to do so. After r244182, all pages have to schedule a >+ RenderingUpdate when a page rendering update is required. >+ >+ When Safari opens, it create a 'blank' web page. The blank page will not >+ be visible unless the user selects to show the 'Empty page' in the new >+ tab. Although the blank page is not visible, the loader needs to resolveStyle() >+ which requires to scheduleLayerFlushNow(). >+ >+ We need to optimize this case: calling scheduleLayerFlushNow() for invisible >+ pages. We do that by checking if the page is visible before scheduling >+ the RenderingUpdate. >+ >+ Also we need to change or get rid of scheduleLayerFlushNow() since its name >+ has become confusing. It suggests that it is going to schedule flushing >+ the layer 'now'. But after r244182, it does scheduleRenderingUpdate() first. >+ And when it fires, scheduleCompositingLayerFlush() will be called. >+ >+ * page/RenderingUpdateScheduler.cpp: >+ (WebCore::RenderingUpdateScheduler::scheduleRenderingUpdate): >+ * rendering/RenderLayerCompositor.cpp: >+ (WebCore::RenderLayerCompositor::scheduleLayerFlush): >+ (WebCore::RenderLayerCompositor::didChangeVisibleRect): >+ (WebCore::RenderLayerCompositor::frameViewDidScroll): >+ (WebCore::RenderLayerCompositor::attachRootLayer): >+ (WebCore::RenderLayerCompositor::setLayerFlushThrottlingEnabled): >+ (WebCore::RenderLayerCompositor::layerFlushTimerFired): >+ (WebCore::RenderLayerCompositor::scheduleLayerFlushNow): Deleted. >+ * rendering/RenderLayerCompositor.h: >+ > 2019-04-30 Youenn Fablet <youenn@apple.com> > > Make Document audio producers use WeakPtr >Index: Source/WebCore/page/RenderingUpdateScheduler.cpp >=================================================================== >--- Source/WebCore/page/RenderingUpdateScheduler.cpp (revision 244501) >+++ Source/WebCore/page/RenderingUpdateScheduler.cpp (working copy) >@@ -47,6 +47,12 @@ void RenderingUpdateScheduler::scheduleR > if (isScheduled()) > return; > >+ // Optimize the case when an invisible page wants just to schedule layer flush. >+ if (!m_page.isVisible()) { >+ scheduleCompositingLayerFlush(); >+ return; >+ } >+ > tracePoint(ScheduleRenderingUpdate); > > #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) >Index: Source/WebCore/rendering/RenderLayerCompositor.cpp >=================================================================== >--- Source/WebCore/rendering/RenderLayerCompositor.cpp (revision 244501) >+++ Source/WebCore/rendering/RenderLayerCompositor.cpp (working copy) >@@ -448,12 +448,6 @@ void RenderLayerCompositor::notifyFlushR > scheduleLayerFlush(layer->canThrottleLayerFlush()); > } > >-void RenderLayerCompositor::scheduleLayerFlushNow() >-{ >- m_hasPendingLayerFlush = false; >- page().renderingUpdateScheduler().scheduleRenderingUpdate(); >-} >- > void RenderLayerCompositor::scheduleLayerFlush(bool canThrottle) > { > ASSERT(!m_flushingLayers); >@@ -461,11 +455,12 @@ void RenderLayerCompositor::scheduleLaye > if (canThrottle) > startInitialLayerFlushTimerIfNeeded(); > >- if (canThrottle && isThrottlingLayerFlushes()) { >+ if (canThrottle && isThrottlingLayerFlushes()) > m_hasPendingLayerFlush = true; >- return; >+ else { >+ m_hasPendingLayerFlush = false; >+ page().renderingUpdateScheduler().scheduleRenderingUpdate(); > } >- scheduleLayerFlushNow(); > } > > FloatRect RenderLayerCompositor::visibleRectForLayerFlushing() const >@@ -595,7 +590,7 @@ void RenderLayerCompositor::didChangeVis > bool requiresFlush = rootLayer->visibleRectChangeRequiresFlush(visibleRect); > LOG_WITH_STREAM(Compositing, stream << "RenderLayerCompositor::didChangeVisibleRect " << visibleRect << " requiresFlush " << requiresFlush); > if (requiresFlush) >- scheduleLayerFlushNow(); >+ scheduleLayerFlush(); > } > > void RenderLayerCompositor::notifyFlushBeforeDisplayRefresh(const GraphicsLayer*) >@@ -1889,7 +1884,7 @@ void RenderLayerCompositor::frameViewDid > // it will also manage updating the scroll layer position. > if (hasCoordinatedScrolling()) { > // We have to schedule a flush in order for the main TiledBacking to update its tile coverage. >- scheduleLayerFlushNow(); >+ scheduleLayerFlush(); > return; > } > >@@ -3780,7 +3775,7 @@ void RenderLayerCompositor::attachRootLa > rootLayerAttachmentChanged(); > > if (m_shouldFlushOnReattach) { >- scheduleLayerFlushNow(); >+ scheduleLayerFlush(); > m_shouldFlushOnReattach = false; > } > } >@@ -4352,7 +4347,7 @@ void RenderLayerCompositor::setLayerFlus > m_layerFlushTimer.stop(); > if (!m_hasPendingLayerFlush) > return; >- scheduleLayerFlushNow(); >+ scheduleLayerFlush(); > } > > void RenderLayerCompositor::disableLayerFlushThrottlingTemporarilyForInteraction() >@@ -4395,7 +4390,7 @@ void RenderLayerCompositor::layerFlushTi > { > if (!m_hasPendingLayerFlush) > return; >- scheduleLayerFlushNow(); >+ scheduleLayerFlush(); > } > > #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) >Index: Source/WebCore/rendering/RenderLayerCompositor.h >=================================================================== >--- Source/WebCore/rendering/RenderLayerCompositor.h (revision 244501) >+++ Source/WebCore/rendering/RenderLayerCompositor.h (working copy) >@@ -168,7 +168,7 @@ public: > > // GraphicsLayers buffer state, which gets pushed to the underlying platform layers > // at specific times. >- void scheduleLayerFlush(bool canThrottle); >+ void scheduleLayerFlush(bool canThrottle = false); > void flushPendingLayerChanges(bool isFlushRoot = true); > > // Called when the GraphicsLayer for the given RenderLayer has flushed changes inside of flushPendingLayerChanges(). >@@ -526,7 +526,6 @@ private: > > bool shouldCompositeOverflowControls() const; > >- void scheduleLayerFlushNow(); > bool isThrottlingLayerFlushes() const; > void startInitialLayerFlushTimerIfNeeded(); > void startLayerFlushTimerIfNeeded();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 197451
:
368642
| 368684