| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/scroll_elasticity_helper.h" | 5 #include "cc/input/scroll_elasticity_helper.h" |
| 6 | 6 |
| 7 #include "cc/layers/layer_impl.h" | 7 #include "cc/layers/layer_impl.h" |
| 8 #include "cc/trees/layer_tree_host_impl.h" | 8 #include "cc/trees/layer_tree_host_impl.h" |
| 9 #include "cc/trees/layer_tree_impl.h" | 9 #include "cc/trees/layer_tree_impl.h" |
| 10 | 10 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 void ScrollElasticityHelperImpl::SetStretchAmount( | 51 void ScrollElasticityHelperImpl::SetStretchAmount( |
| 52 const gfx::Vector2dF& stretch_amount) { | 52 const gfx::Vector2dF& stretch_amount) { |
| 53 if (stretch_amount == StretchAmount()) | 53 if (stretch_amount == StretchAmount()) |
| 54 return; | 54 return; |
| 55 | 55 |
| 56 layer_tree_host_impl_->active_tree()->elastic_overscroll()->SetCurrent( | 56 layer_tree_host_impl_->active_tree()->elastic_overscroll()->SetCurrent( |
| 57 stretch_amount); | 57 stretch_amount); |
| 58 layer_tree_host_impl_->active_tree()->set_needs_update_draw_properties(); | 58 layer_tree_host_impl_->active_tree()->set_needs_update_draw_properties(); |
| 59 layer_tree_host_impl_->SetNeedsCommit(); | 59 layer_tree_host_impl_->SetNeedsCommit(); |
| 60 layer_tree_host_impl_->SetNeedsRedraw(); | 60 layer_tree_host_impl_->SetNeedsRedraw(); |
| 61 layer_tree_host_impl_->SetFullRootLayerDamage(); | 61 layer_tree_host_impl_->SetFullViewportDamage(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 gfx::ScrollOffset ScrollElasticityHelperImpl::ScrollOffset() const { | 64 gfx::ScrollOffset ScrollElasticityHelperImpl::ScrollOffset() const { |
| 65 return layer_tree_host_impl_->active_tree()->TotalScrollOffset(); | 65 return layer_tree_host_impl_->active_tree()->TotalScrollOffset(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 gfx::ScrollOffset ScrollElasticityHelperImpl::MaxScrollOffset() const { | 68 gfx::ScrollOffset ScrollElasticityHelperImpl::MaxScrollOffset() const { |
| 69 return layer_tree_host_impl_->active_tree()->TotalMaxScrollOffset(); | 69 return layer_tree_host_impl_->active_tree()->TotalMaxScrollOffset(); |
| 70 } | 70 } |
| 71 | 71 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 82 layer_tree_host_impl_->SetNeedsOneBeginImplFrame(); | 82 layer_tree_host_impl_->SetNeedsOneBeginImplFrame(); |
| 83 } | 83 } |
| 84 | 84 |
| 85 // static | 85 // static |
| 86 ScrollElasticityHelper* ScrollElasticityHelper::CreateForLayerTreeHostImpl( | 86 ScrollElasticityHelper* ScrollElasticityHelper::CreateForLayerTreeHostImpl( |
| 87 LayerTreeHostImpl* layer_tree_host_impl) { | 87 LayerTreeHostImpl* layer_tree_host_impl) { |
| 88 return new ScrollElasticityHelperImpl(layer_tree_host_impl); | 88 return new ScrollElasticityHelperImpl(layer_tree_host_impl); |
| 89 } | 89 } |
| 90 | 90 |
| 91 } // namespace cc | 91 } // namespace cc |
| OLD | NEW |