Title: [243998] releases/WebKitGTK/webkit-2.24/Source/WebCore
Revision
243998
Author
carlo...@webkit.org
Date
2019-04-08 03:44:51 -0700 (Mon, 08 Apr 2019)

Log Message

Merge r243866 - [GTK][WPE] Use a timer to request the creation of pending tiles
https://bugs.webkit.org/show_bug.cgi?id=196594

Reviewed by Žan Doberšek.

Use a timer to request pending tile creation, as calls to notifyFlushRequired() are discarded
while inside a layer flush.

* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
(WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
(WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
(WebCore::CoordinatedGraphicsLayer::requestPendingTileCreationTimerFired):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.24/Source/WebCore/ChangeLog (243997 => 243998)


--- releases/WebKitGTK/webkit-2.24/Source/WebCore/ChangeLog	2019-04-08 10:44:47 UTC (rev 243997)
+++ releases/WebKitGTK/webkit-2.24/Source/WebCore/ChangeLog	2019-04-08 10:44:51 UTC (rev 243998)
@@ -1,3 +1,20 @@
+2019-04-04  Miguel Gomez  <mago...@igalia.com>
+
+        [GTK][WPE] Use a timer to request the creation of pending tiles
+        https://bugs.webkit.org/show_bug.cgi?id=196594
+
+        Reviewed by Žan Doberšek.
+
+        Use a timer to request pending tile creation, as calls to notifyFlushRequired() are discarded
+        while inside a layer flush.
+
+        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
+        (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
+        (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
+        (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
+        (WebCore::CoordinatedGraphicsLayer::requestPendingTileCreationTimerFired):
+        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
+
 2019-04-05  Sergio Villar Senin  <svil...@igalia.com>
 
         [GTK][WPE] outlook.live.com displays old-fashioned UI

Modified: releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp (243997 => 243998)


--- releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp	2019-04-08 10:44:47 UTC (rev 243997)
+++ releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp	2019-04-08 10:44:51 UTC (rev 243998)
@@ -44,6 +44,10 @@
 #endif
 #include <wtf/text/CString.h>
 
+#if USE(GLIB_EVENT_LOOP)
+#include <wtf/glib/RunLoopSourcePriority.h>
+#endif
+
 namespace WebCore {
 
 Ref<GraphicsLayer> GraphicsLayer::create(GraphicsLayerFactory* factory, GraphicsLayerClient& client, Type layerType)
@@ -121,6 +125,7 @@
     , m_coordinator(0)
     , m_compositedNativeImagePtr(0)
     , m_animationStartedTimer(*this, &CoordinatedGraphicsLayer::animationStartedTimerFired)
+    , m_requestPendingTileCreationTimer(RunLoop::main(), this, &CoordinatedGraphicsLayer::requestPendingTileCreationTimerFired)
 {
     static Nicosia::PlatformLayer::LayerID nextLayerID = 1;
     m_id = nextLayerID++;
@@ -130,6 +135,10 @@
 
     // Enforce a complete flush on the first occasion.
     m_nicosia.delta.value = UINT_MAX;
+
+#if USE(GLIB_EVENT_LOOP)
+    m_requestPendingTileCreationTimer.setPriority(RunLoopSourcePriority::LayerFlushTimer);
+#endif
 }
 
 CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer()
@@ -624,6 +633,9 @@
 
 void CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly()
 {
+    // Whether it kicked or not, we don't need this timer running anymore.
+    m_requestPendingTileCreationTimer.stop();
+
     // When we have a transform animation, we need to update visible rect every frame to adjust the visible rect of a backing store.
     bool hasActiveTransformAnimation = selfOrAncestorHasActiveTransformAnimation();
     if (hasActiveTransformAnimation)
@@ -937,10 +949,11 @@
             didUpdateTileBuffers();
     }
 
-    // Request a second update immediately if some tiles are still pending creation.
+    // Request a new update immediately if some tiles are still pending creation. Do this on a timer
+    // as we're in a layer flush and flush requests at this point would be discarded.
     if (layerState.hasPendingTileCreation) {
         setNeedsVisibleRectAdjustment();
-        notifyFlushRequired();
+        m_requestPendingTileCreationTimer.startOneShot(0_s);
     }
 
     finishUpdate();
@@ -1183,6 +1196,11 @@
     client().notifyAnimationStarted(this, "", m_lastAnimationStartTime);
 }
 
+void CoordinatedGraphicsLayer::requestPendingTileCreationTimerFired()
+{
+    notifyFlushRequired();
+}
+
 bool CoordinatedGraphicsLayer::usesContentsLayer() const
 {
     return m_nicosia.contentLayer || m_compositedImage;

Modified: releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h (243997 => 243998)


--- releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h	2019-04-08 10:44:47 UTC (rev 243997)
+++ releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h	2019-04-08 10:44:51 UTC (rev 243998)
@@ -33,6 +33,7 @@
 #include "NicosiaPlatformLayer.h"
 #include "TextureMapperAnimation.h"
 #include "TransformationMatrix.h"
+#include <wtf/RunLoop.h>
 #include <wtf/text/StringHash.h>
 
 namespace Nicosia {
@@ -149,6 +150,7 @@
     float effectiveContentsScale();
 
     void animationStartedTimerFired();
+    void requestPendingTileCreationTimerFired();
 
     bool filtersCanBeComposited(const FilterOperations&) const;
 
@@ -183,6 +185,7 @@
     NativeImagePtr m_compositedNativeImagePtr;
 
     Timer m_animationStartedTimer;
+    RunLoop::Timer<CoordinatedGraphicsLayer> m_requestPendingTileCreationTimer;
     TextureMapperAnimations m_animations;
     MonotonicTime m_lastAnimationStartTime;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to