https://bugs.webkit.org/show_bug.cgi?id=78013
Reviewed by Kenneth Russell.
If compositor initialization fails it's not safe to proceed through the rest of the frame process. This adds
some early outs.
Tested manually by forcing the first makeContextCurrent() call fail.
* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::updateLayers):
* platform/graphics/chromium/cc/CCLayerTreeHost.h:
(CCLayerTreeHost):
* platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
(WebCore::CCSingleThreadProxy::compositeAndReadback):
(WebCore::CCSingleThreadProxy::compositeImmediately):
(WebCore::CCSingleThreadProxy::commitIfNeeded):
* platform/graphics/chromium/cc/CCSingleThreadProxy.h:
(CCSingleThreadProxy):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106986
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-02-07 James Robinson <jamesr@chromium.org>
+
+ [chromium] Gracefully handle compositor initialization failure in single-threaded proxy
+ https://bugs.webkit.org/show_bug.cgi?id=78013
+
+ Reviewed by Kenneth Russell.
+
+ If compositor initialization fails it's not safe to proceed through the rest of the frame process. This adds
+ some early outs.
+
+ Tested manually by forcing the first makeContextCurrent() call fail.
+
+ * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
+ (WebCore::CCLayerTreeHost::updateLayers):
+ * platform/graphics/chromium/cc/CCLayerTreeHost.h:
+ (CCLayerTreeHost):
+ * platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
+ (WebCore::CCSingleThreadProxy::compositeAndReadback):
+ (WebCore::CCSingleThreadProxy::compositeImmediately):
+ (WebCore::CCSingleThreadProxy::commitIfNeeded):
+ * platform/graphics/chromium/cc/CCSingleThreadProxy.h:
+ (CCSingleThreadProxy):
+
2012-02-07 Brady Eidson <beidson@apple.com>
<rdar://problem/9567286> and https://bugs.webkit.org/show_bug.cgi?id=78003
static_cast<CCSingleThreadProxy*>(m_proxy.get())->compositeImmediately();
}
-void CCLayerTreeHost::updateLayers()
+bool CCLayerTreeHost::updateLayers()
{
if (!m_layerRendererInitialized) {
initializeLayerRenderer();
// If we couldn't initialize, then bail since we're returning to software mode.
if (!m_layerRendererInitialized)
- return;
+ return false;
}
if (!rootLayer())
- return;
+ return true;
if (viewportSize().isEmpty())
- return;
+ return true;
updateLayers(rootLayer());
+ return true;
}
void CCLayerTreeHost::updateLayers(LayerChromium* rootLayer)
void setHaveWheelEventHandlers(bool);
- void updateLayers();
+ // Returns false if we should abort this frame due to initialization failure.
+ bool updateLayers();
void updateCompositorResources(GraphicsContext3D*, CCTextureUpdater&);
void applyScrollAndScale(const CCScrollAndScaleSet&);
return false;
}
- commitIfNeeded();
+ if (!commitIfNeeded())
+ return false;
if (!doComposite())
return false;
if (!recreateContextIfNeeded())
return;
- commitIfNeeded();
+ if (!commitIfNeeded())
+ return;
if (doComposite())
m_layerTreeHostImpl->swapBuffers();
return false;
}
-void CCSingleThreadProxy::commitIfNeeded()
+bool CCSingleThreadProxy::commitIfNeeded()
{
ASSERT(CCProxy::isMainThread());
- m_layerTreeHost->updateLayers();
+ if (!m_layerTreeHost->updateLayers())
+ return false;
doCommit();
+ return true;
}
bool CCSingleThreadProxy::doComposite()
private:
explicit CCSingleThreadProxy(CCLayerTreeHost*);
bool recreateContextIfNeeded();
- void commitIfNeeded();
+ bool commitIfNeeded();
void doCommit();
bool doComposite();
// updateLayers.
m_commitRequested = false;
- m_layerTreeHost->updateLayers();
+ if (!m_layerTreeHost->updateLayers())
+ return;
// Before applying scrolls and calling animate, we set m_animateRequested to false.
// If it is true now, it means setNeedAnimate was called again. Call setNeedsCommit