Title: [246030] trunk/Source/WebKit
Revision
246030
Author
[email protected]
Date
2019-06-03 01:07:06 -0700 (Mon, 03 Jun 2019)

Log Message

REGRESSION(r244182): [CoordinatedGraphics] Related view doesn't receive graphic updates
https://bugs.webkit.org/show_bug.cgi?id=198418

Reviewed by Žan Doberšek.

This is because we need a DisplayRefreshMonitor per drawing area, but the one from the first ThreradedCompositor
is always reused because they use the same display ID.

* WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
(WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode): Use a unique display ID derived from
WebPage's ID.
(WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingMode): Use the primary display ID.
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
(WebKit::LayerTreeHost::LayerTreeHost): Get the current web page display ID instead of inventing one.
(WebKit::LayerTreeHost::setIsDiscardable): Do not change display ID.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (246029 => 246030)


--- trunk/Source/WebKit/ChangeLog	2019-06-03 05:29:47 UTC (rev 246029)
+++ trunk/Source/WebKit/ChangeLog	2019-06-03 08:07:06 UTC (rev 246030)
@@ -1,3 +1,21 @@
+2019-06-03  Carlos Garcia Campos  <[email protected]>
+
+        REGRESSION(r244182): [CoordinatedGraphics] Related view doesn't receive graphic updates
+        https://bugs.webkit.org/show_bug.cgi?id=198418
+
+        Reviewed by Žan Doberšek.
+
+        This is because we need a DisplayRefreshMonitor per drawing area, but the one from the first ThreradedCompositor
+        is always reused because they use the same display ID.
+
+        * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
+        (WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode): Use a unique display ID derived from
+        WebPage's ID.
+        (WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingMode): Use the primary display ID.
+        * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
+        (WebKit::LayerTreeHost::LayerTreeHost): Get the current web page display ID instead of inventing one.
+        (WebKit::LayerTreeHost::setIsDiscardable): Do not change display ID.
+
 2019-06-01  Dean Jackson  <[email protected]>
 
         Provide an action to save an image on a link sheet

Modified: trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp (246029 => 246030)


--- trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp	2019-06-03 05:29:47 UTC (rev 246029)
+++ trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp	2019-06-03 08:07:06 UTC (rev 246030)
@@ -544,6 +544,10 @@
     m_exitCompositingTimer.stop();
     m_wantsToExitAcceleratedCompositingMode = false;
 
+    // In order to ensure that we get a unique DisplayRefreshMonitor per-DrawingArea (necessary because ThreadedDisplayRefreshMonitor
+    // is driven by the ThreadedCompositor of the drawing area), give each page a unique DisplayID derived from WebPage's unique ID.
+    m_webPage.windowScreenDidChange(std::numeric_limits<uint32_t>::max() - m_webPage.pageID().toUInt64());
+
     ASSERT(!m_layerTreeHost);
     if (m_previousLayerTreeHost) {
         m_layerTreeHost = WTFMove(m_previousLayerTreeHost);
@@ -597,6 +601,9 @@
     m_previousLayerTreeHost->setLayerFlushSchedulingEnabled(false);
     m_discardPreviousLayerTreeHostTimer.startOneShot(5_s);
 
+    // Always use the primary display ID (0) when not in accelerated compositing mode.
+    m_webPage.windowScreenDidChange(0);
+
     m_dirtyRegion = m_webPage.bounds();
 
     if (m_inUpdateBackingStoreState)

Modified: trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp (246029 => 246030)


--- trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp	2019-06-03 05:29:47 UTC (rev 246029)
+++ trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp	2019-06-03 08:07:06 UTC (rev 246030)
@@ -34,6 +34,7 @@
 #include "DrawingArea.h"
 #include "WebPage.h"
 #include "WebPageProxyMessages.h"
+#include <WebCore/Chrome.h>
 #include <WebCore/Frame.h>
 #include <WebCore/FrameView.h>
 #include <WebCore/PageOverlayController.h>
@@ -45,13 +46,6 @@
 namespace WebKit {
 using namespace WebCore;
 
-static const PlatformDisplayID primaryDisplayID = 0;
-#if PLATFORM(GTK)
-static const PlatformDisplayID compositingDisplayID = 1;
-#else
-static const PlatformDisplayID compositingDisplayID = primaryDisplayID;
-#endif
-
 LayerTreeHost::LayerTreeHost(WebPage& webPage)
     : m_webPage(webPage)
     , m_coordinator(webPage.corePage(), *this)
@@ -83,13 +77,11 @@
         if (m_surface->shouldPaintMirrored())
             paintFlags |= TextureMapper::PaintingMirrored;
 
-        m_compositor = ThreadedCompositor::create(m_compositorClient, m_compositorClient, compositingDisplayID, scaledSize, scaleFactor, ThreadedCompositor::ShouldDoFrameSync::Yes, paintFlags);
+        m_compositor = ThreadedCompositor::create(m_compositorClient, m_compositorClient, m_webPage.corePage()->chrome().displayID(), scaledSize, scaleFactor, ThreadedCompositor::ShouldDoFrameSync::Yes, paintFlags);
         m_layerTreeContext.contextID = m_surface->surfaceID();
     } else
-        m_compositor = ThreadedCompositor::create(m_compositorClient, m_compositorClient, compositingDisplayID, scaledSize, scaleFactor);
+        m_compositor = ThreadedCompositor::create(m_compositorClient, m_compositorClient, m_webPage.corePage()->chrome().displayID(), scaledSize, scaleFactor);
 
-    m_webPage.windowScreenDidChange(compositingDisplayID);
-
     didChangeViewport();
 }
 
@@ -324,10 +316,8 @@
     m_isDiscardable = discardable;
     if (m_isDiscardable) {
         m_discardableSyncActions = OptionSet<DiscardableSyncActions>();
-        m_webPage.windowScreenDidChange(primaryDisplayID);
         return;
     }
-    m_webPage.windowScreenDidChange(compositingDisplayID);
 
     if (m_discardableSyncActions.isEmpty())
         return;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to