[chromium] RootLayer was not being checked for null causing segfaults very rarely.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 24 Mar 2012 02:15:59 +0000 (02:15 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 24 Mar 2012 02:15:59 +0000 (02:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=82111

Patch by Michal Mocny <mmocny@google.com> on 2012-03-23
Reviewed by Adrienne Walker.

* platform/graphics/chromium/LayerRendererChromium.cpp:
(WebCore::LayerRendererChromium::beginDrawingFrame):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::drawLayers):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@111968 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp

index 4eb2c78..5bf0213 100644 (file)
@@ -1,3 +1,15 @@
+2012-03-23  Michal Mocny  <mmocny@google.com>
+
+        [chromium] RootLayer was not being checked for null causing segfaults very rarely.
+        https://bugs.webkit.org/show_bug.cgi?id=82111
+
+        Reviewed by Adrienne Walker.
+
+        * platform/graphics/chromium/LayerRendererChromium.cpp:
+        (WebCore::LayerRendererChromium::beginDrawingFrame):
+        * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
+        (WebCore::CCLayerTreeHostImpl::drawLayers):
+
 2012-03-23  Shawn Singh  <shawnsingh@chromium.org>
 
         [chromium] Fix race bug that clobbers CCLayerImpl updateRect
index 88b66d6..c5f5e6a 100644 (file)
@@ -404,6 +404,7 @@ void LayerRendererChromium::clearRenderSurface(CCRenderSurface* renderSurface, C
 
 void LayerRendererChromium::beginDrawingFrame()
 {
+    ASSERT(rootLayer());
     m_defaultRenderSurface = rootLayer()->renderSurface();
 
     // FIXME: use the frame begin time from the overall compositor scheduler.
index 5949395..6c50225 100644 (file)
@@ -379,6 +379,9 @@ void CCLayerTreeHostImpl::drawLayers(const FrameData& frame)
     TRACE_EVENT("CCLayerTreeHostImpl::drawLayers", this, 0);
     ASSERT(m_layerRenderer);
 
+    if (!rootLayer())
+        return;
+
     m_layerRenderer->beginDrawingFrame();
     for (size_t i = 0; i < frame.renderPasses.size(); ++i)
         m_layerRenderer->drawRenderPass(frame.renderPasses[i].get());