| Index: cc/input/scrollbar_animation_controller_linear_fade.cc
|
| diff --git a/cc/input/scrollbar_animation_controller_linear_fade.cc b/cc/input/scrollbar_animation_controller_linear_fade.cc
|
| index 8ead32491a3f9eebd4ccc55b1bdb3f77ab04cf89..8695bfaf6cf57b4199e3faec1a4ae539f50a0795 100644
|
| --- a/cc/input/scrollbar_animation_controller_linear_fade.cc
|
| +++ b/cc/input/scrollbar_animation_controller_linear_fade.cc
|
| @@ -8,6 +8,7 @@
|
| #include "base/time/time.h"
|
| #include "cc/layers/layer_impl.h"
|
| #include "cc/layers/scrollbar_layer_impl_base.h"
|
| +#include "cc/trees/layer_tree_impl.h"
|
|
|
| namespace cc {
|
|
|
| @@ -55,8 +56,20 @@ void ScrollbarAnimationControllerLinearFade::ApplyOpacityToScrollbars(
|
| for (ScrollbarLayerImplBase* scrollbar : Scrollbars()) {
|
| if (!scrollbar->is_overlay_scrollbar())
|
| continue;
|
| - scrollbar->OnOpacityAnimated(scrollbar->CanScrollOrientation() ? opacity
|
| - : 0);
|
| + PropertyTrees* property_trees =
|
| + scrollbar->layer_tree_impl()->property_trees();
|
| + // If this method is called during LayerImpl::PushPropertiesTo, we may not
|
| + // yet have valid effect_id_to_index_map entries as property trees are
|
| + // pushed after layers during activation. We can skip updating opacity in
|
| + // that case as we are only registering a scrollbar and because opacity will
|
| + // be overwritten anyway when property trees are pushed.
|
| + if (property_trees->IsInIdToIndexMap(PropertyTrees::TreeType::EFFECT,
|
| + scrollbar->id())) {
|
| + property_trees->effect_tree.OnOpacityAnimated(
|
| + scrollbar->CanScrollOrientation() ? opacity : 0,
|
| + property_trees->effect_id_to_index_map[scrollbar->id()],
|
| + scrollbar->layer_tree_impl());
|
| + }
|
| }
|
| }
|
|
|
|
|