Chromium Code Reviews| Index: cc/layer_tree_host.cc |
| diff --git a/cc/layer_tree_host.cc b/cc/layer_tree_host.cc |
| index 003f13031f6ff46d1fadbba44f5e22ebcf329160..72fd5de1d76344459518b18d9ac29b3cdb582e2e 100644 |
| --- a/cc/layer_tree_host.cc |
| +++ b/cc/layer_tree_host.cc |
| @@ -298,16 +298,17 @@ 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()); |
| + createFontAtlasIfNeeded(); |
|
jamesr
2012/11/27 21:07:44
will we ever get setShowFPSCounter(false) calls? w
egraether
2012/11/27 21:49:22
right, I'll add a check for that.
ATM there should
|
| + m_hudLayer->setShowFPSCounter(show); |
| } |
| void LayerTreeHost::willCommit() |
| @@ -317,6 +318,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); |
| } |