Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(752)

Side by Side Diff: cc/input/scrollbar_animation_controller_linear_fade.cc

Issue 2273933002: cc : Delete LayerImpl::OnOpacityAnimated (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | cc/input/scrollbar_animation_controller_linear_fade_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/input/scrollbar_animation_controller_linear_fade.h" 5 #include "cc/input/scrollbar_animation_controller_linear_fade.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "cc/layers/layer_impl.h" 9 #include "cc/layers/layer_impl.h"
10 #include "cc/layers/scrollbar_layer_impl_base.h" 10 #include "cc/layers/scrollbar_layer_impl_base.h"
11 #include "cc/trees/layer_tree_impl.h"
11 12
12 namespace cc { 13 namespace cc {
13 14
14 std::unique_ptr<ScrollbarAnimationControllerLinearFade> 15 std::unique_ptr<ScrollbarAnimationControllerLinearFade>
15 ScrollbarAnimationControllerLinearFade::Create( 16 ScrollbarAnimationControllerLinearFade::Create(
16 int scroll_layer_id, 17 int scroll_layer_id,
17 ScrollbarAnimationControllerClient* client, 18 ScrollbarAnimationControllerClient* client,
18 base::TimeDelta delay_before_starting, 19 base::TimeDelta delay_before_starting,
19 base::TimeDelta resize_delay_before_starting, 20 base::TimeDelta resize_delay_before_starting,
20 base::TimeDelta duration) { 21 base::TimeDelta duration) {
(...skipping 27 matching lines...) Expand all
48 void ScrollbarAnimationControllerLinearFade::DidScrollUpdate(bool on_resize) { 49 void ScrollbarAnimationControllerLinearFade::DidScrollUpdate(bool on_resize) {
49 ScrollbarAnimationController::DidScrollUpdate(on_resize); 50 ScrollbarAnimationController::DidScrollUpdate(on_resize);
50 ApplyOpacityToScrollbars(1.f); 51 ApplyOpacityToScrollbars(1.f);
51 } 52 }
52 53
53 void ScrollbarAnimationControllerLinearFade::ApplyOpacityToScrollbars( 54 void ScrollbarAnimationControllerLinearFade::ApplyOpacityToScrollbars(
54 float opacity) { 55 float opacity) {
55 for (ScrollbarLayerImplBase* scrollbar : Scrollbars()) { 56 for (ScrollbarLayerImplBase* scrollbar : Scrollbars()) {
56 if (!scrollbar->is_overlay_scrollbar()) 57 if (!scrollbar->is_overlay_scrollbar())
57 continue; 58 continue;
58 scrollbar->OnOpacityAnimated(scrollbar->CanScrollOrientation() ? opacity 59 PropertyTrees* property_trees =
59 : 0); 60 scrollbar->layer_tree_impl()->property_trees();
61 // If this method is called during LayerImpl::PushPropertiesTo, we may not
62 // yet have valid effect_id_to_index_map entries as property trees are
63 // pushed after layers during activation. We can skip updating opacity in
64 // that case as we are only registering a scrollbar and because opacity will
65 // be overwritten anyway when property trees are pushed.
66 if (property_trees->IsInIdToIndexMap(PropertyTrees::TreeType::EFFECT,
67 scrollbar->id())) {
68 property_trees->effect_tree.OnOpacityAnimated(
69 scrollbar->CanScrollOrientation() ? opacity : 0,
70 property_trees->effect_id_to_index_map[scrollbar->id()],
71 scrollbar->layer_tree_impl());
72 }
60 } 73 }
61 } 74 }
62 75
63 } // namespace cc 76 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/input/scrollbar_animation_controller_linear_fade_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698