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

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: fixed WebKit tests for patch #1 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 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);
}

Powered by Google App Engine
This is Rietveld 408576698