Title: [114761] trunk/Source
Revision
114761
Author
commit-qu...@webkit.org
Date
2012-04-20 10:53:10 -0700 (Fri, 20 Apr 2012)

Log Message

[chromium] Don't crash when scrolling empty layer tree
https://bugs.webkit.org/show_bug.cgi?id=84455

Patch by Sami Kyostila <skyos...@chromium.org> on 2012-04-20
Reviewed by James Robinson.

Source/WebCore:

Do not try to calculate render passes when there are no layers in the
layer tree.

Added new unit test.

* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::calculateRenderPasses):

Source/WebKit/chromium:

Try to scroll an empty layer tree.

* tests/CCLayerTreeHostImplTest.cpp:
(WebKitTests::TEST_F):
(WebKitTests):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (114760 => 114761)


--- trunk/Source/WebCore/ChangeLog	2012-04-20 17:46:09 UTC (rev 114760)
+++ trunk/Source/WebCore/ChangeLog	2012-04-20 17:53:10 UTC (rev 114761)
@@ -1,3 +1,18 @@
+2012-04-20  Sami Kyostila  <skyos...@chromium.org>
+
+        [chromium] Don't crash when scrolling empty layer tree
+        https://bugs.webkit.org/show_bug.cgi?id=84455
+
+        Reviewed by James Robinson.
+
+        Do not try to calculate render passes when there are no layers in the
+        layer tree.
+
+        Added new unit test.
+
+        * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
+        (WebCore::CCLayerTreeHostImpl::calculateRenderPasses):
+
 2012-04-20  Victor Carbune  <vcarb...@adobe.com>
 
         Ensure text is centered for default captions

Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp (114760 => 114761)


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp	2012-04-20 17:46:09 UTC (rev 114760)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp	2012-04-20 17:53:10 UTC (rev 114761)
@@ -239,6 +239,7 @@
 {
     ASSERT(passes.isEmpty());
     ASSERT(renderSurfaceLayerList.isEmpty());
+    ASSERT(m_rootLayerImpl);
 
     renderSurfaceLayerList.append(m_rootLayerImpl.get());
 
@@ -664,6 +665,9 @@
     if (m_mostRecentRenderSurfaceLayerList.size())
         return true;
 
+    if (!m_rootLayerImpl)
+        return false;
+
     // If we are called after setRootLayer() but before prepareToDraw(), we need to recalculate
     // the visible layers. The return value is ignored because we don't care about checkerboarding.
     CCRenderPassList passes;

Modified: trunk/Source/WebKit/chromium/ChangeLog (114760 => 114761)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-04-20 17:46:09 UTC (rev 114760)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-04-20 17:53:10 UTC (rev 114761)
@@ -1,3 +1,16 @@
+2012-04-20  Sami Kyostila  <skyos...@chromium.org>
+
+        [chromium] Don't crash when scrolling empty layer tree
+        https://bugs.webkit.org/show_bug.cgi?id=84455
+
+        Reviewed by James Robinson.
+
+        Try to scroll an empty layer tree.
+
+        * tests/CCLayerTreeHostImplTest.cpp:
+        (WebKitTests::TEST_F):
+        (WebKitTests):
+
 2012-04-20  Sheriff Bot  <webkit.review....@gmail.com>
 
         Unreviewed.  Rolled DEPS.

Modified: trunk/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp (114760 => 114761)


--- trunk/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp	2012-04-20 17:46:09 UTC (rev 114760)
+++ trunk/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp	2012-04-20 17:53:10 UTC (rev 114761)
@@ -214,6 +214,12 @@
     EXPECT_TRUE(m_didRequestCommit);
 }
 
+TEST_F(CCLayerTreeHostImplTest, scrollWithoutRootLayer)
+{
+    // We should not crash when trying to scroll an empty layer tree.
+    EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(0, 0), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollIgnored);
+}
+
 TEST_F(CCLayerTreeHostImplTest, wheelEventHandlers)
 {
     {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to