summaryrefslogtreecommitdiffstats
path: root/cc/heads_up_display_layer.cc
diff options
context:
space:
mode:
authoregraether@chromium.org <egraether@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-06 18:28:24 +0000
committeregraether@chromium.org <egraether@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-06 18:28:24 +0000
commit7a573a4e701fab65b3ef6d9cb5c7fa994519995c (patch)
tree5e758bba3566344749d9aa5cb29bdd838f57185e /cc/heads_up_display_layer.cc
parentdfb6123c0bcb67e372fb809e10de3810f502b14f (diff)
downloadchromium_src-7a573a4e701fab65b3ef6d9cb5c7fa994519995c.zip
chromium_src-7a573a4e701fab65b3ef6d9cb5c7fa994519995c.tar.gz
chromium_src-7a573a4e701fab65b3ef6d9cb5c7fa994519995c.tar.bz2
The FPS counter displays the framerate in the compositor's HUD layer. This change allows for toggling the FPS counter without using the '--show-fps-counter' command-line flag.
WebKit side: https://bugs.webkit.org/show_bug.cgi?id=99660 BUG=154754 Review URL: https://chromiumcodereview.appspot.com/11189037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166233 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/heads_up_display_layer.cc')
-rw-r--r--cc/heads_up_display_layer.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/cc/heads_up_display_layer.cc b/cc/heads_up_display_layer.cc
index 355c94d..423e535 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(gfx::Size(256, 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());
}
} // namespace cc