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

Unified Diff: cc/single_thread_proxy.cc

Issue 11028021: cc: Improve frame/commit accounting (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Make it work in single tread mode. Get rid of active concept. 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 e9ac8e79f92d44d744be6fe5bf9e20e12927982a..de27220be4c98a8e86e6970cb610d47bf9234b2c 100644
--- a/cc/single_thread_proxy.cc
+++ b/cc/single_thread_proxy.cc
@@ -7,6 +7,7 @@
#include "CCSingleThreadProxy.h"
#include "CCDrawQuad.h"
+#include "CCFrameRateCounter.h"
#include "CCGraphicsContext.h"
#include "CCLayerTreeHost.h"
#include "CCTextureUpdateController.h"
@@ -117,6 +118,7 @@ bool CCSingleThreadProxy::initializeRenderer()
if (ok) {
m_rendererInitialized = true;
m_RendererCapabilitiesForMainThread = m_layerTreeHostImpl->rendererCapabilities();
+ onVSyncParametersChanged(0, 1.0/60.0);
}
return ok;
@@ -310,6 +312,14 @@ void CCSingleThreadProxy::onSwapBuffersCompleteOnImplThread()
ASSERT_NOT_REACHED();
}
+void CCSingleThreadProxy::onVSyncParametersChanged(double monotonicTimebase, double intervalInSeconds)
+{
+ TRACE_EVENT2("cc", "CCSingleThreadProxy::onVSyncParametersChanged", "monotonicTimebase", monotonicTimebase, "intervalInSeconds", intervalInSeconds);
+ base::TimeTicks timebase = base::TimeTicks::FromInternalValue(monotonicTimebase * base::Time::kMicrosecondsPerSecond);
+ base::TimeDelta interval = base::TimeDelta::FromMicroseconds(intervalInSeconds * base::Time::kMicrosecondsPerSecond);
+ m_layerTreeHostImpl->fpsCounter()->setTimebaseAndInterval(timebase, interval);
+}
+
bool CCSingleThreadProxy::commitAndComposite()
{
ASSERT(CCProxy::isMainThread());
« cc/frame_rate_counter.cc ('K') | « 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