Title: [241060] branches/safari-607-branch/Source/WebKit
Revision
241060
Author
[email protected]
Date
2019-02-06 14:16:28 -0800 (Wed, 06 Feb 2019)

Log Message

Cherry-pick r240663. rdar://problem/47774492

    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.

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240663 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-607-branch/Source/WebKit/ChangeLog (241059 => 241060)


--- branches/safari-607-branch/Source/WebKit/ChangeLog	2019-02-06 22:16:25 UTC (rev 241059)
+++ branches/safari-607-branch/Source/WebKit/ChangeLog	2019-02-06 22:16:28 UTC (rev 241060)
@@ -1,5 +1,84 @@
 2019-02-05  Alan Coon  <[email protected]>
 
+        Cherry-pick r240663. rdar://problem/47774492
+
+    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.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240663 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    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-02-05  Alan Coon  <[email protected]>
+
         Cherry-pick r240660. rdar://problem/47774552
 
     REGRESSION (PSON): Twitter link gets stuck at t.co after navigating back in tab

Modified: branches/safari-607-branch/Source/WebKit/WebProcess/WebPage/DrawingArea.h (241059 => 241060)


--- branches/safari-607-branch/Source/WebKit/WebProcess/WebPage/DrawingArea.h	2019-02-06 22:16:25 UTC (rev 241059)
+++ branches/safari-607-branch/Source/WebKit/WebProcess/WebPage/DrawingArea.h	2019-02-06 22:16:28 UTC (rev 241060)
@@ -149,8 +149,6 @@
     virtual void deviceOrPageScaleFactorChanged() = 0;
 #endif
 
-    virtual void attach() { };
-
 protected:
     DrawingArea(DrawingAreaType, WebPage&);
 

Modified: branches/safari-607-branch/Source/WebKit/WebProcess/WebPage/WebPage.cpp (241059 => 241060)


--- branches/safari-607-branch/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2019-02-06 22:16:25 UTC (rev 241059)
+++ branches/safari-607-branch/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2019-02-06 22:16:28 UTC (rev 241060)
@@ -400,9 +400,6 @@
     , m_userInterfaceLayoutDirection(parameters.userInterfaceLayoutDirection)
     , m_overrideContentSecurityPolicy { parameters.overrideContentSecurityPolicy }
     , m_cpuLimit(parameters.cpuLimit)
-#if PLATFORM(MAC)
-    , m_shouldAttachDrawingAreaOnPageTransition(parameters.isProcessSwap)
-#endif
 {
     ASSERT(m_pageID);
 
@@ -695,9 +692,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);
     }
 
@@ -3096,18 +3090,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: branches/safari-607-branch/Source/WebKit/WebProcess/WebPage/WebPage.h (241059 => 241060)


--- branches/safari-607-branch/Source/WebKit/WebProcess/WebPage/WebPage.h	2019-02-06 22:16:25 UTC (rev 241059)
+++ branches/safari-607-branch/Source/WebKit/WebProcess/WebPage/WebPage.h	2019-02-06 22:16:28 UTC (rev 241060)
@@ -1803,9 +1803,6 @@
     OptionSet<LayerTreeFreezeReason> m_LayerTreeFreezeReasons;
     bool m_isSuspended { false };
     bool m_needsFontAttributes { false };
-#if PLATFORM(MAC)
-    bool m_shouldAttachDrawingAreaOnPageTransition { false };
-#endif
 };
 
 } // namespace WebKit

Modified: branches/safari-607-branch/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h (241059 => 241060)


--- branches/safari-607-branch/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h	2019-02-06 22:16:25 UTC (rev 241059)
+++ branches/safari-607-branch/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h	2019-02-06 22:16:28 UTC (rev 241060)
@@ -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: branches/safari-607-branch/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (241059 => 241060)


--- branches/safari-607-branch/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm	2019-02-06 22:16:25 UTC (rev 241059)
+++ branches/safari-607-branch/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm	2019-02-06 22:16:28 UTC (rev 241060)
@@ -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();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to