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

Unified Diff: cc/layer_tree_host.cc

Issue 11189037: toggle FPS counter in compositor (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 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/layer_tree_host.cc
diff --git a/cc/layer_tree_host.cc b/cc/layer_tree_host.cc
index a15713666c6f423c2103ca1cb098426c87a31e58..8729fee84c89506eb49799211d340fe6801ae593 100644
--- a/cc/layer_tree_host.cc
+++ b/cc/layer_tree_host.cc
@@ -110,6 +110,7 @@ CCLayerTreeHost::CCLayerTreeHost(CCLayerTreeHostClient* client, const CCLayerTre
, m_backgroundColor(SK_ColorWHITE)
, m_hasTransparentBackground(false)
, m_partialTextureUpdateRequests(0)
+ , m_showFPSCounter(false)
{
ASSERT(CCProxy::isMainThread());
numLayerTreeInstances++;
@@ -277,6 +278,12 @@ void CCLayerTreeHost::finishCommitOnImplThread(CCLayerTreeHostImpl* hostImpl)
m_commitNumber++;
}
+void CCLayerTreeHost::setShowFPSCounter(bool show)
+{
+ m_showFPSCounter = show;
+ m_proxy->setShowFPSCounter(show);
+}
+
void CCLayerTreeHost::setFontAtlas(scoped_ptr<CCFontAtlas> fontAtlas)
{
m_fontAtlas = fontAtlas.Pass();
@@ -286,7 +293,7 @@ void CCLayerTreeHost::setFontAtlas(scoped_ptr<CCFontAtlas> fontAtlas)
void CCLayerTreeHost::willCommit()
{
m_client->willCommit();
- if (m_rootLayer && m_settings.showDebugInfo()) {
+ if (m_rootLayer && (m_settings.showDebugInfo() || m_showFPSCounter)) {
if (!m_hudLayer)
m_hudLayer = HeadsUpDisplayLayerChromium::create();

Powered by Google App Engine
This is Rietveld 408576698