| OLD | NEW |
| 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_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 2992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3003 static void CollectScrollDeltas(ScrollAndScaleSet* scroll_info, | 3003 static void CollectScrollDeltas(ScrollAndScaleSet* scroll_info, |
| 3004 LayerImpl* layer_impl) { | 3004 LayerImpl* layer_impl) { |
| 3005 if (!layer_impl) | 3005 if (!layer_impl) |
| 3006 return; | 3006 return; |
| 3007 | 3007 |
| 3008 gfx::ScrollOffset scroll_delta = layer_impl->PullDeltaForMainThread(); | 3008 gfx::ScrollOffset scroll_delta = layer_impl->PullDeltaForMainThread(); |
| 3009 | 3009 |
| 3010 if (!scroll_delta.IsZero()) { | 3010 if (!scroll_delta.IsZero()) { |
| 3011 LayerTreeHostCommon::ScrollUpdateInfo scroll; | 3011 LayerTreeHostCommon::ScrollUpdateInfo scroll; |
| 3012 scroll.layer_id = layer_impl->id(); | 3012 scroll.layer_id = layer_impl->id(); |
| 3013 scroll.scroll_delta = gfx::Vector2dF(scroll_delta.x(), scroll_delta.y()); | 3013 scroll.scroll_delta = gfx::Vector2d(scroll_delta.x(), scroll_delta.y()); |
| 3014 scroll_info->scrolls.push_back(scroll); | 3014 scroll_info->scrolls.push_back(scroll); |
| 3015 } | 3015 } |
| 3016 | 3016 |
| 3017 for (size_t i = 0; i < layer_impl->children().size(); ++i) | 3017 for (size_t i = 0; i < layer_impl->children().size(); ++i) |
| 3018 CollectScrollDeltas(scroll_info, layer_impl->children()[i]); | 3018 CollectScrollDeltas(scroll_info, layer_impl->children()[i]); |
| 3019 } | 3019 } |
| 3020 | 3020 |
| 3021 scoped_ptr<ScrollAndScaleSet> LayerTreeHostImpl::ProcessScrollDeltas() { | 3021 scoped_ptr<ScrollAndScaleSet> LayerTreeHostImpl::ProcessScrollDeltas() { |
| 3022 scoped_ptr<ScrollAndScaleSet> scroll_info(new ScrollAndScaleSet()); | 3022 scoped_ptr<ScrollAndScaleSet> scroll_info(new ScrollAndScaleSet()); |
| 3023 | 3023 |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3467 new_target.SetToMin(layer_impl->MaxScrollOffset()); | 3467 new_target.SetToMin(layer_impl->MaxScrollOffset()); |
| 3468 | 3468 |
| 3469 curve->UpdateTarget( | 3469 curve->UpdateTarget( |
| 3470 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) | 3470 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) |
| 3471 .InSecondsF(), | 3471 .InSecondsF(), |
| 3472 new_target); | 3472 new_target); |
| 3473 | 3473 |
| 3474 return true; | 3474 return true; |
| 3475 } | 3475 } |
| 3476 } // namespace cc | 3476 } // namespace cc |
| OLD | NEW |