| Index: cc/layer_tree_host.cc
|
| diff --git a/cc/layer_tree_host.cc b/cc/layer_tree_host.cc
|
| index 25d3d2730df1cb0cbbc4cb3441053dc75405acdf..505427473d1ad8238e0073c0e89d9236d136abaa 100644
|
| --- a/cc/layer_tree_host.cc
|
| +++ b/cc/layer_tree_host.cc
|
| @@ -299,16 +299,21 @@ void LayerTreeHost::createHUDLayerIfNeeded()
|
| m_hudLayer = HeadsUpDisplayLayer::create();
|
| }
|
|
|
| -void LayerTreeHost::setShowFPSCounter(bool show)
|
| +void LayerTreeHost::createFontAtlasIfNeeded()
|
| {
|
| - createHUDLayerIfNeeded();
|
| - m_hudLayer->setShowFPSCounter(show);
|
| + if (m_hudLayer && !m_hudLayer->hasFontAtlas())
|
| + m_hudLayer->setFontAtlas(m_client->createFontAtlas());
|
| }
|
|
|
| -void LayerTreeHost::setFontAtlas(scoped_ptr<FontAtlas> fontAtlas)
|
| +void LayerTreeHost::setShowFPSCounter(bool show)
|
| {
|
| - createHUDLayerIfNeeded();
|
| - m_hudLayer->setFontAtlas(fontAtlas.Pass());
|
| + if (show) {
|
| + createHUDLayerIfNeeded();
|
| + createFontAtlasIfNeeded();
|
| + }
|
| +
|
| + if (m_hudLayer)
|
| + m_hudLayer->setShowFPSCounter(show);
|
| }
|
|
|
| void LayerTreeHost::willCommit()
|
| @@ -318,6 +323,9 @@ void LayerTreeHost::willCommit()
|
| if (m_settings.showDebugInfo())
|
| createHUDLayerIfNeeded();
|
|
|
| + if (m_settings.showPlatformLayerTree)
|
| + createFontAtlasIfNeeded();
|
| +
|
| if (m_rootLayer && m_hudLayer && !m_hudLayer->parent())
|
| m_rootLayer->addChild(m_hudLayer);
|
| }
|
|
|