Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1927)

Unified Diff: cc/single_thread_proxy.cc

Issue 11606012: cc: Unify context losing machinery (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reboot Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/single_thread_proxy.h ('k') | cc/thread_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/single_thread_proxy.cc
diff --git a/cc/single_thread_proxy.cc b/cc/single_thread_proxy.cc
index fe17ec033603e0542130f44314a887abb1ef5272..275acfab57f236c8a9cab4b7eb5786cc18aa97d7 100644
--- a/cc/single_thread_proxy.cc
+++ b/cc/single_thread_proxy.cc
@@ -59,12 +59,15 @@ bool SingleThreadProxy::compositeAndReadback(void *pixels, const gfx::Rect& rect
if (!commitAndComposite())
return false;
- m_layerTreeHostImpl->readback(pixels, rect);
+ {
+ DebugScopedSetImplThread impl(this);
+ m_layerTreeHostImpl->readback(pixels, rect);
- if (m_layerTreeHostImpl->isContextLost())
- return false;
+ if (m_layerTreeHostImpl->isContextLost())
+ return false;
- m_layerTreeHostImpl->swapBuffers();
+ m_layerTreeHostImpl->swapBuffers();
+ }
didSwapFrame();
return true;
@@ -329,6 +332,12 @@ bool SingleThreadProxy::isInsideDraw()
return m_insideDraw;
}
+void SingleThreadProxy::didLoseOutputSurfaceOnImplThread()
+{
+ // Cause a commit so we can notice the lost context.
+ setNeedsCommitOnImplThread();
+}
+
// Called by the legacy scheduling path (e.g. where render_widget does the scheduling)
void SingleThreadProxy::compositeImmediately()
{
@@ -393,10 +402,10 @@ bool SingleThreadProxy::doComposite()
m_layerTreeHostImpl->prepareToDraw(frame);
m_layerTreeHostImpl->drawLayers(frame);
m_layerTreeHostImpl->didDrawAllLayers(frame);
+ m_outputSurfaceLost = m_layerTreeHostImpl->isContextLost();
}
- if (m_layerTreeHostImpl->isContextLost()) {
- m_outputSurfaceLost = true;
+ if (m_outputSurfaceLost) {
m_layerTreeHost->didLoseOutputSurface();
return false;
}
« no previous file with comments | « cc/single_thread_proxy.h ('k') | cc/thread_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698