- Revision
- 240663
- Author
- [email protected]
- Date
- 2019-01-29 10:18:52 -0800 (Tue, 29 Jan 2019)
Log Message
REGRESSION (PSON): Flash on link navigation on Mac
https://bugs.webkit.org/show_bug.cgi?id=193961
<rdar://problem/47482507>
Reviewed by Chris Dumez.
The target page sends EnterAcceleratedCompositingMode message too early, before we have a valid layer tree.
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attach): Deleted.
Not needed anymore.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::reinitializeWebPage):
(WebKit::WebPage::didCompletePageTransition):
(WebKit::m_shouldAttachDrawingAreaOnPageTransition): Deleted.
Move message sending logic fully to TiledCoreAnimationDrawingArea.
Unfreezing the layer tree is sufficient to trigger the message.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
There is no need to treat process swap case differently.
(WebKit::TiledCoreAnimationDrawingArea::sendEnterAcceleratedCompositingModeIfNeeded):
Send this after the first successful layer flush with the root layer set.
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::attach): Deleted.
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (240662 => 240663)
--- trunk/Source/WebKit/ChangeLog 2019-01-29 18:15:49 UTC (rev 240662)
+++ trunk/Source/WebKit/ChangeLog 2019-01-29 18:18:52 UTC (rev 240663)
@@ -1,3 +1,40 @@
+2019-01-29 Antti Koivisto <[email protected]>
+
+ REGRESSION (PSON): Flash on link navigation on Mac
+ https://bugs.webkit.org/show_bug.cgi?id=193961
+ <rdar://problem/47482507>
+
+ Reviewed by Chris Dumez.
+
+ The target page sends EnterAcceleratedCompositingMode message too early, before we have a valid layer tree.
+
+ * WebProcess/WebPage/DrawingArea.h:
+ (WebKit::DrawingArea::attach): Deleted.
+
+ Not needed anymore.
+
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::reinitializeWebPage):
+ (WebKit::WebPage::didCompletePageTransition):
+ (WebKit::m_shouldAttachDrawingAreaOnPageTransition): Deleted.
+
+ Move message sending logic fully to TiledCoreAnimationDrawingArea.
+ Unfreezing the layer tree is sufficient to trigger the message.
+
+ * WebProcess/WebPage/WebPage.h:
+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+ (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
+
+ There is no need to treat process swap case differently.
+
+ (WebKit::TiledCoreAnimationDrawingArea::sendEnterAcceleratedCompositingModeIfNeeded):
+
+ Send this after the first successful layer flush with the root layer set.
+
+ (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
+ (WebKit::TiledCoreAnimationDrawingArea::attach): Deleted.
+
2019-01-29 Timothy Hatcher <[email protected]>
Add back some includes that got removed at some point.
Modified: trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.h (240662 => 240663)
--- trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.h 2019-01-29 18:15:49 UTC (rev 240662)
+++ trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.h 2019-01-29 18:18:52 UTC (rev 240663)
@@ -149,8 +149,6 @@
virtual void deviceOrPageScaleFactorChanged() = 0;
#endif
- virtual void attach() { };
-
protected:
DrawingArea(DrawingAreaType, WebPage&);
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (240662 => 240663)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2019-01-29 18:15:49 UTC (rev 240662)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2019-01-29 18:18:52 UTC (rev 240663)
@@ -401,9 +401,6 @@
, m_userInterfaceLayoutDirection(parameters.userInterfaceLayoutDirection)
, m_overrideContentSecurityPolicy { parameters.overrideContentSecurityPolicy }
, m_cpuLimit(parameters.cpuLimit)
-#if PLATFORM(MAC)
- , m_shouldAttachDrawingAreaOnPageTransition(parameters.isProcessSwap)
-#endif
{
ASSERT(m_pageID);
@@ -700,9 +697,6 @@
m_drawingArea->setShouldScaleViewToFitDocument(parameters.shouldScaleViewToFitDocument);
m_drawingArea->updatePreferences(parameters.store);
m_drawingArea->setPaintingEnabled(true);
-#if PLATFORM(MAC)
- m_shouldAttachDrawingAreaOnPageTransition = parameters.isProcessSwap;
-#endif
unfreezeLayerTree(LayerTreeFreezeReason::PageSuspended);
}
@@ -3099,18 +3093,6 @@
bool isInitialEmptyDocument = !m_mainFrame;
if (!isInitialEmptyDocument)
unfreezeLayerTree(LayerTreeFreezeReason::ProcessSwap);
-
-#if PLATFORM(MAC)
- if (m_shouldAttachDrawingAreaOnPageTransition && !isInitialEmptyDocument) {
- m_shouldAttachDrawingAreaOnPageTransition = false;
- // Unfreezing the layer tree above schedules a layer flush so we delay attaching the drawing area
- // after the next event loop iteration.
- RunLoop::main().dispatch([this, weakThis = makeWeakPtr(*this)] {
- if (weakThis && m_drawingArea)
- m_drawingArea->attach();
- });
- }
-#endif
}
void WebPage::show()
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (240662 => 240663)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2019-01-29 18:15:49 UTC (rev 240662)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2019-01-29 18:18:52 UTC (rev 240663)
@@ -1805,9 +1805,6 @@
OptionSet<LayerTreeFreezeReason> m_LayerTreeFreezeReasons;
bool m_isSuspended { false };
bool m_needsFontAttributes { false };
-#if PLATFORM(MAC)
- bool m_shouldAttachDrawingAreaOnPageTransition { false };
-#endif
};
} // namespace WebKit
Modified: trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h (240662 => 240663)
--- trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h 2019-01-29 18:15:49 UTC (rev 240662)
+++ trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h 2019-01-29 18:18:52 UTC (rev 240663)
@@ -49,7 +49,7 @@
class LayerHostingContext;
-class TiledCoreAnimationDrawingArea : public DrawingArea {
+class TiledCoreAnimationDrawingArea : public DrawingArea, public CanMakeWeakPtr<TiledCoreAnimationDrawingArea> {
public:
TiledCoreAnimationDrawingArea(WebPage&, const WebPageCreationParameters&);
virtual ~TiledCoreAnimationDrawingArea();
@@ -102,7 +102,7 @@
void addTransactionCallbackID(CallbackID) override;
void setShouldScaleViewToFitDocument(bool) override;
- void attach() override;
+ void sendEnterAcceleratedCompositingModeIfNeeded();
void adjustTransientZoom(double scale, WebCore::FloatPoint origin) override;
void commitTransientZoom(double scale, WebCore::FloatPoint origin) override;
@@ -177,6 +177,7 @@
bool m_isThrottlingLayerFlushes { false };
bool m_isLayerFlushThrottlingTemporarilyDisabledForInteraction { false };
+ bool m_needsSendEnterAcceleratedCompositingMode { true };
WebCore::Timer m_layerFlushThrottlingTimer;
};
Modified: trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (240662 => 240663)
--- trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm 2019-01-29 18:15:49 UTC (rev 240662)
+++ trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm 2019-01-29 18:18:52 UTC (rev 240663)
@@ -96,9 +96,6 @@
updateLayerHostingContext();
setColorSpace(parameters.colorSpace);
-
- if (!parameters.isProcessSwap)
- attach();
}
TiledCoreAnimationDrawingArea::~TiledCoreAnimationDrawingArea()
@@ -106,11 +103,23 @@
invalidateLayerFlushRunLoopObserver();
}
-void TiledCoreAnimationDrawingArea::attach()
+void TiledCoreAnimationDrawingArea::sendEnterAcceleratedCompositingModeIfNeeded()
{
- LayerTreeContext layerTreeContext;
- layerTreeContext.contextID = m_layerHostingContext->contextID();
- m_webPage.send(Messages::DrawingAreaProxy::EnterAcceleratedCompositingMode(0, layerTreeContext));
+ if (!m_rootLayer)
+ return;
+
+ if (!m_needsSendEnterAcceleratedCompositingMode)
+ return;
+ m_needsSendEnterAcceleratedCompositingMode = false;
+
+ // Let the first commit complete before sending.
+ RunLoop::main().dispatch([this, weakThis = makeWeakPtr(*this)] {
+ if (!weakThis)
+ return;
+ LayerTreeContext layerTreeContext;
+ layerTreeContext.contextID = m_layerHostingContext->contextID();
+ m_webPage.send(Messages::DrawingAreaProxy::EnterAcceleratedCompositingMode(0, layerTreeContext));
+ });
}
void TiledCoreAnimationDrawingArea::setNeedsDisplay()
@@ -502,8 +511,10 @@
m_pendingCallbackIDs.clear();
}
- if (didFlushAllFrames)
+ if (didFlushAllFrames) {
+ sendEnterAcceleratedCompositingModeIfNeeded();
invalidateLayerFlushRunLoopObserver();
+ }
if (m_isThrottlingLayerFlushes)
startLayerFlushThrottlingTimer();