Title: [121000] branches/chromium/1132/Source/WebCore
Revision
121000
Author
[email protected]
Date
2012-06-21 20:51:01 -0700 (Thu, 21 Jun 2012)

Log Message

[chromium] LayerRendererChromium is not getting visibility messages in single threaded compositing mode.

This is an emergency fix for the 1132 chromium branch. A more correct fix is in bug 89045.

https://bugs.webkit.org/show_bug.cgi?id=89731

Reviewed by James Robinson.


* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::compositeAndReadback):
(WebCore::CCLayerTreeHost::setVisible):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::commitComplete):
* platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
(WebCore::CCSingleThreadProxy::setNeedsForcedCommit):

Modified Paths

Diff

Modified: branches/chromium/1132/Source/WebCore/ChangeLog (120999 => 121000)


--- branches/chromium/1132/Source/WebCore/ChangeLog	2012-06-22 02:55:29 UTC (rev 120999)
+++ branches/chromium/1132/Source/WebCore/ChangeLog	2012-06-22 03:51:01 UTC (rev 121000)
@@ -1,3 +1,22 @@
+2012-06-21  Vangelis Kokkevis  <[email protected]>
+
+        [chromium] LayerRendererChromium is not getting visibility messages in single threaded compositing mode.
+
+        This is an emergency fix for the 1132 chromium branch. A more correct fix is in bug 89045.
+
+        https://bugs.webkit.org/show_bug.cgi?id=89731
+
+        Reviewed by James Robinson.
+
+
+        * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
+        (WebCore::CCLayerTreeHost::compositeAndReadback):
+        (WebCore::CCLayerTreeHost::setVisible):
+        * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
+        (WebCore::CCLayerTreeHostImpl::commitComplete):
+        * platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
+        (WebCore::CCSingleThreadProxy::setNeedsForcedCommit):
+
 2012-06-18  Nico Weber  <[email protected]>
 
         [chromium/mac] Unbreak smooth scrolling.

Modified: branches/chromium/1132/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp (120999 => 121000)


--- branches/chromium/1132/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp	2012-06-22 02:55:29 UTC (rev 120999)
+++ branches/chromium/1132/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp	2012-06-22 03:51:01 UTC (rev 121000)
@@ -296,7 +296,28 @@
             return false;
     }
     m_triggerIdlePaints = false;
+
+    // If the texture manager's limit is set to zero (e.g. invisible tab)
+    // we won't be able to paint. We temporarily set it to a non-zero value
+    // and bring it back down to zero after we composite and read-back.
+    bool needsAllocationReset = false;
+    bool savedMemoryAllocationsIsForDisplay = false;
+    if (!m_memoryAllocationBytes) {
+        needsAllocationReset = true;
+        savedMemoryAllocationsIsForDisplay = m_memoryAllocationIsForDisplay;
+
+        m_memoryAllocationBytes = TextureManager::highLimitBytes(viewportSize());
+        m_memoryAllocationIsForDisplay = m_visible;
+     }
+
     bool ret = m_proxy->compositeAndReadback(pixels, rect);
+
+    // Set texture manager's limit back to zero.
+    if (needsAllocationReset) {
+        setContentsMemoryAllocationLimitBytes(0);
+        m_memoryAllocationIsForDisplay = savedMemoryAllocationsIsForDisplay;
+    }
+
     m_triggerIdlePaints = true;
     return ret;
 }
@@ -399,9 +420,9 @@
             setContentsMemoryAllocationLimitBytes(0);
         else
             setContentsMemoryAllocationLimitBytes(m_contentsTextureManager->preferredMemoryLimitBytes());
+    } else {
+        setNeedsForcedCommit();
     }
-
-    setNeedsForcedCommit();
 }
 
 void CCLayerTreeHost::setContentsMemoryAllocationLimitBytes(size_t bytes)

Modified: branches/chromium/1132/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp (120999 => 121000)


--- branches/chromium/1132/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp	2012-06-22 02:55:29 UTC (rev 120999)
+++ branches/chromium/1132/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp	2012-06-22 03:51:01 UTC (rev 121000)
@@ -146,6 +146,11 @@
     // Recompute max scroll position; must be after layer content bounds are
     // updated.
     updateMaxScrollPosition();
+
+    // Ensure all GL calls (including texture deletions) will actually be
+    // submitted for execution in the case we didn't call swap buffers.
+    if ((!m_visible || !canDraw()) && context())
+        context()->flush();
 }
 
 bool CCLayerTreeHostImpl::canDraw()

Modified: branches/chromium/1132/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp (120999 => 121000)


--- branches/chromium/1132/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp	2012-06-22 02:55:29 UTC (rev 120999)
+++ branches/chromium/1132/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp	2012-06-22 03:51:01 UTC (rev 121000)
@@ -252,8 +252,9 @@
 
 void CCSingleThreadProxy::setNeedsForcedCommit()
 {
-    // This proxy doesn't block commits when not visible so use a normal commit.
-    setNeedsCommit();
+    // Do the commit right here. Simply scheduling a commit won't
+    // work if we're not visible.
+    commitAndComposite();
 }
 
 void CCSingleThreadProxy::setNeedsRedraw()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to