| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ui/compositor/layer.h" | 5 #include "ui/compositor/layer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 } | 737 } |
| 738 | 738 |
| 739 void Layer::OnDelegatedFrameDamage(const gfx::Rect& damage_rect_in_dip) { | 739 void Layer::OnDelegatedFrameDamage(const gfx::Rect& damage_rect_in_dip) { |
| 740 DCHECK(surface_layer_.get()); | 740 DCHECK(surface_layer_.get()); |
| 741 if (delegate_) | 741 if (delegate_) |
| 742 delegate_->OnDelegatedFrameDamage(damage_rect_in_dip); | 742 delegate_->OnDelegatedFrameDamage(damage_rect_in_dip); |
| 743 } | 743 } |
| 744 | 744 |
| 745 void Layer::SetScrollable(Layer* parent_clip_layer, | 745 void Layer::SetScrollable(Layer* parent_clip_layer, |
| 746 const base::Closure& on_scroll) { | 746 const base::Closure& on_scroll) { |
| 747 cc_layer_->SetScrollClipLayerId(parent_clip_layer->cc_layer_->id()); | 747 cc_layer_->SetScrollClipAndCanOverscroll(parent_clip_layer->cc_layer_->id(), |
| 748 true /* can_overscroll */); |
| 748 cc_layer_->set_did_scroll_callback(on_scroll); | 749 cc_layer_->set_did_scroll_callback(on_scroll); |
| 749 cc_layer_->SetUserScrollable(true, true); | 750 cc_layer_->SetUserScrollable(true, true); |
| 750 } | 751 } |
| 751 | 752 |
| 752 gfx::ScrollOffset Layer::CurrentScrollOffset() const { | 753 gfx::ScrollOffset Layer::CurrentScrollOffset() const { |
| 753 const Compositor* compositor = GetCompositor(); | 754 const Compositor* compositor = GetCompositor(); |
| 754 gfx::ScrollOffset offset; | 755 gfx::ScrollOffset offset; |
| 755 if (compositor && | 756 if (compositor && |
| 756 compositor->GetScrollOffsetForLayer(cc_layer_->id(), &offset)) | 757 compositor->GetScrollOffsetForLayer(cc_layer_->id(), &offset)) |
| 757 return offset; | 758 return offset; |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1070 if (animator_) { | 1071 if (animator_) { |
| 1071 animator_->DetachLayerAndTimeline(compositor); | 1072 animator_->DetachLayerAndTimeline(compositor); |
| 1072 animator_->RemoveFromCollection(collection); | 1073 animator_->RemoveFromCollection(collection); |
| 1073 } | 1074 } |
| 1074 | 1075 |
| 1075 for (auto* child : children_) | 1076 for (auto* child : children_) |
| 1076 child->ResetCompositorForAnimatorsInTree(compositor); | 1077 child->ResetCompositorForAnimatorsInTree(compositor); |
| 1077 } | 1078 } |
| 1078 | 1079 |
| 1079 } // namespace ui | 1080 } // namespace ui |
| OLD | NEW |