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

Unified Diff: cc/single_thread_proxy.cc

Issue 11232051: Remove static thread pointers from CC (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase to 165064 Created 8 years, 2 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
Index: cc/single_thread_proxy.cc
diff --git a/cc/single_thread_proxy.cc b/cc/single_thread_proxy.cc
index 6c63c3d9d4e5a4153d412ceb808eb216ce5292d0..2cb1241e005fc1451657755b0183d814bfef17a5 100644
--- a/cc/single_thread_proxy.cc
+++ b/cc/single_thread_proxy.cc
@@ -20,7 +20,8 @@ scoped_ptr<Proxy> SingleThreadProxy::create(LayerTreeHost* layerTreeHost)
}
SingleThreadProxy::SingleThreadProxy(LayerTreeHost* layerTreeHost)
- : m_layerTreeHost(layerTreeHost)
+ : Proxy(0)
+ , m_layerTreeHost(layerTreeHost)
, m_contextLost(false)
, m_rendererInitialized(false)
, m_nextFrameIsNewlyCommittedFrame(false)
@@ -32,7 +33,7 @@ SingleThreadProxy::SingleThreadProxy(LayerTreeHost* layerTreeHost)
void SingleThreadProxy::start()
{
- DebugScopedSetImplThread impl;
+ DebugScopedSetImplThread impl(this);
m_layerTreeHostImpl = m_layerTreeHost->createLayerTreeHostImpl(this);
}
@@ -71,7 +72,7 @@ void SingleThreadProxy::finishAllRendering()
{
DCHECK(Proxy::isMainThread());
{
- DebugScopedSetImplThread impl;
+ DebugScopedSetImplThread impl(this);
m_layerTreeHostImpl->finishAllRendering();
}
}
@@ -99,7 +100,7 @@ void SingleThreadProxy::setSurfaceReady()
void SingleThreadProxy::setVisible(bool visible)
{
- DebugScopedSetImplThread impl;
+ DebugScopedSetImplThread impl(this);
m_layerTreeHostImpl->setVisible(visible);
}
@@ -108,7 +109,7 @@ bool SingleThreadProxy::initializeRenderer()
DCHECK(Proxy::isMainThread());
DCHECK(m_contextBeforeInitialization.get());
{
- DebugScopedSetImplThread impl;
+ DebugScopedSetImplThread impl(this);
bool ok = m_layerTreeHostImpl->initializeRenderer(m_contextBeforeInitialization.Pass());
if (ok) {
m_rendererInitialized = true;
@@ -131,8 +132,8 @@ bool SingleThreadProxy::recreateContext()
bool initialized;
{
- DebugScopedSetMainThreadBlocked mainThreadBlocked;
- DebugScopedSetImplThread impl;
+ DebugScopedSetMainThreadBlocked mainThreadBlocked(this);
+ DebugScopedSetImplThread impl(this);
if (!m_layerTreeHostImpl->contentsTexturesPurged())
m_layerTreeHost->deleteContentsTexturesOnImplThread(m_layerTreeHostImpl->resourceProvider());
initialized = m_layerTreeHostImpl->initializeRenderer(context.Pass());
@@ -179,8 +180,8 @@ void SingleThreadProxy::doCommit(scoped_ptr<ResourceUpdateQueue> queue)
DCHECK(Proxy::isMainThread());
// Commit immediately
{
- DebugScopedSetMainThreadBlocked mainThreadBlocked;
- DebugScopedSetImplThread impl;
+ DebugScopedSetMainThreadBlocked mainThreadBlocked(this);
+ DebugScopedSetImplThread impl(this);
base::TimeTicks startTime = base::TimeTicks::HighResNow();
m_layerTreeHostImpl->beginCommit();
@@ -193,7 +194,8 @@ void SingleThreadProxy::doCommit(scoped_ptr<ResourceUpdateQueue> queue)
NULL,
Proxy::mainThread(),
queue.Pass(),
- m_layerTreeHostImpl->resourceProvider());
+ m_layerTreeHostImpl->resourceProvider(),
+ hasImplThread());
updateController->finalize();
m_layerTreeHost->finishCommitOnImplThread(m_layerTreeHostImpl.get());
@@ -254,8 +256,8 @@ void SingleThreadProxy::stop()
TRACE_EVENT0("cc", "SingleThreadProxy::stop");
DCHECK(Proxy::isMainThread());
{
- DebugScopedSetMainThreadBlocked mainThreadBlocked;
- DebugScopedSetImplThread impl;
+ DebugScopedSetMainThreadBlocked mainThreadBlocked(this);
+ DebugScopedSetImplThread impl(this);
if (!m_layerTreeHostImpl->contentsTexturesPurged())
m_layerTreeHost->deleteContentsTexturesOnImplThread(m_layerTreeHostImpl->resourceProvider());
@@ -277,7 +279,7 @@ void SingleThreadProxy::setNeedsCommitOnImplThread()
void SingleThreadProxy::postAnimationEventsToMainThreadOnImplThread(scoped_ptr<AnimationEventsVector> events, base::Time wallClockTime)
{
DCHECK(Proxy::isImplThread());
- DebugScopedSetMainThread main;
+ DebugScopedSetMainThread main(this);
m_layerTreeHost->setAnimationEvents(events.Pass(), wallClockTime);
}
@@ -318,7 +320,7 @@ void SingleThreadProxy::compositeImmediately()
void SingleThreadProxy::forceSerializeOnSwapBuffers()
{
{
- DebugScopedSetImplThread impl;
+ DebugScopedSetImplThread impl(this);
if (m_rendererInitialized)
m_layerTreeHostImpl->renderer()->doNoOp();
}
@@ -339,7 +341,7 @@ bool SingleThreadProxy::commitAndComposite()
// Unlink any texture backings that were deleted
PrioritizedTextureManager::BackingList evictedContentsTexturesBackings;
{
- DebugScopedSetImplThread implThread;
+ DebugScopedSetImplThread impl(this);
m_layerTreeHost->contentsTextureManager()->getEvictedBackings(evictedContentsTexturesBackings);
}
m_layerTreeHost->contentsTextureManager()->unlinkEvictedBackings(evictedContentsTexturesBackings);
@@ -361,7 +363,7 @@ bool SingleThreadProxy::doComposite()
{
DCHECK(!m_contextLost);
{
- DebugScopedSetImplThread impl;
+ DebugScopedSetImplThread impl(this);
if (!m_layerTreeHostImpl->visible())
return false;

Powered by Google App Engine
This is Rietveld 408576698