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

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

Issue 693883004: Make cc::animation::TrimTimeToCurrentIteration,cc::AnimationCurve::Duration use TimeTicks/TimeDelta (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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/test/animation_test_common.cc ('k') | cc/trees/layer_tree_host_unittest_animation.cc » ('j') | 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_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 2455 matching lines...) Expand 10 before | Expand all | Expand 10 after
2466 return ScrollIgnored; 2466 return ScrollIgnored;
2467 2467
2468 ScrollOffsetAnimationCurve* curve = 2468 ScrollOffsetAnimationCurve* curve =
2469 animation->curve()->ToScrollOffsetAnimationCurve(); 2469 animation->curve()->ToScrollOffsetAnimationCurve();
2470 2470
2471 gfx::ScrollOffset new_target = 2471 gfx::ScrollOffset new_target =
2472 gfx::ScrollOffsetWithDelta(curve->target_value(), scroll_delta); 2472 gfx::ScrollOffsetWithDelta(curve->target_value(), scroll_delta);
2473 new_target.SetToMax(gfx::ScrollOffset()); 2473 new_target.SetToMax(gfx::ScrollOffset());
2474 new_target.SetToMin(layer_impl->MaxScrollOffset()); 2474 new_target.SetToMin(layer_impl->MaxScrollOffset());
2475 2475
2476 curve->UpdateTarget(animation->TrimTimeToCurrentIteration( 2476 curve->UpdateTarget(
2477 CurrentBeginFrameArgs().frame_time), 2477 animation->TrimTimeToCurrentIteration(
2478 new_target); 2478 CurrentBeginFrameArgs().frame_time).InSecondsF(),
2479 new_target);
2479 2480
2480 return ScrollStarted; 2481 return ScrollStarted;
2481 } 2482 }
2482 // ScrollAnimated is only used for wheel scrolls. We use the same bubbling 2483 // ScrollAnimated is only used for wheel scrolls. We use the same bubbling
2483 // behavior as ScrollBy to determine which layer to animate, but we do not 2484 // behavior as ScrollBy to determine which layer to animate, but we do not
2484 // do the Android-specific things in ScrollBy like showing top controls. 2485 // do the Android-specific things in ScrollBy like showing top controls.
2485 InputHandler::ScrollStatus scroll_status = ScrollBegin(viewport_point, Wheel); 2486 InputHandler::ScrollStatus scroll_status = ScrollBegin(viewport_point, Wheel);
2486 if (scroll_status == ScrollStarted) { 2487 if (scroll_status == ScrollStarted) {
2487 gfx::Vector2dF pending_delta = scroll_delta; 2488 gfx::Vector2dF pending_delta = scroll_delta;
2488 for (LayerImpl* layer_impl = CurrentlyScrollingLayer(); layer_impl; 2489 for (LayerImpl* layer_impl = CurrentlyScrollingLayer(); layer_impl;
(...skipping 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after
3520 } 3521 }
3521 3522
3522 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { 3523 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) {
3523 std::vector<PictureLayerImpl*>::iterator it = 3524 std::vector<PictureLayerImpl*>::iterator it =
3524 std::find(picture_layers_.begin(), picture_layers_.end(), layer); 3525 std::find(picture_layers_.begin(), picture_layers_.end(), layer);
3525 DCHECK(it != picture_layers_.end()); 3526 DCHECK(it != picture_layers_.end());
3526 picture_layers_.erase(it); 3527 picture_layers_.erase(it);
3527 } 3528 }
3528 3529
3529 } // namespace cc 3530 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/animation_test_common.cc ('k') | cc/trees/layer_tree_host_unittest_animation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698