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

Unified Diff: cc/thread_proxy.cc

Issue 12217105: cc: Check for completed raster tasks at interval. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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/thread_proxy.cc
diff --git a/cc/thread_proxy.cc b/cc/thread_proxy.cc
index adb9d016d020f8acb2c046493c0daf03fb706fc4..73a943573bb0a9d5ab50204e622e2230d8a2584f 100644
--- a/cc/thread_proxy.cc
+++ b/cc/thread_proxy.cc
@@ -29,6 +29,9 @@ const double contextRecreationTickRate = 0.03;
// Measured in seconds.
const double smoothnessTakesPriorityExpirationDelay = 0.25;
+// Measured in seconds.
+const double checkForCompletedRasterTasksDelay = 0.004;
+
} // namespace
namespace cc {
@@ -62,6 +65,7 @@ ThreadProxy::ThreadProxy(LayerTreeHost* layerTreeHost, scoped_ptr<Thread> implTh
, m_totalCommitCount(0)
, m_deferCommits(false)
, m_renewTreePriorityOnImplThreadPending(false)
+ , m_checkForCompletedRasterTasksPending(false)
{
TRACE_EVENT0("cc", "ThreadProxy::ThreadProxy");
DCHECK(isMainThread());
@@ -369,6 +373,24 @@ void ThreadProxy::manageTilesOnImplThread()
m_layerTreeHostImpl->manageTiles();
}
+void ThreadProxy::setNeedsCheckForCompletedRasterTasksOnImplThread()
+{
brianderson 2013/02/12 01:44:31 DCHECK(isImplThread())?
reveman 2013/02/12 02:29:52 Sure. I'll add that to setNeedsManageTilesOnImplTh
+ if (m_checkForCompletedRasterTasksPending)
+ return;
+ Proxy::implThread()->postDelayedTask(
+ base::Bind(&ThreadProxy::checkForCompletedRasterTasksOnImplThread,
+ m_weakFactoryOnImplThread.GetWeakPtr()),
+ checkForCompletedRasterTasksDelay * 1000);
+ m_checkForCompletedRasterTasksPending = true;
+}
+
+void ThreadProxy::checkForCompletedRasterTasksOnImplThread()
+{
brianderson 2013/02/12 01:44:31 DCHECK(isImplThread())?
reveman 2013/02/12 02:29:52 Done.
+ m_checkForCompletedRasterTasksPending = false;
+ if (m_layerTreeHostImpl)
+ m_layerTreeHostImpl->checkForCompletedRasterTasks();
+}
+
void ThreadProxy::setNeedsForcedCommitOnImplThread()
{
DCHECK(isImplThread());

Powered by Google App Engine
This is Rietveld 408576698