Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(619)

Unified Diff: cc/layer_tree_host.cc

Issue 11413123: cc: switch to new WebLayerTreeViewClient API for requesting font atlas (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fixing aura, added show check Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}
« no previous file with comments | « cc/layer_tree_host.h ('k') | cc/layer_tree_host_client.h » ('j') | ui/compositor/compositor.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698