Title: [157184] trunk/Source/WebCore
Revision
157184
Author
[email protected]
Date
2013-10-09 14:01:10 -0700 (Wed, 09 Oct 2013)

Log Message

[CoordinatedGraphics] ASSERTION FAILED: !m_flushingLayers (after r156291)
https://bugs.webkit.org/show_bug.cgi?id=122016

Patch by Sergio Correia <[email protected]> on 2013-10-09
Reviewed by Noam Rosenthal.

To prevent calling scheduleLayerFlush() inside flushCompositingState(),
we now only call m_client->notifyFlushRequired() - which will trigger
scheduleLayerFlush() - if we are not already flushing layer changes.

No new tests, covered by existing ones.

* platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
(WebCore::CompositingCoordinator::notifyFlushRequired): Check if we
are already flushing layer changes before calling notifyFlushRequired.
(WebCore::CompositingCoordinator::sizeDidChange): Use notifyFlushRequired()
from CompositingCoordinator instead of calling the one from m_client
directly.
(WebCore::CompositingCoordinator::createGraphicsLayer): Ditto.
(WebCore::CompositingCoordinator::detachLayer): Ditto.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::notifyFlushRequired): Added helper
to check whether we are flushing layer changes before calling client()'s
notifyFlushRequired(). It returns a boolean indicating whether it
called the client's method.
(WebCore::CoordinatedGraphicsLayer::didChangeLayerState): Use the
notifyFlushRequired() helper.
(WebCore::CoordinatedGraphicsLayer::didChangeAnimations): Ditto.
(WebCore::CoordinatedGraphicsLayer::didChangeChildren): Ditto.
(WebCore::CoordinatedGraphicsLayer::didChangeFilters): Ditto.
(WebCore::CoordinatedGraphicsLayer::didChangeImageBacking): Ditto.
(WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay): Ditto.
(WebCore::CoordinatedGraphicsLayer::setContentsToCanvas): Ditto.
(WebCore::CoordinatedGraphicsLayer::flushCompositingState): Ditto.
(WebCore::CoordinatedGraphicsLayer::tiledBackingStoreHasPendingTileCreation):Ditto.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
Declaration of the notifyFlushRequired() helper.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (157183 => 157184)


--- trunk/Source/WebCore/ChangeLog	2013-10-09 21:00:02 UTC (rev 157183)
+++ trunk/Source/WebCore/ChangeLog	2013-10-09 21:01:10 UTC (rev 157184)
@@ -1,3 +1,42 @@
+2013-10-09  Sergio Correia  <[email protected]>
+
+        [CoordinatedGraphics] ASSERTION FAILED: !m_flushingLayers (after r156291)
+        https://bugs.webkit.org/show_bug.cgi?id=122016
+
+        Reviewed by Noam Rosenthal.
+
+        To prevent calling scheduleLayerFlush() inside flushCompositingState(),
+        we now only call m_client->notifyFlushRequired() - which will trigger
+        scheduleLayerFlush() - if we are not already flushing layer changes.
+
+        No new tests, covered by existing ones.
+
+        * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
+        (WebCore::CompositingCoordinator::notifyFlushRequired): Check if we
+        are already flushing layer changes before calling notifyFlushRequired.
+        (WebCore::CompositingCoordinator::sizeDidChange): Use notifyFlushRequired()
+        from CompositingCoordinator instead of calling the one from m_client
+        directly.
+        (WebCore::CompositingCoordinator::createGraphicsLayer): Ditto.
+        (WebCore::CompositingCoordinator::detachLayer): Ditto.
+        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
+        (WebCore::CoordinatedGraphicsLayer::notifyFlushRequired): Added helper
+        to check whether we are flushing layer changes before calling client()'s
+        notifyFlushRequired(). It returns a boolean indicating whether it
+        called the client's method.
+        (WebCore::CoordinatedGraphicsLayer::didChangeLayerState): Use the
+        notifyFlushRequired() helper.
+        (WebCore::CoordinatedGraphicsLayer::didChangeAnimations): Ditto.
+        (WebCore::CoordinatedGraphicsLayer::didChangeChildren): Ditto.
+        (WebCore::CoordinatedGraphicsLayer::didChangeFilters): Ditto.
+        (WebCore::CoordinatedGraphicsLayer::didChangeImageBacking): Ditto.
+        (WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay): Ditto.
+        (WebCore::CoordinatedGraphicsLayer::setContentsToCanvas): Ditto.
+        (WebCore::CoordinatedGraphicsLayer::flushCompositingState): Ditto.
+        (WebCore::CoordinatedGraphicsLayer::tiledBackingStoreHasPendingTileCreation):Ditto.
+        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
+        Declaration of the notifyFlushRequired() helper.
+
 2013-10-09  Chris Fleizach  <[email protected]>
 
         AX: VoiceOver double speaks all items in <li> nodes

Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp (157183 => 157184)


--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp	2013-10-09 21:00:02 UTC (rev 157183)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp	2013-10-09 21:01:10 UTC (rev 157184)
@@ -90,7 +90,7 @@
 void CompositingCoordinator::sizeDidChange(const IntSize& newSize)
 {
     m_rootLayer->setSize(newSize);
-    m_client->notifyFlushRequired();
+    notifyFlushRequired(m_rootLayer.get());
 }
 
 bool CompositingCoordinator::flushPendingLayerChanges()
@@ -255,7 +255,8 @@
 
 void CompositingCoordinator::notifyFlushRequired(const GraphicsLayer*)
 {
-    m_client->notifyFlushRequired();
+    if (!isFlushingLayerChanges())
+        m_client->notifyFlushRequired();
 }
 
 
@@ -271,7 +272,7 @@
     m_registeredLayers.add(layer->id(), layer);
     m_state.layersToCreate.append(layer->id());
     layer->setNeedsVisibleRectAdjustment();
-    m_client->notifyFlushRequired();
+    notifyFlushRequired(layer);
     return std::unique_ptr<GraphicsLayer>(layer);
 }
 
@@ -352,7 +353,7 @@
     }
 
     m_state.layersToRemove.append(layer->id());
-    m_client->notifyFlushRequired();
+    notifyFlushRequired(layer);
 }
 
 void CompositingCoordinator::commitScrollOffset(uint32_t layerID, const WebCore::IntSize& offset)

Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp (157183 => 157184)


--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp	2013-10-09 21:00:02 UTC (rev 157183)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp	2013-10-09 21:01:10 UTC (rev 157184)
@@ -48,41 +48,46 @@
     return layer ? toCoordinatedGraphicsLayer(layer)->id() : 0;
 }
 
+bool CoordinatedGraphicsLayer::notifyFlushRequired()
+{
+    ASSERT(m_coordinator);
+    if (client() && !m_coordinator->isFlushingLayerChanges()) {
+        client()->notifyFlushRequired(this);
+        return true;
+    }
+    return false;
+}
+
 void CoordinatedGraphicsLayer::didChangeLayerState()
 {
     m_shouldSyncLayerState = true;
-    if (client())
-        client()->notifyFlushRequired(this);
+    notifyFlushRequired();
 }
 
 void CoordinatedGraphicsLayer::didChangeAnimations()
 {
     m_shouldSyncAnimations = true;
-    if (client())
-        client()->notifyFlushRequired(this);
+    notifyFlushRequired();
 }
 
 void CoordinatedGraphicsLayer::didChangeChildren()
 {
     m_shouldSyncChildren = true;
-    if (client())
-        client()->notifyFlushRequired(this);
+    notifyFlushRequired();
 }
 
 #if ENABLE(CSS_FILTERS)
 void CoordinatedGraphicsLayer::didChangeFilters()
 {
     m_shouldSyncFilters = true;
-    if (client())
-        client()->notifyFlushRequired(this);
+    notifyFlushRequired();
 }
 #endif
 
 void CoordinatedGraphicsLayer::didChangeImageBacking()
 {
     m_shouldSyncImageBacking = true;
-    if (client())
-        client()->notifyFlushRequired(this);
+    notifyFlushRequired();
 }
 
 void CoordinatedGraphicsLayer::setShouldUpdateVisibleRect()
@@ -382,9 +387,7 @@
         m_pendingCanvasOperation |= SyncCanvas;
 #endif
 
-    if (client())
-        client()->notifyFlushRequired(this);
-
+    notifyFlushRequired();
     addRepaintRect(contentsRect());
 }
 
@@ -411,8 +414,7 @@
     m_canvasToken = m_canvasPlatformLayer ? m_canvasPlatformLayer->graphicsSurfaceToken() : GraphicsSurfaceToken();
     ASSERT(!(!m_canvasToken.isValid() && m_canvasPlatformLayer));
 
-    if (client())
-        client()->notifyFlushRequired(this);
+    notifyFlushRequired();
 #else
     UNUSED_PARAM(platformLayer);
 #endif
@@ -588,11 +590,8 @@
 
 void CoordinatedGraphicsLayer::flushCompositingState(const FloatRect& rect)
 {
-    if (!m_coordinator->isFlushingLayerChanges()) {
-        if (client())
-            client()->notifyFlushRequired(this);
+    if (notifyFlushRequired())
         return;
-    }
 
     if (CoordinatedGraphicsLayer* mask = toCoordinatedGraphicsLayer(maskLayer()))
         mask->flushCompositingStateForThisLayerOnly();
@@ -918,8 +917,7 @@
 void CoordinatedGraphicsLayer::tiledBackingStoreHasPendingTileCreation()
 {
     setNeedsVisibleRectAdjustment();
-    if (client())
-        client()->notifyFlushRequired(this);
+    notifyFlushRequired();
 }
 
 IntRect CoordinatedGraphicsLayer::tiledBackingStoreContentsRect()

Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h (157183 => 157184)


--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h	2013-10-09 21:00:02 UTC (rev 157183)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h	2013-10-09 21:01:10 UTC (rev 157184)
@@ -196,6 +196,8 @@
     void createBackingStore();
     void releaseImageBackingIfNeeded();
 
+    bool notifyFlushRequired();
+
     // CoordinatedImageBacking::Host
     virtual bool imageBackingVisible() OVERRIDE;
     bool shouldHaveBackingStore() const;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to