Chromium Code Reviews| Index: cc/layer_tree_host.cc |
| diff --git a/cc/layer_tree_host.cc b/cc/layer_tree_host.cc |
| index c6d3003279fe669bbd01f13c33a3db5e99ef2f29..bcc42bb71a4969b8ea1729804ae0dfb28f36c806 100644 |
| --- a/cc/layer_tree_host.cc |
| +++ b/cc/layer_tree_host.cc |
| @@ -38,7 +38,6 @@ bool CCLayerTreeHost::s_needsFilterContext = false; |
| CCLayerTreeSettings::CCLayerTreeSettings() |
| : acceleratePainting(false) |
| - , showFPSCounter(false) |
| , showPlatformLayerTree(false) |
| , showPaintRects(false) |
| , showPropertyChangedRects(false) |
| @@ -277,25 +276,35 @@ void CCLayerTreeHost::finishCommitOnImplThread(CCLayerTreeHostImpl* hostImpl) |
| m_commitNumber++; |
| } |
| +void CCLayerTreeHost::setShowFPSCounter(bool show) |
| +{ |
| + createHUDLayerIfNeeded(); |
|
danakj
2012/10/23 15:19:53
Can we DCHECK some stuff here?
DCHECK(m_hudLayer);
|
| + m_hudLayer->setShowFPSCounter(show); |
| + setNeedsCommit(); |
| +} |
| + |
| void CCLayerTreeHost::setFontAtlas(scoped_ptr<CCFontAtlas> fontAtlas) |
| { |
| - m_fontAtlas = fontAtlas.Pass(); |
| + createHUDLayerIfNeeded(); |
| + m_hudLayer->setFontAtlas(fontAtlas.Pass()); |
| setNeedsCommit(); |
| } |
| +void CCLayerTreeHost::createHUDLayerIfNeeded() |
| +{ |
| + if (!m_hudLayer) |
| + m_hudLayer = HeadsUpDisplayLayerChromium::create(); |
| +} |
| + |
| void CCLayerTreeHost::willCommit() |
| { |
| m_client->willCommit(); |
| - if (m_rootLayer && m_settings.showDebugInfo()) { |
| - if (!m_hudLayer) |
| - m_hudLayer = HeadsUpDisplayLayerChromium::create(); |
| - if (m_fontAtlas.get()) |
| - m_hudLayer->setFontAtlas(m_fontAtlas.Pass()); |
| + if (m_settings.showDebugRects()) |
|
danakj
2012/10/23 15:19:53
This is missing m_settings.showPlatformLayerTree.
|
| + createHUDLayerIfNeeded(); |
| - if (!m_hudLayer->parent()) |
| - m_rootLayer->addChild(m_hudLayer); |
| - } |
| + if (m_rootLayer && m_hudLayer && !m_hudLayer->parent()) |
| + m_rootLayer->addChild(m_hudLayer); |
| } |
| void CCLayerTreeHost::commitComplete() |