summaryrefslogtreecommitdiffstats
path: root/cc/layers
diff options
context:
space:
mode:
authorvollick <vollick@chromium.org>2016-02-29 21:00:43 -0800
committerCommit bot <commit-bot@chromium.org>2016-03-01 05:01:47 +0000
commit299bf1f63b8253c77530b904874f3435f9bde6d3 (patch)
tree093621b8fc836d3aa87357b06b1976ec83569360 /cc/layers
parent84e53c857ee87964ca99b52cc892a407b56e2dca (diff)
downloadchromium_src-299bf1f63b8253c77530b904874f3435f9bde6d3.zip
chromium_src-299bf1f63b8253c77530b904874f3435f9bde6d3.tar.gz
chromium_src-299bf1f63b8253c77530b904874f3435f9bde6d3.tar.bz2
Introduce LayerListImpl
In this cl, the LayerTreeImpl constructs a LayerListImpl. The idea being that most plumbing won't need to change at first to get the list to where it needs to be. The first consumer of the LayerTreeImpl that I'm attempting to teach to speak LayerListImpl-ese is the LayerImpl. That has not been completely finished in this cl so that it doesn't become too big and difficult to review. NB: since the actual storage of the LayerImpls doesn't change in this cl (they're still in the LayerTreeImpl), there's no need to guard this work behind a flag. BUG=557194 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1746603002 Cr-Commit-Position: refs/heads/master@{#378398}
Diffstat (limited to 'cc/layers')
-rw-r--r--cc/layers/layer.cc10
-rw-r--r--cc/layers/layer_impl.cc49
-rw-r--r--cc/layers/layer_impl.h2
-rw-r--r--cc/layers/layer_list_host_impl.h10
-rw-r--r--cc/layers/layer_list_impl.cc118
-rw-r--r--cc/layers/layer_list_impl.h81
-rw-r--r--cc/layers/layer_position_constraint_unittest.cc7
-rw-r--r--cc/layers/layer_utils.cc2
-rw-r--r--cc/layers/picture_layer_impl_perftest.cc2
-rw-r--r--cc/layers/picture_layer_impl_unittest.cc8
-rw-r--r--cc/layers/scrollbar_layer_impl_base.cc3
11 files changed, 251 insertions, 41 deletions
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index 3842741..1441ccd 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -1289,7 +1289,8 @@ void Layer::PushPropertiesTo(LayerImpl* layer) {
LayerImpl* scroll_parent = nullptr;
if (scroll_parent_) {
- scroll_parent = layer->layer_tree_impl()->LayerById(scroll_parent_->id());
+ scroll_parent =
+ layer->layer_tree_impl()->list()->LayerById(scroll_parent_->id());
DCHECK(scroll_parent);
}
@@ -1301,7 +1302,7 @@ void Layer::PushPropertiesTo(LayerImpl* layer) {
++it) {
DCHECK_EQ((*it)->scroll_parent(), this);
LayerImpl* scroll_child =
- layer->layer_tree_impl()->LayerById((*it)->id());
+ layer->layer_tree_impl()->list()->LayerById((*it)->id());
DCHECK(scroll_child);
scroll_children->insert(scroll_child);
}
@@ -1313,7 +1314,7 @@ void Layer::PushPropertiesTo(LayerImpl* layer) {
LayerImpl* clip_parent = nullptr;
if (clip_parent_) {
clip_parent =
- layer->layer_tree_impl()->LayerById(clip_parent_->id());
+ layer->layer_tree_impl()->list()->LayerById(clip_parent_->id());
DCHECK(clip_parent);
}
@@ -1323,7 +1324,8 @@ void Layer::PushPropertiesTo(LayerImpl* layer) {
for (std::set<Layer*>::iterator it = clip_children_->begin();
it != clip_children_->end(); ++it) {
DCHECK_EQ((*it)->clip_parent(), this);
- LayerImpl* clip_child = layer->layer_tree_impl()->LayerById((*it)->id());
+ LayerImpl* clip_child =
+ layer->layer_tree_impl()->list()->LayerById((*it)->id());
DCHECK(clip_child);
clip_children->insert(clip_child);
}
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index ae14d9c..3f14de8 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -56,6 +56,7 @@ LayerImpl::LayerImpl(LayerTreeImpl* tree_impl,
replica_layer_id_(-1),
layer_id_(id),
layer_tree_impl_(tree_impl),
+ layer_list_impl_(tree_impl->list()),
scroll_offset_(scroll_offset),
scroll_clip_layer_id_(Layer::INVALID_ID),
main_thread_scrolling_reasons_(
@@ -102,11 +103,10 @@ LayerImpl::LayerImpl(LayerTreeImpl* tree_impl,
layer_or_descendant_has_touch_handler_(false),
sorted_for_recursion_(false) {
DCHECK_GT(layer_id_, 0);
- DCHECK(layer_tree_impl_);
- layer_tree_impl_->RegisterLayer(this);
+ layer_list_impl_->RegisterLayer(this);
if (!layer_tree_impl_->settings().use_compositor_animation_timelines) {
- AnimationRegistrar* registrar = layer_tree_impl_->GetAnimationRegistrar();
+ AnimationRegistrar* registrar = layer_list_impl_->GetAnimationRegistrar();
layer_animation_controller_ =
registrar->GetAnimationControllerForId(layer_id_);
layer_animation_controller_->AddValueObserver(this);
@@ -116,7 +116,7 @@ LayerImpl::LayerImpl(LayerTreeImpl* tree_impl,
}
}
- layer_tree_impl_->AddToElementMap(this);
+ layer_list_impl_->AddToElementMap(this);
SetNeedsPushProperties();
}
@@ -133,9 +133,9 @@ LayerImpl::~LayerImpl() {
if (!copy_requests_.empty() && layer_tree_impl_->IsActiveTree())
layer_tree_impl()->RemoveLayerWithCopyOutputRequest(this);
layer_tree_impl_->UnregisterScrollLayer(this);
- layer_tree_impl_->UnregisterLayer(this);
+ layer_list_impl_->UnregisterLayer(this);
- layer_tree_impl_->RemoveFromElementMap(this);
+ layer_list_impl_->RemoveFromElementMap(this);
TRACE_EVENT_OBJECT_DELETED_WITH_ID(
TRACE_DISABLED_BY_DEFAULT("cc.debug"), "cc::LayerImpl", this);
@@ -197,7 +197,7 @@ void LayerImpl::SetScrollParent(LayerImpl* parent) {
return;
if (parent)
- DCHECK_EQ(layer_tree_impl()->LayerById(parent->id()), parent);
+ DCHECK_EQ(layer_list_impl_->LayerById(parent->id()), parent);
scroll_parent_ = parent;
SetNeedsPushProperties();
@@ -470,13 +470,13 @@ void LayerImpl::SetScrollClipLayer(int scroll_clip_layer_id) {
if (scroll_clip_layer_id_ == scroll_clip_layer_id)
return;
- layer_tree_impl()->UnregisterScrollLayer(this);
+ layer_tree_impl_->UnregisterScrollLayer(this);
scroll_clip_layer_id_ = scroll_clip_layer_id;
- layer_tree_impl()->RegisterScrollLayer(this);
+ layer_tree_impl_->RegisterScrollLayer(this);
}
LayerImpl* LayerImpl::scroll_clip_layer() const {
- return layer_tree_impl()->LayerById(scroll_clip_layer_id_);
+ return layer_list_impl_->LayerById(scroll_clip_layer_id_);
}
bool LayerImpl::scrollable() const {
@@ -563,7 +563,7 @@ void LayerImpl::PushPropertiesTo(LayerImpl* layer) {
LayerImpl* scroll_parent = nullptr;
if (scroll_parent_) {
- scroll_parent = layer->layer_tree_impl()->LayerById(scroll_parent_->id());
+ scroll_parent = layer->layer_list_impl_->LayerById(scroll_parent_->id());
DCHECK(scroll_parent);
}
@@ -574,8 +574,7 @@ void LayerImpl::PushPropertiesTo(LayerImpl* layer) {
it != scroll_children_->end();
++it) {
DCHECK_EQ((*it)->scroll_parent(), this);
- LayerImpl* scroll_child =
- layer->layer_tree_impl()->LayerById((*it)->id());
+ LayerImpl* scroll_child = layer->layer_list_impl_->LayerById((*it)->id());
DCHECK(scroll_child);
scroll_children->insert(scroll_child);
}
@@ -586,8 +585,7 @@ void LayerImpl::PushPropertiesTo(LayerImpl* layer) {
LayerImpl* clip_parent = nullptr;
if (clip_parent_) {
- clip_parent = layer->layer_tree_impl()->LayerById(
- clip_parent_->id());
+ clip_parent = layer->layer_list_impl_->LayerById(clip_parent_->id());
DCHECK(clip_parent);
}
@@ -596,7 +594,7 @@ void LayerImpl::PushPropertiesTo(LayerImpl* layer) {
std::set<LayerImpl*>* clip_children = new std::set<LayerImpl*>;
for (std::set<LayerImpl*>::iterator it = clip_children_->begin();
it != clip_children_->end(); ++it)
- clip_children->insert(layer->layer_tree_impl()->LayerById((*it)->id()));
+ clip_children->insert(layer->layer_list_impl_->LayerById((*it)->id()));
layer->SetClipChildren(clip_children);
} else {
layer->SetClipChildren(nullptr);
@@ -635,7 +633,7 @@ bool LayerImpl::IsAffectedByPageScale() const {
gfx::Vector2dF LayerImpl::FixedContainerSizeDelta() const {
LayerImpl* scroll_clip_layer =
- layer_tree_impl()->LayerById(scroll_clip_layer_id_);
+ layer_list_impl_->LayerById(scroll_clip_layer_id_);
if (!scroll_clip_layer)
return gfx::Vector2dF();
@@ -1212,9 +1210,9 @@ void LayerImpl::SetElementId(uint64_t element_id) {
TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("compositor-worker"),
"LayerImpl::SetElementId", "id", element_id);
- layer_tree_impl_->RemoveFromElementMap(this);
+ layer_list_impl_->RemoveFromElementMap(this);
element_id_ = element_id;
- layer_tree_impl_->AddToElementMap(this);
+ layer_list_impl_->AddToElementMap(this);
SetNeedsPushProperties();
}
@@ -1227,7 +1225,7 @@ void LayerImpl::SetMutableProperties(uint32_t properties) {
mutable_properties_ = properties;
// If this layer is already in the element map, update its properties.
- layer_tree_impl_->AddToElementMap(this);
+ layer_list_impl_->AddToElementMap(this);
SetNeedsPushProperties();
}
@@ -1486,7 +1484,7 @@ void LayerImpl::PushScrollOffset(const gfx::ScrollOffset* scroll_offset) {
DCHECK(scroll_offset || IsActive());
bool changed = false;
if (scroll_offset) {
- DCHECK(!IsActive() || !layer_tree_impl_->FindPendingTreeLayerById(id()));
+ DCHECK(!IsActive() || !layer_list_impl_->FindPendingLayerById(id()));
changed |= scroll_offset_->PushFromMainThread(*scroll_offset);
}
if (IsActive()) {
@@ -1523,7 +1521,7 @@ void LayerImpl::DidUpdateScrollOffset() {
// Inform the pending twin that a property changed.
if (layer_tree_impl()->IsActiveTree()) {
- LayerImpl* pending_twin = layer_tree_impl()->FindPendingTreeLayerById(id());
+ LayerImpl* pending_twin = layer_list_impl_->FindPendingLayerById(id());
if (pending_twin)
pending_twin->DidUpdateScrollOffset();
}
@@ -1601,11 +1599,8 @@ void LayerImpl::GetAllPrioritizedTilesForTracing(
void LayerImpl::AsValueInto(base::trace_event::TracedValue* state) const {
TracedValue::MakeDictIntoImplicitSnapshotWithCategory(
- TRACE_DISABLED_BY_DEFAULT("cc.debug"),
- state,
- "cc::LayerImpl",
- LayerTypeAsString(),
- this);
+ TRACE_DISABLED_BY_DEFAULT("cc.debug"), state, "cc::LayerImpl",
+ LayerTypeAsString(), this);
state->SetInteger("layer_id", id());
MathUtil::AddToTracedValue("bounds", bounds_, state);
diff --git a/cc/layers/layer_impl.h b/cc/layers/layer_impl.h
index 40bf810..c36dd9e0 100644
--- a/cc/layers/layer_impl.h
+++ b/cc/layers/layer_impl.h
@@ -27,6 +27,7 @@
#include "cc/debug/frame_timing_request.h"
#include "cc/input/input_handler.h"
#include "cc/layers/draw_properties.h"
+#include "cc/layers/layer_list_impl.h"
#include "cc/layers/layer_lists.h"
#include "cc/layers/layer_position_constraint.h"
#include "cc/layers/performance_properties.h"
@@ -747,6 +748,7 @@ class CC_EXPORT LayerImpl : public LayerAnimationValueObserver,
scoped_ptr<LayerImpl> replica_layer_;
int layer_id_;
LayerTreeImpl* layer_tree_impl_;
+ LayerListImpl* layer_list_impl_;
// Properties dynamically changeable on active tree.
scoped_refptr<SyncedScrollOffset> scroll_offset_;
diff --git a/cc/layers/layer_list_host_impl.h b/cc/layers/layer_list_host_impl.h
new file mode 100644
index 0000000..905c3e3
--- /dev/null
+++ b/cc/layers/layer_list_host_impl.h
@@ -0,0 +1,10 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_LAYERS_LAYER_LIST_HOST_IMPL_H_
+#define CC_LAYERS_LAYER_LIST_HOST_IMPL_H_
+
+#include "cc/trees/layer_tree_host_impl.h"
+
+#endif // CC_LAYERS_LAYER_LIST_HOST_IMPL_H_
diff --git a/cc/layers/layer_list_impl.cc b/cc/layers/layer_list_impl.cc
new file mode 100644
index 0000000..8748f0fe
--- /dev/null
+++ b/cc/layers/layer_list_impl.cc
@@ -0,0 +1,118 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "cc/layers/layer_list_impl.h"
+
+#include "base/trace_event/trace_event.h"
+#include "base/trace_event/trace_event_argument.h"
+#include "cc/animation/animation_host.h"
+#include "cc/layers/layer_impl.h"
+#include "cc/layers/layer_list_host_impl.h"
+
+namespace cc {
+
+LayerListImpl::LayerListImpl(LayerListHostImpl* host_impl)
+ : layer_list_host_(host_impl) {}
+
+LayerListImpl::~LayerListImpl() {}
+
+AnimationRegistrar* LayerListImpl::GetAnimationRegistrar() const {
+ return layer_list_host_->animation_registrar();
+}
+
+LayerImpl* LayerListImpl::LayerById(int id) const {
+ LayerIdMap::const_iterator iter = layer_id_map_.find(id);
+ return iter != layer_id_map_.end() ? iter->second : NULL;
+}
+
+void LayerListImpl::RegisterLayer(LayerImpl* layer) {
+ DCHECK(!LayerById(layer->id()));
+ layer_id_map_[layer->id()] = layer;
+ if (layer_list_host_->animation_host())
+ layer_list_host_->animation_host()->RegisterLayer(
+ layer->id(),
+ IsActiveList() ? LayerListType::ACTIVE : LayerListType::PENDING);
+}
+
+void LayerListImpl::UnregisterLayer(LayerImpl* layer) {
+ DCHECK(LayerById(layer->id()));
+ if (layer_list_host_->animation_host())
+ layer_list_host_->animation_host()->UnregisterLayer(
+ layer->id(),
+ IsActiveList() ? LayerListType::ACTIVE : LayerListType::PENDING);
+ layer_id_map_.erase(layer->id());
+}
+
+size_t LayerListImpl::NumLayers() {
+ return layer_id_map_.size();
+}
+
+LayerImpl* LayerListImpl::FindActiveLayerById(int id) {
+ LayerListImpl* list = layer_list_host_->active_list();
+ if (!list)
+ return nullptr;
+ return list->LayerById(id);
+}
+
+LayerImpl* LayerListImpl::FindPendingLayerById(int id) {
+ LayerListImpl* list = layer_list_host_->pending_list();
+ if (!list)
+ return nullptr;
+ return list->LayerById(id);
+}
+
+void LayerListImpl::AddToElementMap(LayerImpl* layer) {
+ if (!layer->element_id() || !layer->mutable_properties())
+ return;
+
+ TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("compositor-worker"),
+ "LayerListImpl::AddToElementMap", "element_id",
+ layer->element_id(), "layer_id", layer->id());
+
+ ElementLayers& layers = element_layers_map_[layer->element_id()];
+ if ((!layers.main || layer->IsActive()) && !layer->scrollable()) {
+ layers.main = layer;
+ } else if ((!layers.scroll || layer->IsActive()) && layer->scrollable()) {
+ TRACE_EVENT2("compositor-worker", "LayerListImpl::AddToElementMap scroll",
+ "element_id", layer->element_id(), "layer_id", layer->id());
+ layers.scroll = layer;
+ }
+}
+
+void LayerListImpl::RemoveFromElementMap(LayerImpl* layer) {
+ if (!layer->element_id())
+ return;
+
+ TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("compositor-worker"),
+ "LayerListImpl::RemoveFromElementMap", "element_id",
+ layer->element_id(), "layer_id", layer->id());
+
+ ElementLayers& layers = element_layers_map_[layer->element_id()];
+ if (!layer->scrollable())
+ layers.main = nullptr;
+ if (layer->scrollable())
+ layers.scroll = nullptr;
+
+ if (!layers.main && !layers.scroll)
+ element_layers_map_.erase(layer->element_id());
+}
+
+LayerListImpl::ElementLayers LayerListImpl::GetMutableLayers(
+ uint64_t element_id) {
+ auto iter = element_layers_map_.find(element_id);
+ if (iter == element_layers_map_.end())
+ return ElementLayers();
+
+ return iter->second;
+}
+
+bool LayerListImpl::IsActiveList() const {
+ return layer_list_host_->active_list() == this;
+}
+
+bool LayerListImpl::IsPendingList() const {
+ return layer_list_host_->pending_list() == this;
+}
+
+} // namespace cc
diff --git a/cc/layers/layer_list_impl.h b/cc/layers/layer_list_impl.h
new file mode 100644
index 0000000..befe59e
--- /dev/null
+++ b/cc/layers/layer_list_impl.h
@@ -0,0 +1,81 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_LAYERS_LAYER_LIST_IMPL_H_
+#define CC_LAYERS_LAYER_LIST_IMPL_H_
+
+#include <stdint.h>
+#include <unordered_map>
+
+#include "cc/base/cc_export.h"
+#include "cc/layers/layer_lists.h"
+
+namespace cc {
+class AnimationRegistrar;
+class LayerTreeHostImpl;
+typedef LayerTreeHostImpl LayerListHostImpl;
+
+// This class will eventually replace LayerTreeImpl.
+//
+// There is certainly some unfortunate ambiguity with LayerImplList and
+// OwnedLayerImplList, but this should be temporary. OwnedLayerImplList is used
+// solely for the children of a LayerImpl and this will cease to be a thing as
+// we move away from the layer hierarchy. The LayerImplList, however, does get
+// used a fair bit to describe a list of LayerImpl*'s. I.e., an unowned layer
+// list. In the medium term, I'd like to rename this LayerImplPtrList and, in
+// the fullness of time, a LayerPtrList once Layer disappears.
+class CC_EXPORT LayerListImpl {
+ public:
+ explicit LayerListImpl(LayerListHostImpl* host_impl);
+ ~LayerListImpl();
+
+ AnimationRegistrar* GetAnimationRegistrar() const;
+
+ LayerImpl* LayerById(int id) const;
+
+ // These should be called by LayerImpl's ctor/dtor.
+ void RegisterLayer(LayerImpl* layer);
+ void UnregisterLayer(LayerImpl* layer);
+
+ size_t NumLayers();
+
+ LayerImpl* FindActiveLayerById(int id);
+ LayerImpl* FindPendingLayerById(int id);
+
+ // TODO(vollick): once we've built compositor worker on top of animations,
+ // then this association of id to element layers will not be necessary. The
+ // association will instead be maintained via the animation.
+ void AddToElementMap(LayerImpl* layer);
+ void RemoveFromElementMap(LayerImpl* layer);
+
+ // TODO(thakis): Consider marking this CC_EXPORT once we understand
+ // http://crbug.com/575700 better.
+ struct ElementLayers {
+ // Transform and opacity mutations apply to this layer.
+ LayerImpl* main = nullptr;
+ // Scroll mutations apply to this layer.
+ LayerImpl* scroll = nullptr;
+ };
+
+ // TODO(vollick): this should be removed as well.
+ ElementLayers GetMutableLayers(uint64_t element_id);
+
+ private:
+ bool IsActiveList() const;
+ bool IsPendingList() const;
+
+ // TODO(vollick): Remove after compositor worker is built on animations.
+ using ElementLayersMap = std::unordered_map<uint64_t, ElementLayers>;
+ ElementLayersMap element_layers_map_;
+
+ using LayerIdMap = std::unordered_map<int, LayerImpl*>;
+ LayerIdMap layer_id_map_;
+
+ LayerListHostImpl* layer_list_host_;
+ scoped_ptr<OwnedLayerImplList> layer_;
+};
+
+} // namespace cc
+
+#endif // CC_LAYERS_LAYER_LIST_IMPL_H_
diff --git a/cc/layers/layer_position_constraint_unittest.cc b/cc/layers/layer_position_constraint_unittest.cc
index 490ce8e..c603197 100644
--- a/cc/layers/layer_position_constraint_unittest.cc
+++ b/cc/layers/layer_position_constraint_unittest.cc
@@ -1095,7 +1095,8 @@ TEST_F(LayerPositionConstraintTest,
CommitAndUpdateImplPointers();
LayerImpl* fixed_child_impl =
- root_impl_->layer_tree_impl()->FindActiveTreeLayerById(fixed_child->id());
+ root_impl_->layer_tree_impl()->list()->FindActiveLayerById(
+ fixed_child->id());
// Case 1: fixed-container size delta of 20, 20
scroll_layer_impl_->SetScrollDelta(gfx::Vector2d(10, 10));
@@ -1116,8 +1117,8 @@ TEST_F(LayerPositionConstraintTest,
// Case 2: Bottom-right fixed-position layer.
fixed_child->SetPositionConstraint(fixed_to_bottom_right_);
CommitAndUpdateImplPointers();
- fixed_child_impl =
- root_impl_->layer_tree_impl()->FindActiveTreeLayerById(fixed_child->id());
+ fixed_child_impl = root_impl_->layer_tree_impl()->list()->FindActiveLayerById(
+ fixed_child->id());
scroll_layer_impl_->SetScrollDelta(gfx::Vector2d(10, 10));
SetFixedContainerSizeDelta(scroll_layer_impl_, gfx::Vector2d(20, 20));
diff --git a/cc/layers/layer_utils.cc b/cc/layers/layer_utils.cc
index 0289e2a..6b1873e 100644
--- a/cc/layers/layer_utils.cc
+++ b/cc/layers/layer_utils.cc
@@ -86,7 +86,7 @@ bool LayerUtils::GetAnimationBounds(const LayerImpl& layer_in, gfx::BoxF* out) {
for (; transform_tree.parent(transform_node);
transform_node = transform_tree.parent(transform_node)) {
LayerImpl* layer =
- layer_in.layer_tree_impl()->LayerById(transform_node->owner_id);
+ layer_in.layer_tree_impl()->list()->LayerById(transform_node->owner_id);
// Filter animation bounds are unimplemented, see function
// HasAncestorFilterAnimation() for reference.
diff --git a/cc/layers/picture_layer_impl_perftest.cc b/cc/layers/picture_layer_impl_perftest.cc
index c38dd3e..c5d947d 100644
--- a/cc/layers/picture_layer_impl_perftest.cc
+++ b/cc/layers/picture_layer_impl_perftest.cc
@@ -72,7 +72,7 @@ class PictureLayerImplPerfTest : public testing::Test {
pending_tree->BuildPropertyTreesForTesting();
pending_layer_ = static_cast<FakePictureLayerImpl*>(
- host_impl_.pending_tree()->LayerById(7));
+ host_impl_.pending_tree()->list()->LayerById(7));
}
void RunRasterQueueConstructAndIterateTest(const std::string& test_name,
diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc
index f132b3f..c4230c2 100644
--- a/cc/layers/picture_layer_impl_unittest.cc
+++ b/cc/layers/picture_layer_impl_unittest.cc
@@ -155,7 +155,7 @@ class PictureLayerImplTest : public testing::Test {
old_pending_layer_ = pending_layer_;
pending_layer_ = nullptr;
active_layer_ = static_cast<FakePictureLayerImpl*>(
- host_impl_.active_tree()->LayerById(id_));
+ host_impl_.active_tree()->list()->LayerById(id_));
bool update_lcd_text = false;
host_impl_.active_tree()->UpdateDrawProperties(update_lcd_text);
@@ -258,7 +258,7 @@ class PictureLayerImplTest : public testing::Test {
Layer::INVALID_ID);
pending_layer_ = static_cast<FakePictureLayerImpl*>(
- host_impl_.pending_tree()->LayerById(id_));
+ host_impl_.pending_tree()->list()->LayerById(id_));
// Add tilings/tiles for the layer.
bool update_lcd_text = false;
@@ -2240,7 +2240,7 @@ TEST_F(PictureLayerImplTest, ActivateUninitializedLayer) {
pending_tree->SetRootLayer(std::move(pending_layer));
pending_layer_ = static_cast<FakePictureLayerImpl*>(
- host_impl_.pending_tree()->LayerById(id_));
+ host_impl_.pending_tree()->list()->LayerById(id_));
// Set some state on the pending layer, make sure it is not clobbered
// by a sync from the active layer. This could happen because if the
@@ -2252,7 +2252,7 @@ TEST_F(PictureLayerImplTest, ActivateUninitializedLayer) {
host_impl_.ActivateSyncTree();
active_layer_ = static_cast<FakePictureLayerImpl*>(
- host_impl_.active_tree()->LayerById(id_));
+ host_impl_.active_tree()->list()->LayerById(id_));
EXPECT_EQ(0u, active_layer_->num_tilings());
EXPECT_EQ(raster_page_scale, active_layer_->raster_page_scale());
diff --git a/cc/layers/scrollbar_layer_impl_base.cc b/cc/layers/scrollbar_layer_impl_base.cc
index e8e0f80..66e64a4 100644
--- a/cc/layers/scrollbar_layer_impl_base.cc
+++ b/cc/layers/scrollbar_layer_impl_base.cc
@@ -69,7 +69,8 @@ bool ScrollbarLayerImplBase::SetCurrentPos(float current_pos) {
}
bool ScrollbarLayerImplBase::CanScrollOrientation() const {
- LayerImpl* scroll_layer = layer_tree_impl()->LayerById(scroll_layer_id_);
+ LayerImpl* scroll_layer =
+ layer_tree_impl()->list()->LayerById(scroll_layer_id_);
if (!scroll_layer)
return false;
return scroll_layer->user_scrollable(orientation()) &&