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

Side by Side Diff: cc/trees/layer_tree_impl.cc

Issue 2442573002: Implement fade-out animation for Aura overlay scrollbars (CC only). (Closed)
Patch Set: Address aelias@'s feedback Created 4 years, 2 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 | « cc/input/scrollbar_animation_controller_thinning_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/trees/layer_tree_impl.h" 5 #include "cc/trees/layer_tree_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after
1355 const gfx::Rect LayerTreeImpl::ViewportRectForTilePriority() const { 1355 const gfx::Rect LayerTreeImpl::ViewportRectForTilePriority() const {
1356 return layer_tree_host_impl_->ViewportRectForTilePriority(); 1356 return layer_tree_host_impl_->ViewportRectForTilePriority();
1357 } 1357 }
1358 1358
1359 std::unique_ptr<ScrollbarAnimationController> 1359 std::unique_ptr<ScrollbarAnimationController>
1360 LayerTreeImpl::CreateScrollbarAnimationController(int scroll_layer_id) { 1360 LayerTreeImpl::CreateScrollbarAnimationController(int scroll_layer_id) {
1361 DCHECK(!settings().scrollbar_fade_delay.is_zero()); 1361 DCHECK(!settings().scrollbar_fade_delay.is_zero());
1362 DCHECK(!settings().scrollbar_fade_duration.is_zero()); 1362 DCHECK(!settings().scrollbar_fade_duration.is_zero());
1363 base::TimeDelta delay = settings().scrollbar_fade_delay; 1363 base::TimeDelta delay = settings().scrollbar_fade_delay;
1364 base::TimeDelta resize_delay = settings().scrollbar_fade_resize_delay; 1364 base::TimeDelta resize_delay = settings().scrollbar_fade_resize_delay;
1365 base::TimeDelta duration = settings().scrollbar_fade_duration; 1365 base::TimeDelta fade_duration = settings().scrollbar_fade_duration;
1366 switch (settings().scrollbar_animator) { 1366 switch (settings().scrollbar_animator) {
1367 case LayerTreeSettings::LINEAR_FADE: { 1367 case LayerTreeSettings::LINEAR_FADE: {
1368 return ScrollbarAnimationControllerLinearFade::Create( 1368 return ScrollbarAnimationControllerLinearFade::Create(
1369 scroll_layer_id, layer_tree_host_impl_, delay, resize_delay, 1369 scroll_layer_id, layer_tree_host_impl_, delay, resize_delay,
1370 duration); 1370 fade_duration);
1371 } 1371 }
1372 case LayerTreeSettings::THINNING: { 1372 case LayerTreeSettings::THINNING: {
1373 base::TimeDelta thinning_duration =
1374 settings().scrollbar_thinning_duration;
1373 return ScrollbarAnimationControllerThinning::Create( 1375 return ScrollbarAnimationControllerThinning::Create(
1374 scroll_layer_id, layer_tree_host_impl_, delay, resize_delay, 1376 scroll_layer_id, layer_tree_host_impl_, delay, resize_delay,
1375 duration); 1377 fade_duration, thinning_duration);
1376 } 1378 }
1377 case LayerTreeSettings::NO_ANIMATOR: 1379 case LayerTreeSettings::NO_ANIMATOR:
1378 NOTREACHED(); 1380 NOTREACHED();
1379 break; 1381 break;
1380 } 1382 }
1381 return nullptr; 1383 return nullptr;
1382 } 1384 }
1383 1385
1384 void LayerTreeImpl::DidAnimateScrollOffset() { 1386 void LayerTreeImpl::DidAnimateScrollOffset() {
1385 layer_tree_host_impl_->DidAnimateScrollOffset(); 1387 layer_tree_host_impl_->DidAnimateScrollOffset();
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
2073 2075
2074 void LayerTreeImpl::ResetAllChangeTracking() { 2076 void LayerTreeImpl::ResetAllChangeTracking() {
2075 layers_that_should_push_properties_.clear(); 2077 layers_that_should_push_properties_.clear();
2076 // Iterate over all layers, including masks. 2078 // Iterate over all layers, including masks.
2077 for (auto& layer : *layers_) 2079 for (auto& layer : *layers_)
2078 layer->ResetChangeTracking(); 2080 layer->ResetChangeTracking();
2079 property_trees_.ResetAllChangeTracking(); 2081 property_trees_.ResetAllChangeTracking();
2080 } 2082 }
2081 2083
2082 } // namespace cc 2084 } // namespace cc
OLDNEW
« no previous file with comments | « cc/input/scrollbar_animation_controller_thinning_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698