Title: [106986] trunk/Source/WebCore
- Revision
- 106986
- Author
- [email protected]
- Date
- 2012-02-07 13:50:57 -0800 (Tue, 07 Feb 2012)
Log Message
[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):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (106985 => 106986)
--- trunk/Source/WebCore/ChangeLog 2012-02-07 21:48:24 UTC (rev 106985)
+++ trunk/Source/WebCore/ChangeLog 2012-02-07 21:50:57 UTC (rev 106986)
@@ -1,3 +1,26 @@
+2012-02-07 James Robinson <[email protected]>
+
+ [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 <[email protected]>
<rdar://problem/9567286> and https://bugs.webkit.org/show_bug.cgi?id=78003
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp (106985 => 106986)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp 2012-02-07 21:48:24 UTC (rev 106985)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp 2012-02-07 21:50:57 UTC (rev 106986)
@@ -371,22 +371,23 @@
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)
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h (106985 => 106986)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h 2012-02-07 21:48:24 UTC (rev 106985)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h 2012-02-07 21:50:57 UTC (rev 106986)
@@ -184,7 +184,8 @@
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&);
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp (106985 => 106986)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp 2012-02-07 21:48:24 UTC (rev 106985)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp 2012-02-07 21:50:57 UTC (rev 106986)
@@ -78,7 +78,8 @@
return false;
}
- commitIfNeeded();
+ if (!commitIfNeeded())
+ return false;
if (!doComposite())
return false;
@@ -228,7 +229,8 @@
if (!recreateContextIfNeeded())
return;
- commitIfNeeded();
+ if (!commitIfNeeded())
+ return;
if (doComposite())
m_layerTreeHostImpl->swapBuffers();
@@ -282,13 +284,15 @@
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()
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h (106985 => 106986)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h 2012-02-07 21:48:24 UTC (rev 106985)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h 2012-02-07 21:50:57 UTC (rev 106986)
@@ -68,7 +68,7 @@
private:
explicit CCSingleThreadProxy(CCLayerTreeHost*);
bool recreateContextIfNeeded();
- void commitIfNeeded();
+ bool commitIfNeeded();
void doCommit();
bool doComposite();
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp (106985 => 106986)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp 2012-02-07 21:48:24 UTC (rev 106985)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp 2012-02-07 21:50:57 UTC (rev 106986)
@@ -397,7 +397,8 @@
// 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
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes