Chromium Code Reviews| Index: cc/layer_tree_host.cc |
| diff --git a/cc/layer_tree_host.cc b/cc/layer_tree_host.cc |
| index ebc998ed856ed26077d979a67eb4c0e403b75039..624f71925f984abf9b43b97a117d884bfa4e3ee0 100644 |
| --- a/cc/layer_tree_host.cc |
| +++ b/cc/layer_tree_host.cc |
| @@ -38,7 +38,6 @@ bool LayerTreeHost::s_needsFilterContext = false; |
| LayerTreeSettings::LayerTreeSettings() |
| : acceleratePainting(false) |
| - , showFPSCounter(false) |
| , showPlatformLayerTree(false) |
| , showPaintRects(false) |
| , showPropertyChangedRects(false) |
| @@ -277,25 +276,33 @@ void LayerTreeHost::finishCommitOnImplThread(LayerTreeHostImpl* hostImpl) |
| m_commitNumber++; |
| } |
| +void LayerTreeHost::createHUDLayerIfNeeded() |
|
egraether
2012/10/25 02:01:11
Called whenever there is need to create a HUDLayer
|
| +{ |
| + 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.showDebugRects()) |
|
egraether
2012/10/25 02:01:11
Checking for the rects is enough here. In case sho
|
| + 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() |