Title: [125799] trunk/Source
Revision
125799
Author
[email protected]
Date
2012-08-16 12:35:25 -0700 (Thu, 16 Aug 2012)

Log Message

[chromium] Impl scrolling crashes when the renderer's initialization failed
https://bugs.webkit.org/show_bug.cgi?id=94232

Reviewed by James Robinson.

Source/WebCore:

CCLayerTreeHostImpl::calculateRenderSurfaceLayerList should not be
called when there is no renderer present or it will crash.

Chromium bug: crbug.com/125482

Tests: CCLayerTreeHostImplTest.scrollWithoutRenderer

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

Source/WebKit/chromium:

Also updated the finishAllRenderingAfterContextLost to properly fail
renderer initialization.

* tests/CCLayerTreeHostImplTest.cpp:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (125798 => 125799)


--- trunk/Source/WebCore/ChangeLog	2012-08-16 19:31:17 UTC (rev 125798)
+++ trunk/Source/WebCore/ChangeLog	2012-08-16 19:35:25 UTC (rev 125799)
@@ -1,3 +1,21 @@
+2012-08-16  Dana Jansens  <[email protected]>
+
+        [chromium] Impl scrolling crashes when the renderer's initialization failed
+        https://bugs.webkit.org/show_bug.cgi?id=94232
+
+        Reviewed by James Robinson.
+
+        CCLayerTreeHostImpl::calculateRenderSurfaceLayerList should not be
+        called when there is no renderer present or it will crash.
+
+        Chromium bug: crbug.com/125482
+
+        Tests: CCLayerTreeHostImplTest.scrollWithoutRenderer
+
+        * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
+        (WebCore::CCLayerTreeHostImpl::calculateRenderSurfaceLayerList):
+        (WebCore::CCLayerTreeHostImpl::ensureRenderSurfaceLayerList):
+
 2012-08-15  Levi Weintraub  <[email protected]>
 
         Accumulate sub-pixel offsets through layers and transforms

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


--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp	2012-08-16 19:31:17 UTC (rev 125798)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp	2012-08-16 19:35:25 UTC (rev 125799)
@@ -251,6 +251,7 @@
 {
     ASSERT(renderSurfaceLayerList.isEmpty());
     ASSERT(m_rootLayerImpl);
+    ASSERT(m_layerRenderer); // For maxTextureSize.
 
     {
         TRACE_EVENT0("cc", "CCLayerTreeHostImpl::calcDrawEtc");
@@ -830,6 +831,8 @@
 {
     if (!m_rootLayerImpl)
         return false;
+    if (!m_layerRenderer)
+        return false;
 
     // We need both a non-empty render surface layer list and a root render
     // surface to be able to iterate over the visible layers.

Modified: trunk/Source/WebKit/chromium/ChangeLog (125798 => 125799)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-08-16 19:31:17 UTC (rev 125798)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-08-16 19:35:25 UTC (rev 125799)
@@ -1,3 +1,15 @@
+2012-08-16  Dana Jansens  <[email protected]>
+
+        [chromium] Impl scrolling crashes when the renderer's initialization failed
+        https://bugs.webkit.org/show_bug.cgi?id=94232
+
+        Reviewed by James Robinson.
+
+        Also updated the finishAllRenderingAfterContextLost to properly fail
+        renderer initialization.
+
+        * tests/CCLayerTreeHostImplTest.cpp:
+
 2012-08-16  Peter Beverloo  <[email protected]>
 
         [Chromium] Pass the --strip-binary argument to the apk test generator

Modified: trunk/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp (125798 => 125799)


--- trunk/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp	2012-08-16 19:31:17 UTC (rev 125798)
+++ trunk/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp	2012-08-16 19:35:25 UTC (rev 125799)
@@ -190,6 +190,11 @@
     CCScopedSettings m_scopedSettings;
 };
 
+class FakeWebGraphicsContext3DMakeCurrentFails : public FakeWebGraphicsContext3D {
+public:
+    virtual bool makeContextCurrent() { return false; }
+};
+
 TEST_F(CCLayerTreeHostImplTest, scrollDeltaNoLayers)
 {
     ASSERT_FALSE(m_hostImpl->rootLayer());
@@ -276,6 +281,21 @@
     EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(0, 0), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollIgnored);
 }
 
+TEST_F(CCLayerTreeHostImplTest, scrollWithoutRenderer)
+{
+    CCLayerTreeSettings settings;
+    m_hostImpl = CCLayerTreeHostImpl::create(settings, this);
+
+    // Initialization will fail here.
+    m_hostImpl->initializeLayerRenderer(FakeWebCompositorOutputSurface::create(adoptPtr(new FakeWebGraphicsContext3DMakeCurrentFails)), UnthrottledUploader);
+    m_hostImpl->setViewportSize(IntSize(10, 10), IntSize(10, 10));
+
+    setupScrollAndContentsLayers(IntSize(100, 100));
+
+    // We should not crash when trying to scroll after the renderer initialization fails.
+    EXPECT_EQ(m_hostImpl->scrollBegin(IntPoint(0, 0), CCInputHandlerClient::Wheel), CCInputHandlerClient::ScrollIgnored);
+}
+
 TEST_F(CCLayerTreeHostImplTest, replaceTreeWhileScrolling)
 {
     const int scrollLayerId = 1;
@@ -2062,13 +2082,11 @@
     EXPECT_TRUE(layer2->didLoseContextCalled());
 }
 
-class FakeWebGraphicsContext3DMakeCurrentFails : public FakeWebGraphicsContext3D {
-public:
-    virtual bool makeContextCurrent() { return false; }
-};
-
 TEST_F(CCLayerTreeHostImplTest, finishAllRenderingAfterContextLost)
 {
+    CCLayerTreeSettings settings;
+    m_hostImpl = CCLayerTreeHostImpl::create(settings, this);
+
     // The context initialization will fail, but we should still be able to call finishAllRendering() without any ill effects.
     m_hostImpl->initializeLayerRenderer(FakeWebCompositorOutputSurface::create(adoptPtr(new FakeWebGraphicsContext3DMakeCurrentFails)), UnthrottledUploader);
     m_hostImpl->finishAllRendering();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to