summaryrefslogtreecommitdiffstats
path: root/cc/CCThreadProxy.cpp
diff options
context:
space:
mode:
authorreveman@chromium.org <reveman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-13 23:14:20 +0000
committerreveman@chromium.org <reveman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-13 23:14:20 +0000
commit3c496dcf5e0eafca0ac04526e9f71b123f91667b (patch)
tree1fb77746d9f29c1f3296a37fab616ad02e033f88 /cc/CCThreadProxy.cpp
parentf0b6e30a20fcfe6b1e70f88191e7befde010d546 (diff)
downloadchromium_src-3c496dcf5e0eafca0ac04526e9f71b123f91667b.zip
chromium_src-3c496dcf5e0eafca0ac04526e9f71b123f91667b.tar.gz
chromium_src-3c496dcf5e0eafca0ac04526e9f71b123f91667b.tar.bz2
cc: Scheduler will never process a commit until it receives a vsync tick.
Add updateResourcesComplete callback to CCScheduler and use this to indicate completion of texture updates instead of calling CCSchedulerClient::hasMoreResourceUpdates when receiving a vsync tick. WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=94721 BUG=123399,147651 TEST=Added CCTextureUpdateControllerTest.UpdateMoreTextures, CCTextureUpdateControllerTest.HasMoreUpdates and CCTextureUpdateControllerTest.UpdatesCompleteInFiniteTime to cc_unittests. Review URL: https://chromiumcodereview.appspot.com/10911262 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@156669 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/CCThreadProxy.cpp')
-rw-r--r--cc/CCThreadProxy.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/cc/CCThreadProxy.cpp b/cc/CCThreadProxy.cpp
index e5802f7b..009ac1c 100644
--- a/cc/CCThreadProxy.cpp
+++ b/cc/CCThreadProxy.cpp
@@ -14,7 +14,6 @@
#include "CCLayerTreeHost.h"
#include "CCScheduler.h"
#include "CCScopedThreadProxy.h"
-#include "CCTextureUpdateController.h"
#include "CCThreadTask.h"
#include "TraceEvent.h"
#include <public/WebSharedGraphicsContext3D.h>
@@ -594,10 +593,12 @@ void CCThreadProxy::beginFrameCompleteOnImplThread(CCCompletionEvent* completion
setNeedsCommitOnImplThread();
}
- m_currentTextureUpdateControllerOnImplThread = CCTextureUpdateController::create(CCProxy::implThread(), queue, m_layerTreeHostImpl->resourceProvider(), m_layerTreeHostImpl->renderer()->textureCopier(), m_layerTreeHostImpl->renderer()->textureUploader());
+ bool hasResourceUpdates = queue->hasMoreUpdates();
+ if (hasResourceUpdates)
+ m_currentTextureUpdateControllerOnImplThread = CCTextureUpdateController::create(this, CCProxy::implThread(), queue, m_layerTreeHostImpl->resourceProvider(), m_layerTreeHostImpl->renderer()->textureCopier(), m_layerTreeHostImpl->renderer()->textureUploader());
m_commitCompletionEventOnImplThread = completion;
- m_schedulerOnImplThread->beginFrameComplete();
+ m_schedulerOnImplThread->beginFrameComplete(hasResourceUpdates);
}
void CCThreadProxy::beginFrameAbortedOnImplThread()
@@ -610,13 +611,6 @@ void CCThreadProxy::beginFrameAbortedOnImplThread()
m_schedulerOnImplThread->beginFrameAborted();
}
-bool CCThreadProxy::hasMoreResourceUpdates() const
-{
- if (!m_currentTextureUpdateControllerOnImplThread)
- return false;
- return m_currentTextureUpdateControllerOnImplThread->hasMoreUpdates();
-}
-
void CCThreadProxy::scheduledActionUpdateMoreResources(double monotonicTimeLimit)
{
TRACE_EVENT0("cc", "CCThreadProxy::scheduledActionUpdateMoreResources");
@@ -628,7 +622,6 @@ void CCThreadProxy::scheduledActionCommit()
{
TRACE_EVENT0("cc", "CCThreadProxy::scheduledActionCommit");
ASSERT(isImplThread());
- ASSERT(!hasMoreResourceUpdates());
ASSERT(m_commitCompletionEventOnImplThread);
m_currentTextureUpdateControllerOnImplThread.clear();
@@ -768,6 +761,12 @@ CCScheduledActionDrawAndSwapResult CCThreadProxy::scheduledActionDrawAndSwapForc
return scheduledActionDrawAndSwapInternal(true);
}
+void CCThreadProxy::updateTexturesCompleted()
+{
+ ASSERT(isImplThread());
+ m_schedulerOnImplThread->updateResourcesComplete();
+}
+
void CCThreadProxy::didCommitAndDrawFrame()
{
ASSERT(isMainThread());