OLD | NEW |
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/layers/layer_impl.h" | 5 #include "cc/layers/layer_impl.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/debug/trace_event_argument.h" | 8 #include "base/debug/trace_event_argument.h" |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 1316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1327 scrollbar_needs_animation |= | 1327 scrollbar_needs_animation |= |
1328 scrollbar_layer->SetVisibleToTotalLengthRatio(visible_ratio); | 1328 scrollbar_layer->SetVisibleToTotalLengthRatio(visible_ratio); |
1329 } | 1329 } |
1330 if (scrollbar_needs_animation) { | 1330 if (scrollbar_needs_animation) { |
1331 layer_tree_impl()->set_needs_update_draw_properties(); | 1331 layer_tree_impl()->set_needs_update_draw_properties(); |
1332 // TODO(wjmaclean) The scrollbar animator for the pinch-zoom scrollbars | 1332 // TODO(wjmaclean) The scrollbar animator for the pinch-zoom scrollbars |
1333 // should activate for every scroll on the main frame, not just the | 1333 // should activate for every scroll on the main frame, not just the |
1334 // scrolls that move the pinch virtual viewport (i.e. trigger from | 1334 // scrolls that move the pinch virtual viewport (i.e. trigger from |
1335 // either inner or outer viewport). | 1335 // either inner or outer viewport). |
1336 if (scrollbar_animation_controller_) { | 1336 if (scrollbar_animation_controller_) { |
1337 // When both non-overlay and overlay scrollbars are both present, don't | 1337 // Non-overlay scrollbars shouldn't trigger animations. |
1338 // animate the overlay scrollbars when page scale factor is at the min. | 1338 if (scrollbar_layer->is_overlay_scrollbar()) |
1339 // Non-overlay scrollbars also shouldn't trigger animations. | |
1340 bool is_animatable_scrollbar = | |
1341 scrollbar_layer->is_overlay_scrollbar() && | |
1342 ((layer_tree_impl()->current_page_scale_factor() > | |
1343 layer_tree_impl()->min_page_scale_factor()) || | |
1344 !layer_tree_impl()->settings().use_pinch_zoom_scrollbars); | |
1345 if (is_animatable_scrollbar) | |
1346 scrollbar_animation_controller_->DidScrollUpdate(on_resize); | 1339 scrollbar_animation_controller_->DidScrollUpdate(on_resize); |
1347 } | 1340 } |
1348 } | 1341 } |
1349 } | 1342 } |
1350 | 1343 |
1351 void LayerImpl::DidBecomeActive() { | 1344 void LayerImpl::DidBecomeActive() { |
1352 if (layer_tree_impl_->settings().scrollbar_animator == | 1345 if (layer_tree_impl_->settings().scrollbar_animator == |
1353 LayerTreeSettings::NoAnimator) { | 1346 LayerTreeSettings::NoAnimator) { |
1354 return; | 1347 return; |
1355 } | 1348 } |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1584 SetNeedsPushProperties(); | 1577 SetNeedsPushProperties(); |
1585 layer_tree_impl()->set_needs_update_draw_properties(); | 1578 layer_tree_impl()->set_needs_update_draw_properties(); |
1586 if (should_have_render_surface) { | 1579 if (should_have_render_surface) { |
1587 render_surface_ = make_scoped_ptr(new RenderSurfaceImpl(this)); | 1580 render_surface_ = make_scoped_ptr(new RenderSurfaceImpl(this)); |
1588 return; | 1581 return; |
1589 } | 1582 } |
1590 render_surface_.reset(); | 1583 render_surface_.reset(); |
1591 } | 1584 } |
1592 | 1585 |
1593 } // namespace cc | 1586 } // namespace cc |
OLD | NEW |