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

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: Address comments 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
« no previous file with comments | « cc/single_thread_proxy.h ('k') | cc/thread_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/single_thread_proxy.cc
diff --git a/cc/single_thread_proxy.cc b/cc/single_thread_proxy.cc
index c5a07f097d59d9c90df0a2e3d77f1a17e42f9e2c..e0234fedf96907a44307e62aa177ac1bc9580187 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;
@@ -312,6 +314,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());
« no previous file with comments | « 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