Title: [166349] trunk/Source
Revision
166349
Author
[email protected]
Date
2014-03-27 00:11:40 -0700 (Thu, 27 Mar 2014)

Log Message

Unreviewed, rolling out r166296 and r166331.
https://bugs.webkit.org/show_bug.cgi?id=130822

caused some crashes and frequent assertion failures, and the
fix is going to take a little while (Requested by thorton on
#webkit).

Reverted changesets:

"[iOS WebKit2] Flush all surfaces after painting into all of
them, instead of after painting into each one"
https://bugs.webkit.org/show_bug.cgi?id=130768
http://trac.webkit.org/changeset/166296

Source/WebCore:

"Assertion failure in RemoteLayerBackingStore::flush"
https://bugs.webkit.org/show_bug.cgi?id=130810
http://trac.webkit.org/changeset/166331

Source/WebKit2:

"Assertion failure in RemoteLayerBackingStore::flush"
https://bugs.webkit.org/show_bug.cgi?id=130810
http://trac.webkit.org/changeset/166331

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (166348 => 166349)


--- trunk/Source/WebCore/ChangeLog	2014-03-27 06:50:40 UTC (rev 166348)
+++ trunk/Source/WebCore/ChangeLog	2014-03-27 07:11:40 UTC (rev 166349)
@@ -1,3 +1,23 @@
+2014-03-27  Commit Queue  <[email protected]>
+
+        Unreviewed, rolling out r166296 and r166331.
+        https://bugs.webkit.org/show_bug.cgi?id=130822
+
+        caused some crashes and frequent assertion failures, and the
+        fix is going to take a little while (Requested by thorton on
+        #webkit).
+
+        Reverted changesets:
+
+        "[iOS WebKit2] Flush all surfaces after painting into all of
+        them, instead of after painting into each one"
+        https://bugs.webkit.org/show_bug.cgi?id=130768
+        http://trac.webkit.org/changeset/166296
+
+        "Assertion failure in RemoteLayerBackingStore::flush"
+        https://bugs.webkit.org/show_bug.cgi?id=130810
+        http://trac.webkit.org/changeset/166331
+
 2014-03-26  Simon Fraser  <[email protected]>
 
         Fix failing scrolling tests by reverting to previous behavior where

Modified: trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h (166348 => 166349)


--- trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h	2014-03-27 06:50:40 UTC (rev 166348)
+++ trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h	2014-03-27 07:11:40 UTC (rev 166349)
@@ -52,7 +52,6 @@
     IOSurfaceRef surface() const { return m_surface.get(); }
     GraphicsContext& ensureGraphicsContext();
     CGContextRef ensurePlatformContext();
-    CGContextRef platformContext() { return m_cgContext.get(); }
 
     enum class SurfaceState {
         Valid,

Modified: trunk/Source/WebKit2/ChangeLog (166348 => 166349)


--- trunk/Source/WebKit2/ChangeLog	2014-03-27 06:50:40 UTC (rev 166348)
+++ trunk/Source/WebKit2/ChangeLog	2014-03-27 07:11:40 UTC (rev 166349)
@@ -1,3 +1,23 @@
+2014-03-27  Commit Queue  <[email protected]>
+
+        Unreviewed, rolling out r166296 and r166331.
+        https://bugs.webkit.org/show_bug.cgi?id=130822
+
+        caused some crashes and frequent assertion failures, and the
+        fix is going to take a little while (Requested by thorton on
+        #webkit).
+
+        Reverted changesets:
+
+        "[iOS WebKit2] Flush all surfaces after painting into all of
+        them, instead of after painting into each one"
+        https://bugs.webkit.org/show_bug.cgi?id=130768
+        http://trac.webkit.org/changeset/166296
+
+        "Assertion failure in RemoteLayerBackingStore::flush"
+        https://bugs.webkit.org/show_bug.cgi?id=130810
+        http://trac.webkit.org/changeset/166331
+
 2014-03-26  Tim Horton  <[email protected]>
 
         Blind speculative iOS build fix.

Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.h (166348 => 166349)


--- trunk/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.h	2014-03-27 06:50:40 UTC (rev 166348)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.h	2014-03-27 07:11:40 UTC (rev 166349)
@@ -75,14 +75,10 @@
 #endif
         return !!m_frontBuffer;
     }
-
-    void flush();
-
 private:
     void drawInContext(WebCore::GraphicsContext&, CGImageRef frontImage);
 
     RetainPtr<CGImageRef> createImageForFrontBuffer() const;
-    void clearBackingStore();
 
     PlatformCALayerRemote* m_layer;
 
@@ -93,10 +89,8 @@
     WebCore::Region m_dirtyRegion;
 
     RefPtr<ShareableBitmap> m_frontBuffer;
-    RetainPtr<CGContextRef> m_bufferContextPendingFlush;
 #if USE(IOSURFACE)
     RefPtr<WebCore::IOSurface> m_frontSurface;
-    RefPtr<WebCore::IOSurface> m_backSurfacePendingFlush;
 #endif
 
     bool m_acceleratesDrawing;

Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm (166348 => 166349)


--- trunk/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm	2014-03-27 06:50:40 UTC (rev 166348)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm	2014-03-27 07:11:40 UTC (rev 166349)
@@ -68,16 +68,9 @@
     m_acceleratesDrawing = acceleratesDrawing;
     m_isOpaque = isOpaque;
 
-    clearBackingStore();
-}
-
-void RemoteLayerBackingStore::clearBackingStore()
-{
 #if USE(IOSURFACE)
     m_frontSurface = nullptr;
-    m_backSurfacePendingFlush = nullptr;
 #endif
-    m_bufferContextPendingFlush = nullptr;
     m_frontBuffer = nullptr;
 }
 
@@ -159,8 +152,6 @@
 
 bool RemoteLayerBackingStore::display()
 {
-    ASSERT(!m_bufferContextPendingFlush);
-
     if (!m_layer)
         return false;
 
@@ -168,7 +159,12 @@
     // to note that our backing store has been cleared.
     if (!m_layer->owner() || !m_layer->owner()->platformCALayerDrawsContent()) {
         bool previouslyDrewContents = hasFrontBuffer();
-        clearBackingStore();
+
+        m_frontBuffer = nullptr;
+#if USE(IOSURFACE)
+        m_frontSurface = nullptr;
+#endif
+
         return previouslyDrewContents;
     }
 
@@ -188,7 +184,6 @@
     IntSize expandedScaledSize = expandedIntSize(scaledSize);
 
 #if USE(IOSURFACE)
-    ASSERT(!m_backSurfacePendingFlush);
     if (m_acceleratesDrawing) {
         RefPtr<IOSurface> backSurface = IOSurface::create(expandedScaledSize, ColorSpaceDeviceRGB);
         GraphicsContext& context = backSurface->ensureGraphicsContext();
@@ -201,11 +196,10 @@
             frontImage = m_frontSurface->createImage();
         drawInContext(context, frontImage.get());
 
-        // If our frontImage is derived from an IOSurface, we need to destroy the image before the
-        // CGContext it's derived from, so that the context doesn't make a CPU copy of the surface data.
-        // Since the flush will happen later, this means we need to hold on to the IOSurface
-        // (and thus its context) until after the flush completes.
-        m_backSurfacePendingFlush = m_frontSurface;
+        // If our frontImage is derived from an IOSurface, we need to
+        // destroy the image before the CGContext it's derived from,
+        // so that the context doesn't make a CPU copy of the surface data.
+        frontImage = nullptr;
         m_frontSurface = backSurface;
 
         return true;
@@ -217,7 +211,6 @@
     RetainPtr<CGImageRef> frontImage = createImageForFrontBuffer();
     m_frontBuffer = ShareableBitmap::createShareable(expandedScaledSize, m_isOpaque ? ShareableBitmap::NoFlags : ShareableBitmap::SupportsAlpha);
     std::unique_ptr<GraphicsContext> context = m_frontBuffer->createGraphicsContext();
-    m_bufferContextPendingFlush = context->platformContext();
     drawInContext(*context, frontImage.get());
     
     return true;
@@ -295,6 +288,8 @@
 
     m_dirtyRegion = Region();
     m_paintingRects.clear();
+
+    CGContextFlush(context.platformContext());
 }
 
 void RemoteLayerBackingStore::enumerateRectsBeingDrawn(CGContextRef context, void (^block)(CGRect))
@@ -314,37 +309,15 @@
 
 void RemoteLayerBackingStore::applyBackingStoreToLayer(CALayer *layer)
 {
-    layer.contentsOpaque = m_isOpaque;
-
 #if USE(IOSURFACE)
-    if (acceleratesDrawing()) {
+    if (acceleratesDrawing())
         layer.contents = (id)m_frontSurface->surface();
-        return;
-    }
-#endif
-
+    else
+        layer.contents = (id)createImageForFrontBuffer().get();
+#else
     ASSERT(!acceleratesDrawing());
     layer.contents = (id)createImageForFrontBuffer().get();
-}
-
-void RemoteLayerBackingStore::flush()
-{
-#if USE(IOSURFACE)
-    if (acceleratesDrawing()) {
-        if (m_frontSurface) {
-            CGContextRef platformContext = m_frontSurface->platformContext();
-            ASSERT(platformContext);
-            CGContextFlush(platformContext);
-            m_backSurfacePendingFlush = nullptr;
-        }
-        return;
-    }
 #endif
 
-    ASSERT(!acceleratesDrawing());
-
-    if (m_bufferContextPendingFlush) {
-        CGContextFlush(m_bufferContextPendingFlush.get());
-        m_bufferContextPendingFlush = nullptr;
-    }
+    layer.contentsOpaque = m_isOpaque;
 }

Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm (166348 => 166349)


--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm	2014-03-27 06:50:40 UTC (rev 166348)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm	2014-03-27 07:11:40 UTC (rev 166349)
@@ -302,17 +302,6 @@
     flushLayers();
 }
 
-static void flushBackingStoreChangesInTransaction(RemoteLayerTreeTransaction& transaction)
-{
-    for (auto& layerProperties : transaction.changedLayers().values()) {
-        if (!layerProperties->changedProperties & RemoteLayerTreeTransaction::BackingStoreChanged)
-            return;
-
-        if (RemoteLayerBackingStore* backingStore = layerProperties->backingStore.get())
-            backingStore->flush();
-    }
-}
-
 void RemoteLayerTreeDrawingArea::flushLayers()
 {
     if (!m_rootLayer)
@@ -328,6 +317,8 @@
 
     m_remoteLayerTreeContext->flushOutOfTreeLayers();
 
+    ASSERT(m_rootLayer);
+
     // FIXME: minize these transactions if nothing changed.
     RemoteLayerTreeTransaction layerTransaction;
     m_remoteLayerTreeContext->buildTransaction(layerTransaction, *m_rootLayer);
@@ -339,9 +330,6 @@
         toRemoteScrollingCoordinator(m_webPage->scrollingCoordinator())->buildTransaction(scrollingTransaction);
 #endif
 
-    // FIXME: Move flushing backing store and sending CommitLayerTree onto a background thread.
-    flushBackingStoreChangesInTransaction(layerTransaction);
-
     m_webPage->send(Messages::RemoteLayerTreeDrawingAreaProxy::CommitLayerTree(layerTransaction, scrollingTransaction));
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to