| Index: cc/layer_tree_host.cc
|
| diff --git a/cc/layer_tree_host.cc b/cc/layer_tree_host.cc
|
| index 92e443584b95aebd62e68d2518b154815936ca1c..07d25919130c69184427d5f9e1bdf6d492fe05f6 100644
|
| --- a/cc/layer_tree_host.cc
|
| +++ b/cc/layer_tree_host.cc
|
| @@ -39,7 +39,6 @@ bool LayerTreeHost::s_needsFilterContext = false;
|
|
|
| LayerTreeSettings::LayerTreeSettings()
|
| : acceleratePainting(false)
|
| - , showFPSCounter(false)
|
| , showPlatformLayerTree(false)
|
| , showPaintRects(false)
|
| , showPropertyChangedRects(false)
|
| @@ -280,25 +279,33 @@ void LayerTreeHost::finishCommitOnImplThread(LayerTreeHostImpl* hostImpl)
|
| m_commitNumber++;
|
| }
|
|
|
| +void LayerTreeHost::createHUDLayerIfNeeded()
|
| +{
|
| + if (!m_hudLayer)
|
| + m_hudLayer = HeadsUpDisplayLayer::create();
|
| +}
|
| +
|
| +void LayerTreeHost::setShowFPSCounter(bool show)
|
| +{
|
| + createHUDLayerIfNeeded();
|
| + m_hudLayer->setShowFPSCounter(show);
|
| +}
|
| +
|
| void LayerTreeHost::setFontAtlas(scoped_ptr<FontAtlas> fontAtlas)
|
| {
|
| - m_fontAtlas = fontAtlas.Pass();
|
| - setNeedsCommit();
|
| + createHUDLayerIfNeeded();
|
| + m_hudLayer->setFontAtlas(fontAtlas.Pass());
|
| }
|
|
|
| void LayerTreeHost::willCommit()
|
| {
|
| m_client->willCommit();
|
| - if (m_rootLayer && m_settings.showDebugInfo()) {
|
| - if (!m_hudLayer)
|
| - m_hudLayer = HeadsUpDisplayLayer::create();
|
|
|
| - if (m_fontAtlas.get())
|
| - m_hudLayer->setFontAtlas(m_fontAtlas.Pass());
|
| + if (m_settings.showDebugInfo())
|
| + createHUDLayerIfNeeded();
|
|
|
| - if (!m_hudLayer->parent())
|
| - m_rootLayer->addChild(m_hudLayer);
|
| - }
|
| + if (m_rootLayer && m_hudLayer && !m_hudLayer->parent())
|
| + m_rootLayer->addChild(m_hudLayer);
|
| }
|
|
|
| void LayerTreeHost::commitComplete()
|
|
|