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

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: Created 8 years 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
Index: cc/single_thread_proxy.cc
diff --git a/cc/single_thread_proxy.cc b/cc/single_thread_proxy.cc
index 63d70d8f87dba5aae375db422e2e00e8d0c97c5c..27dcb4240ccc1a8ebe8898f3fe8dc87999afca0d 100644
--- a/cc/single_thread_proxy.cc
+++ b/cc/single_thread_proxy.cc
@@ -51,12 +51,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;
@@ -164,8 +167,9 @@ const RendererCapabilities& SingleThreadProxy::rendererCapabilities() const
void SingleThreadProxy::loseOutputSurface()
{
DCHECK(Proxy::isMainThread());
- m_layerTreeHost->didLoseOutputSurface();
- m_outputSurfaceLost = true;
+
+ DebugScopedSetImplThread impl(this);
+ m_layerTreeHostImpl->resourceProvider()->loseOutputSurface();
}
void SingleThreadProxy::setNeedsAnimate()
@@ -310,6 +314,12 @@ void SingleThreadProxy::sendManagedMemoryStats()
m_layerTreeHost->contentsTextureManager()->memoryUseBytes());
}
+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()
{
@@ -379,10 +389,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;
}

Powered by Google App Engine
This is Rietveld 408576698