Commit fdc9eec4 authored by tedchoc@chromium.org's avatar tedchoc@chromium.org

Remove top controls layer from cc/.

After danakj@ comment on the CL that added the top controls manager,
I looked into layer positioning in the browser compositor to keep it
in sync with the top controls UI widgets.

This removes the need for the top controls layer and also gets rid
of the need to pass an increased clip size to the layer tree host.

Now the renderer compositor will make the webkit size and the browser
compositor will be in charge of moving it around.

BUG=161303


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177250 0039d316-1c4b-4281-b951-d872f2087c98
parent 56998b02
......@@ -299,9 +299,6 @@ void LayerTreeHost::finishCommitOnImplThread(LayerTreeHostImpl* hostImpl)
hostImpl->setPageScaleFactorAndLimits(m_pageScaleFactor, m_minPageScaleFactor, m_maxPageScaleFactor);
hostImpl->setDebugState(m_debugState);
if (m_settings.calculateTopControlsPosition && m_topControlsContentLayer && hostImpl->topControlsManager())
hostImpl->topControlsManager()->set_content_layer_id(m_topControlsContentLayer->id());
m_commitNumber++;
}
......@@ -440,8 +437,6 @@ void LayerTreeHost::setRootLayer(scoped_refptr<Layer> rootLayer)
if (m_hudLayer)
m_hudLayer->removeFromParent();
if (m_topControlsContentLayer)
m_topControlsContentLayer->removeFromParent();
setNeedsFullTreeSync();
}
......@@ -538,22 +533,6 @@ void LayerTreeHost::updateLayers(ResourceUpdateQueue& queue, size_t memoryAlloca
if (memoryAllocationLimitBytes)
m_contentsTextureManager->setMaxMemoryLimitBytes(memoryAllocationLimitBytes);
if (m_settings.calculateTopControlsPosition) {
if (!m_topControlsContentLayer) {
m_topControlsContentLayer = Layer::create();
m_topControlsContentLayer->setIsDrawable(false);
m_topControlsContentLayer->setDebugName("Top Controls Content");
}
// Insert a layer that allows the top controls manager to move around
// the content without clobbering/being clobbered by other transforms.
if (!LayerTreeHostCommon::findLayerInSubtree(m_rootLayer.get(), m_topControlsContentLayer->id())) {
m_topControlsContentLayer->setLayerTreeHost(m_rootLayer->layerTreeHost());
m_topControlsContentLayer->setChildren(m_rootLayer->children());
m_rootLayer->addChild(m_topControlsContentLayer);
}
}
updateLayers(rootLayer(), queue);
}
......
......@@ -249,7 +249,6 @@ private:
scoped_refptr<Layer> m_rootLayer;
scoped_refptr<HeadsUpDisplayLayer> m_hudLayer;
scoped_refptr<Layer> m_topControlsContentLayer;
scoped_ptr<PrioritizedResourceManager> m_contentsTextureManager;
scoped_ptr<PrioritizedResource> m_surfaceMemoryPlaceholder;
......
......@@ -32,7 +32,6 @@ scoped_ptr<TopControlsManager> TopControlsManager::Create(
TopControlsManager::TopControlsManager(TopControlsManagerClient* client,
float top_controls_height)
: client_(client),
content_layer_id_(0),
is_overlay_mode_(false),
top_controls_height_(top_controls_height),
controls_top_offset_(0),
......@@ -59,19 +58,6 @@ void TopControlsManager::UpdateDrawPositions() {
StartAnimationIfNecessary();
previous_root_scroll_offset_ = RootScrollLayerTotalScrollY();
}
float offset_top = is_overlay_mode_ ? 0 : content_top_offset_;
LayerImpl* content_layer =
client_->activeTree()->FindActiveTreeLayerById(content_layer_id_);
DCHECK(content_layer);
if (content_layer) {
gfx::Transform transform;
transform.Translate(0, offset_top);
content_layer->setTransform(transform);
}
// TODO(tedchoc): Adjust fixed position layers as well.
}
void TopControlsManager::ScrollBegin() {
......
......@@ -28,7 +28,6 @@ class CC_EXPORT TopControlsManager {
float top_controls_height);
virtual ~TopControlsManager();
void set_content_layer_id(int id) { content_layer_id_ = id; }
float controls_top_offset() { return controls_top_offset_; }
float content_top_offset() { return content_top_offset_; }
float is_overlay_mode() { return is_overlay_mode_; }
......@@ -60,7 +59,6 @@ class CC_EXPORT TopControlsManager {
// this.
scoped_ptr<KeyframedFloatAnimationCurve> top_controls_animation_;
int content_layer_id_;
bool is_showing_animation_;
bool is_overlay_mode_;
float controls_top_offset_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment