cc: Move more functionality from host to LayerTreeImpl

This cleans up some longstanding TODOs that were creating when splitting
out logic into LayerTreeImpl.  It's possible that some of the helpers to
get at active tree layers (root, scrolling, etc) could be moved, but
given that scrolling only happens on the active tree (with the pending
tree being updated with the result), these accessors could arguably stay
permanently.

This also moves background color / has transparent background to the tree
itself, so that these changes will synchronize with any content on that
tree.  Things like viewport, device scale, and debug state are considered
host-specific and take effect immediately.

[email protected]
BUG=155209


Review URL: https://chromiumcodereview.appspot.com/11704003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175252 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/cc/layer_tree_host_impl.cc b/cc/layer_tree_host_impl.cc
index 55f6452d..0d722c9 100644
--- a/cc/layer_tree_host_impl.cc
+++ b/cc/layer_tree_host_impl.cc
@@ -219,8 +219,6 @@
                             ManagedMemoryPolicy::CUTOFF_ALLOW_EVERYTHING,
                             0,
                             ManagedMemoryPolicy::CUTOFF_ALLOW_NOTHING)
-    , m_backgroundColor(0)
-    , m_hasTransparentBackground(false)
     , m_needsUpdateDrawProperties(false)
     , m_pinchGestureActive(false)
     , m_fpsCounter(FrameRateCounter::create(m_proxy->hasImplThread()))
@@ -614,9 +612,9 @@
     }
 #endif
 
-    if (!m_hasTransparentBackground) {
+    if (!activeTree()->has_transparent_background()) {
         frame.renderPasses.last()->has_transparent_background = false;
-        appendQuadsToFillScreen(frame.renderPasses.last(), rootLayer(), m_backgroundColor, occlusionTracker);
+        appendQuadsToFillScreen(frame.renderPasses.last(), rootLayer(), activeTree()->background_color(), occlusionTracker);
     }
 
     if (drawFrame)
@@ -1000,12 +998,6 @@
     return 0;
 }
 
-void LayerTreeHostImpl::setRootLayer(scoped_ptr<LayerImpl> layer)
-{
-    m_activeTree->SetRootLayer(layer.Pass());
-    setNeedsUpdateDrawProperties();
-}
-
 void LayerTreeHostImpl::createPendingTree()
 {
     CHECK(!m_pendingTree);
@@ -1046,12 +1038,6 @@
     m_client->onHasPendingTreeStateChanged(pendingTree());
 }
 
-scoped_ptr<LayerImpl> LayerTreeHostImpl::detachLayerTree()
-{
-    scoped_ptr<LayerImpl> layer = m_activeTree->DetachLayerTree();
-    return layer.Pass();
-}
-
 void LayerTreeHostImpl::setVisible(bool visible)
 {
     DCHECK(m_proxy->isImplThread());