summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-19 04:58:01 +0000
committerjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-19 04:58:01 +0000
commit69b50ec5726f719bdb941254f96a37605833dd56 (patch)
tree713bf001a850a8a6d8c5003ae991f12b7f504819
parent2ad7f1b00baeb0805aa5d87692e11230edbeaf74 (diff)
downloadchromium_src-69b50ec5726f719bdb941254f96a37605833dd56.zip
chromium_src-69b50ec5726f719bdb941254f96a37605833dd56.tar.gz
chromium_src-69b50ec5726f719bdb941254f96a37605833dd56.tar.bz2
Find root scroll layer at tree activation
This finds the root scroll layer when a LayerTreeImpl is activated since we can only interact with the active tree. Doing this allows adding more checks for proper use and cuts down on the number of functions that have to be called in a specific order. I've also tightened up the TopControlsManagerClient interface, since previously the interface defined "virtual LayerTreeImpl* activeTree()" but LayerTreeHostImpl also defined a non-virtual "const LayerTreeImpl* activeTree() const" so depending on the constness of a pointer callers would get one or the other. Turns out the top controls system doesn't need the active tree, it just needs the root scroll layer. It actually doesn't even need the full layer, it just needs to know if there is a layer and if so what the y offset is. BUG=169143 Review URL: https://chromiumcodereview.appspot.com/12025031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177847 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--cc/layer_tree_host.cc3
-rw-r--r--cc/layer_tree_host_impl.cc21
-rw-r--r--cc/layer_tree_host_impl.h4
-rw-r--r--cc/layer_tree_host_impl_unittest.cc29
-rw-r--r--cc/layer_tree_impl.cc29
-rw-r--r--cc/layer_tree_impl.h16
-rw-r--r--cc/picture_layer_impl.cc1
-rw-r--r--cc/top_controls_manager.cc14
-rw-r--r--cc/top_controls_manager.h1
-rw-r--r--cc/top_controls_manager_client.h3
-rw-r--r--cc/top_controls_manager_unittest.cc18
11 files changed, 75 insertions, 64 deletions
diff --git a/cc/layer_tree_host.cc b/cc/layer_tree_host.cc
index 62f3995..c237d1a 100644
--- a/cc/layer_tree_host.cc
+++ b/cc/layer_tree_host.cc
@@ -285,7 +285,6 @@ void LayerTreeHost::finishCommitOnImplThread(LayerTreeHostImpl* hostImpl)
TRACE_EVENT0("cc", "LayerTreeHost::pushProperties");
TreeSynchronizer::pushProperties(rootLayer(), syncTree->RootLayer());
}
- syncTree->FindRootScrollLayer();
m_needsFullTreeSync = false;
@@ -298,6 +297,8 @@ void LayerTreeHost::finishCommitOnImplThread(LayerTreeHostImpl* hostImpl)
syncTree->set_background_color(m_backgroundColor);
syncTree->set_has_transparent_background(m_hasTransparentBackground);
+ syncTree->FindRootScrollLayer();
+
if (!m_settings.implSidePainting) {
// If we're not in impl-side painting, the tree is immediately
// considered active.
diff --git a/cc/layer_tree_host_impl.cc b/cc/layer_tree_host_impl.cc
index e15c288..72d6a8c 100644
--- a/cc/layer_tree_host_impl.cc
+++ b/cc/layer_tree_host_impl.cc
@@ -890,6 +890,16 @@ void LayerTreeHostImpl::readback(void* pixels, const gfx::Rect& rect)
m_renderer->getFramebufferPixels(pixels, rect);
}
+bool LayerTreeHostImpl::haveRootScrollLayer() const {
+ return rootScrollLayer();
+}
+
+float LayerTreeHostImpl::rootScrollLayerTotalScrollY() const {
+ if (LayerImpl* layer = rootScrollLayer())
+ return layer->scrollOffset().y() + layer->scrollDelta().y();
+ return 0.0f;
+}
+
LayerImpl* LayerTreeHostImpl::rootLayer() const
{
return m_activeTree->RootLayer();
@@ -897,12 +907,12 @@ LayerImpl* LayerTreeHostImpl::rootLayer() const
LayerImpl* LayerTreeHostImpl::rootScrollLayer() const
{
- return m_activeTree->root_scroll_layer();
+ return m_activeTree->RootScrollLayer();
}
LayerImpl* LayerTreeHostImpl::currentlyScrollingLayer() const
{
- return m_activeTree->currently_scrolling_layer();
+ return m_activeTree->CurrentlyScrollingLayer();
}
// Content layers can be either directly scrollable or contained in an outer
@@ -922,11 +932,6 @@ static LayerImpl* findScrollLayerForContentLayer(LayerImpl* layerImpl)
return 0;
}
-LayerTreeImpl* LayerTreeHostImpl::activeTree()
-{
- return m_activeTree.get();
-}
-
void LayerTreeHostImpl::createPendingTree()
{
CHECK(!m_pendingTree);
@@ -1423,7 +1428,7 @@ void LayerTreeHostImpl::makeScrollAndScaleSet(ScrollAndScaleSet* scrollInfo, gfx
scroll.layerId = rootScrollLayer()->id();
scroll.scrollDelta = scrollOffset - rootScrollLayer()->scrollOffset();
scrollInfo->scrolls.push_back(scroll);
- activeTree()->root_scroll_layer()->setSentScrollDelta(scroll.scrollDelta);
+ activeTree()->RootScrollLayer()->setSentScrollDelta(scroll.scrollDelta);
scrollInfo->pageScaleDelta = pageScale / m_pinchZoomViewport.page_scale_factor();
m_pinchZoomViewport.set_sent_page_scale_delta(scrollInfo->pageScaleDelta);
}
diff --git a/cc/layer_tree_host_impl.h b/cc/layer_tree_host_impl.h
index 10f4c8a..f4dbf3f 100644
--- a/cc/layer_tree_host_impl.h
+++ b/cc/layer_tree_host_impl.h
@@ -85,9 +85,10 @@ public:
virtual bool haveTouchEventHandlersAt(const gfx::Point&) OVERRIDE;
// TopControlsManagerClient implementation.
- virtual LayerTreeImpl* activeTree() OVERRIDE;
virtual void setNeedsUpdateDrawProperties() OVERRIDE;
virtual void setNeedsRedraw() OVERRIDE;
+ virtual bool haveRootScrollLayer() const OVERRIDE;
+ virtual float rootScrollLayerTotalScrollY() const OVERRIDE;
struct CC_EXPORT FrameData : public RenderPassSink {
FrameData();
@@ -163,6 +164,7 @@ public:
void readback(void* pixels, const gfx::Rect&);
+ LayerTreeImpl* activeTree() { return m_activeTree.get(); }
const LayerTreeImpl* activeTree() const { return m_activeTree.get(); }
LayerTreeImpl* pendingTree() { return m_pendingTree.get(); }
const LayerTreeImpl* pendingTree() const { return m_pendingTree.get(); }
diff --git a/cc/layer_tree_host_impl_unittest.cc b/cc/layer_tree_host_impl_unittest.cc
index c6a5e0e..432800f 100644
--- a/cc/layer_tree_host_impl_unittest.cc
+++ b/cc/layer_tree_host_impl_unittest.cc
@@ -182,7 +182,7 @@ public:
contents->setAnchorPoint(gfx::PointF(0, 0));
root->addChild(contents.Pass());
m_hostImpl->activeTree()->SetRootLayer(root.Pass());
- m_hostImpl->activeTree()->FindRootScrollLayer();
+ m_hostImpl->activeTree()->DidBecomeActive();
}
scoped_ptr<LayerImpl> createScrollableLayer(int id, const gfx::Size& size)
@@ -1314,7 +1314,7 @@ TEST_P(LayerTreeHostImplTest, scrollRootAndChangePageScaleOnMainThread)
float pageScale = 2;
scoped_ptr<LayerImpl> root = createScrollableLayer(1, surfaceSize);
m_hostImpl->activeTree()->SetRootLayer(root.Pass());
- m_hostImpl->activeTree()->FindRootScrollLayer();
+ m_hostImpl->activeTree()->DidBecomeActive();
m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
initializeRendererAndDrawFrame();
@@ -1367,7 +1367,7 @@ TEST_P(LayerTreeHostImplTest, scrollRootAndChangePageScaleOnImplThread)
float pageScale = 2;
scoped_ptr<LayerImpl> root = createScrollableLayer(1, surfaceSize);
m_hostImpl->activeTree()->SetRootLayer(root.Pass());
- m_hostImpl->activeTree()->FindRootScrollLayer();
+ m_hostImpl->activeTree()->DidBecomeActive();
m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
m_hostImpl->setPageScaleFactorAndLimits(1, 1, pageScale);
initializeRendererAndDrawFrame();
@@ -1454,7 +1454,7 @@ TEST_P(LayerTreeHostImplTest, scrollChildAndChangePageScaleOnMainThread)
int scrollLayerId = 2;
root->addChild(createScrollableLayer(scrollLayerId, surfaceSize));
m_hostImpl->activeTree()->SetRootLayer(root.Pass());
- m_hostImpl->activeTree()->FindRootScrollLayer();
+ m_hostImpl->activeTree()->DidBecomeActive();
m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
initializeRendererAndDrawFrame();
@@ -1504,7 +1504,7 @@ TEST_P(LayerTreeHostImplTest, scrollChildBeyondLimit)
root->addChild(child.Pass());
m_hostImpl->activeTree()->SetRootLayer(root.Pass());
- m_hostImpl->activeTree()->FindRootScrollLayer();
+ m_hostImpl->activeTree()->DidBecomeActive();
m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
initializeRendererAndDrawFrame();
{
@@ -1530,14 +1530,15 @@ TEST_P(LayerTreeHostImplTest, scrollEventBubbling)
// When we try to scroll a non-scrollable child layer, the scroll delta
// should be applied to one of its ancestors if possible.
gfx::Size surfaceSize(10, 10);
- scoped_ptr<LayerImpl> root = createScrollableLayer(1, surfaceSize);
- scoped_ptr<LayerImpl> child = createScrollableLayer(2, surfaceSize);
+ gfx::Size contentSize(20, 20);
+ scoped_ptr<LayerImpl> root = createScrollableLayer(1, contentSize);
+ scoped_ptr<LayerImpl> child = createScrollableLayer(2, contentSize);
child->setScrollable(false);
root->addChild(child.Pass());
m_hostImpl->activeTree()->SetRootLayer(root.Pass());
- m_hostImpl->activeTree()->FindRootScrollLayer();
+ m_hostImpl->activeTree()->DidBecomeActive();
m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
initializeRendererAndDrawFrame();
{
@@ -1558,14 +1559,14 @@ TEST_P(LayerTreeHostImplTest, scrollBeforeRedraw)
{
gfx::Size surfaceSize(10, 10);
m_hostImpl->activeTree()->SetRootLayer(createScrollableLayer(1, surfaceSize));
- m_hostImpl->activeTree()->FindRootScrollLayer();
+ m_hostImpl->activeTree()->DidBecomeActive();
m_hostImpl->setViewportSize(surfaceSize, surfaceSize);
// Draw one frame and then immediately rebuild the layer tree to mimic a tree synchronization.
initializeRendererAndDrawFrame();
m_hostImpl->activeTree()->DetachLayerTree();
m_hostImpl->activeTree()->SetRootLayer(createScrollableLayer(2, surfaceSize));
- m_hostImpl->activeTree()->FindRootScrollLayer();
+ m_hostImpl->activeTree()->DidBecomeActive();
// Scrolling should still work even though we did not draw yet.
EXPECT_EQ(m_hostImpl->scrollBegin(gfx::Point(5, 5), InputHandlerClient::Wheel), InputHandlerClient::ScrollStarted);
@@ -4039,7 +4040,7 @@ void LayerTreeHostImplTest::pinchZoomPanViewportForcesCommitRedraw(const float d
// and not the document, we can verify commit/redraw are requested.
root->setMaxScrollOffset(gfx::Vector2d());
m_hostImpl->activeTree()->SetRootLayer(root.Pass());
- m_hostImpl->activeTree()->FindRootScrollLayer();
+ m_hostImpl->activeTree()->DidBecomeActive();
m_hostImpl->setViewportSize(layoutSurfaceSize, deviceSurfaceSize);
m_hostImpl->setPageScaleFactorAndLimits(1, 1, pageScale);
initializeRendererAndDrawFrame();
@@ -4112,7 +4113,7 @@ void LayerTreeHostImplTest::pinchZoomPanViewportTest(const float deviceScaleFact
// we can see the scroll component on the implTransform.
root->setMaxScrollOffset(gfx::Vector2d());
m_hostImpl->activeTree()->SetRootLayer(root.Pass());
- m_hostImpl->activeTree()->FindRootScrollLayer();
+ m_hostImpl->activeTree()->DidBecomeActive();
m_hostImpl->setViewportSize(layoutSurfaceSize, deviceSurfaceSize);
m_hostImpl->setPageScaleFactorAndLimits(1, 1, pageScale);
initializeRendererAndDrawFrame();
@@ -4197,7 +4198,7 @@ void LayerTreeHostImplTest::pinchZoomPanViewportAndScrollTest(const float device
// pinchZoomViewport so we can see some scroll component on the implTransform.
root->setMaxScrollOffset(gfx::Vector2d(3, 4));
m_hostImpl->activeTree()->SetRootLayer(root.Pass());
- m_hostImpl->activeTree()->FindRootScrollLayer();
+ m_hostImpl->activeTree()->DidBecomeActive();
m_hostImpl->setViewportSize(layoutSurfaceSize, deviceSurfaceSize);
m_hostImpl->setPageScaleFactorAndLimits(1, 1, pageScale);
initializeRendererAndDrawFrame();
@@ -4321,7 +4322,7 @@ void LayerTreeHostImplTest::pinchZoomPanViewportAndScrollBoundaryTest(const floa
// pinchZoomViewport so we can see some scroll component on the implTransform.
root->setMaxScrollOffset(gfx::Vector2d(3, 4));
m_hostImpl->activeTree()->SetRootLayer(root.Pass());
- m_hostImpl->activeTree()->FindRootScrollLayer();
+ m_hostImpl->activeTree()->DidBecomeActive();
m_hostImpl->setViewportSize(layoutSurfaceSize, deviceSurfaceSize);
m_hostImpl->setPageScaleFactorAndLimits(1, 1, pageScale);
initializeRendererAndDrawFrame();
diff --git a/cc/layer_tree_impl.cc b/cc/layer_tree_impl.cc
index 99ba203..bfdcf50 100644
--- a/cc/layer_tree_impl.cc
+++ b/cc/layer_tree_impl.cc
@@ -70,6 +70,7 @@ scoped_ptr<LayerImpl> LayerTreeImpl::DetachLayerTree() {
// Clear all data structures that have direct references to the layer tree.
scrolling_layer_id_from_previous_tree_ =
currently_scrolling_layer_ ? currently_scrolling_layer_->id() : 0;
+ root_scroll_layer_ = NULL;
currently_scrolling_layer_ = NULL;
render_surface_layer_list_.clear();
@@ -77,17 +78,27 @@ scoped_ptr<LayerImpl> LayerTreeImpl::DetachLayerTree() {
return root_layer_.Pass();
}
+LayerImpl* LayerTreeImpl::RootScrollLayer() {
+ DCHECK(IsActiveTree());
+ return root_scroll_layer_;
+}
+
+LayerImpl* LayerTreeImpl::CurrentlyScrollingLayer() {
+ DCHECK(IsActiveTree());
+ return currently_scrolling_layer_;
+}
+
void LayerTreeImpl::ClearCurrentlyScrollingLayer() {
currently_scrolling_layer_ = NULL;
scrolling_layer_id_from_previous_tree_ = 0;
}
void LayerTreeImpl::UpdateMaxScrollOffset() {
- if (!root_scroll_layer() || !root_scroll_layer()->children().size())
+ if (!root_scroll_layer_ || !root_scroll_layer_->children().size())
return;
gfx::SizeF view_bounds = device_viewport_size();
- if (LayerImpl* clip_layer = root_scroll_layer()->parent()) {
+ if (LayerImpl* clip_layer = root_scroll_layer_->parent()) {
// Compensate for non-overlay scrollbars.
if (clip_layer->masksToBounds())
view_bounds = gfx::ScaleSize(clip_layer->bounds(), device_scale_factor());
@@ -113,7 +124,7 @@ void LayerTreeImpl::UpdateMaxScrollOffset() {
// having a vertical scrollbar but no horizontal overflow.
max_scroll.ClampToMin(gfx::Vector2dF());
- root_scroll_layer()->setMaxScrollOffset(gfx::ToFlooredVector2d(max_scroll));
+ root_scroll_layer_->setMaxScrollOffset(gfx::ToFlooredVector2d(max_scroll));
}
void LayerTreeImpl::UpdateDrawProperties() {
@@ -121,8 +132,8 @@ void LayerTreeImpl::UpdateDrawProperties() {
if (!RootLayer())
return;
- if (root_scroll_layer()) {
- root_scroll_layer()->setImplTransform(
+ if (root_scroll_layer_) {
+ root_scroll_layer_->setImplTransform(
layer_tree_host_impl_->implTransform());
}
@@ -177,11 +188,9 @@ const LayerTreeImpl::LayerList& LayerTreeImpl::RenderSurfaceLayerList() const {
}
gfx::Size LayerTreeImpl::ContentSize() const {
- // TODO(aelias): Hardcoding the first child here is weird. Think of
- // a cleaner way to get the contentBounds on the Impl side.
- if (!root_scroll_layer() || root_scroll_layer()->children().empty())
+ if (!root_scroll_layer_)
return gfx::Size();
- return root_scroll_layer()->children()[0]->contentBounds();
+ return root_scroll_layer_->bounds();
}
LayerImpl* LayerTreeImpl::LayerById(int id) {
@@ -214,6 +223,8 @@ static void DidBecomeActiveRecursive(LayerImpl* layer) {
void LayerTreeImpl::DidBecomeActive() {
if (RootLayer())
DidBecomeActiveRecursive(RootLayer());
+ FindRootScrollLayer();
+ UpdateMaxScrollOffset();
}
bool LayerTreeImpl::ContentsTexturesPurged() const {
diff --git a/cc/layer_tree_impl.h b/cc/layer_tree_impl.h
index f96c2e5..01caba4 100644
--- a/cc/layer_tree_impl.h
+++ b/cc/layer_tree_impl.h
@@ -31,6 +31,7 @@ class LayerTreeSettings;
class OutputSurface;
class PaintTimeCounter;
class PinchZoomViewport;
+class Proxy;
class ResourceProvider;
class TileManager;
@@ -90,20 +91,15 @@ class CC_EXPORT LayerTreeImpl {
hud_layer_ = layer_impl;
}
- LayerImpl* root_scroll_layer() { return root_scroll_layer_; }
- const LayerImpl* root_scroll_layer() const { return root_scroll_layer_; }
- void set_root_scroll_layer(LayerImpl* layer_impl) {
- root_scroll_layer_ = layer_impl;
+ LayerImpl* RootScrollLayer();
+ LayerImpl* CurrentlyScrollingLayer();
+ void set_currently_scrolling_layer(LayerImpl* layer) {
+ currently_scrolling_layer_ = layer;
}
- LayerImpl* currently_scrolling_layer() { return currently_scrolling_layer_; }
- void set_currently_scrolling_layer(LayerImpl* layer_impl) {
- currently_scrolling_layer_ = layer_impl;
- }
-
- void FindRootScrollLayer();
void ClearCurrentlyScrollingLayer();
+ void FindRootScrollLayer();
void UpdateMaxScrollOffset();
SkColor background_color() const { return background_color_; }
diff --git a/cc/picture_layer_impl.cc b/cc/picture_layer_impl.cc
index 063e600..ec35542 100644
--- a/cc/picture_layer_impl.cc
+++ b/cc/picture_layer_impl.cc
@@ -42,7 +42,6 @@ const char* PictureLayerImpl::layerTypeAsString() const {
void PictureLayerImpl::appendQuads(QuadSink& quadSink,
AppendQuadsData& appendQuadsData) {
-
const gfx::Rect& rect = visibleContentRect();
gfx::Rect content_rect(gfx::Point(), contentBounds());
diff --git a/cc/top_controls_manager.cc b/cc/top_controls_manager.cc
index fcd7d89..a539952 100644
--- a/cc/top_controls_manager.cc
+++ b/cc/top_controls_manager.cc
@@ -46,7 +46,7 @@ TopControlsManager::~TopControlsManager() {
}
void TopControlsManager::UpdateDrawPositions() {
- if (!RootScrollLayer())
+ if (!client_->haveRootScrollLayer())
return;
// If the scroll position has changed underneath us (i.e. a javascript
@@ -118,7 +118,7 @@ void TopControlsManager::ScrollEnd() {
}
void TopControlsManager::Animate(base::TimeTicks monotonic_time) {
- if (!top_controls_animation_ || !RootScrollLayer())
+ if (!top_controls_animation_ || !client_->haveRootScrollLayer())
return;
double time = (monotonic_time - base::TimeTicks()).InMillisecondsF();
@@ -139,16 +139,8 @@ void TopControlsManager::ResetAnimations() {
top_controls_animation_.reset();
}
-LayerImpl* TopControlsManager::RootScrollLayer() {
- return client_->activeTree()->root_scroll_layer();
-}
-
float TopControlsManager::RootScrollLayerTotalScrollY() {
- LayerImpl* layer = RootScrollLayer();
- if (!layer)
- return 0;
- gfx::Vector2dF scroll_total = layer->scrollOffset() + layer->scrollDelta();
- return scroll_total.y();
+ return client_->rootScrollLayerTotalScrollY();
}
void TopControlsManager::SetupAnimation(bool show_controls) {
diff --git a/cc/top_controls_manager.h b/cc/top_controls_manager.h
index 5cfbf02..4ab423b 100644
--- a/cc/top_controls_manager.h
+++ b/cc/top_controls_manager.h
@@ -50,7 +50,6 @@ class CC_EXPORT TopControlsManager {
private:
gfx::Vector2dF ScrollInternal(const gfx::Vector2dF pending_delta);
void ResetAnimations();
- LayerImpl* RootScrollLayer();
float RootScrollLayerTotalScrollY();
void SetupAnimation(bool show_controls);
void StartAnimationIfNecessary();
diff --git a/cc/top_controls_manager_client.h b/cc/top_controls_manager_client.h
index f5a34f3..eb216f5 100644
--- a/cc/top_controls_manager_client.h
+++ b/cc/top_controls_manager_client.h
@@ -13,7 +13,8 @@ class CC_EXPORT TopControlsManagerClient {
public:
virtual void setNeedsRedraw() = 0;
virtual void setNeedsUpdateDrawProperties() = 0;
- virtual LayerTreeImpl* activeTree() = 0;
+ virtual bool haveRootScrollLayer() const = 0;
+ virtual float rootScrollLayerTotalScrollY() const = 0;
protected:
virtual ~TopControlsManagerClient() {}
diff --git a/cc/top_controls_manager_unittest.cc b/cc/top_controls_manager_unittest.cc
index d081042..79274c9 100644
--- a/cc/top_controls_manager_unittest.cc
+++ b/cc/top_controls_manager_unittest.cc
@@ -27,7 +27,6 @@ class MockTopControlsManagerClient : public TopControlsManagerClient {
update_draw_properties_needed_(false) {
active_tree_ = LayerTreeImpl::create(&host_impl_);
root_scroll_layer_ = LayerImpl::create(active_tree_.get(), 1);
- active_tree_->set_root_scroll_layer(root_scroll_layer_.get());
}
virtual ~MockTopControlsManagerClient() {}
@@ -40,20 +39,25 @@ class MockTopControlsManagerClient : public TopControlsManagerClient {
update_draw_properties_needed_ = true;
}
- virtual LayerTreeImpl* activeTree() OVERRIDE {
- return active_tree_.get();
+ virtual bool haveRootScrollLayer() const OVERRIDE {
+ return true;
}
- TopControlsManager* manager() {
- if (!manager_)
- manager_ = TopControlsManager::Create(this, kTopControlsHeight);
- return manager_.get();
+ virtual float rootScrollLayerTotalScrollY() const OVERRIDE {
+ return root_scroll_layer_->scrollOffset().y() +
+ root_scroll_layer_->scrollDelta().y();
}
LayerImpl* rootScrollLayer() {
return root_scroll_layer_.get();
}
+ TopControlsManager* manager() {
+ if (!manager_)
+ manager_ = TopControlsManager::Create(this, kTopControlsHeight);
+ return manager_.get();
+ }
+
private:
FakeImplProxy proxy_;
FakeLayerTreeHostImpl host_impl_;