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

Unified Diff: cc/heads_up_display_layer.cc

Issue 11189037: toggle FPS counter in compositor (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: removed hasFontAtlas methods, put DCHECKs in HUDLayerImpl 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/heads_up_display_layer.cc
diff --git a/cc/heads_up_display_layer.cc b/cc/heads_up_display_layer.cc
index 2302ebb8078de500b018def2d2d02b2a2629f93d..2a1ab6db2e24f1f2e0dfa8e6badfcfb98b183011 100644
--- a/cc/heads_up_display_layer.cc
+++ b/cc/heads_up_display_layer.cc
@@ -19,8 +19,8 @@ scoped_refptr<HeadsUpDisplayLayer> HeadsUpDisplayLayer::create()
HeadsUpDisplayLayer::HeadsUpDisplayLayer()
: Layer()
+ , m_showFPSCounter(false)
{
-
setBounds(IntSize(512, 128));
}
@@ -56,6 +56,12 @@ void HeadsUpDisplayLayer::setFontAtlas(scoped_ptr<FontAtlas> fontAtlas)
setNeedsCommit();
}
+void HeadsUpDisplayLayer::setShowFPSCounter(bool show)
+{
+ m_showFPSCounter = show;
+ setNeedsCommit();
+}
+
scoped_ptr<LayerImpl> HeadsUpDisplayLayer::createLayerImpl()
{
return HeadsUpDisplayLayerImpl::create(m_layerId).PassAs<LayerImpl>();
@@ -65,11 +71,11 @@ void HeadsUpDisplayLayer::pushPropertiesTo(LayerImpl* layerImpl)
{
Layer::pushPropertiesTo(layerImpl);
- if (!m_fontAtlas.get())
- return;
-
HeadsUpDisplayLayerImpl* hudLayerImpl = static_cast<HeadsUpDisplayLayerImpl*>(layerImpl);
- hudLayerImpl->setFontAtlas(m_fontAtlas.Pass());
+ hudLayerImpl->setShowFPSCounter(m_showFPSCounter);
+
+ if (m_fontAtlas.get())
+ hudLayerImpl->setFontAtlas(m_fontAtlas.Pass());
}
}

Powered by Google App Engine
This is Rietveld 408576698