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

Side by Side Diff: ui/compositor/transform_animation_curve_adapter.cc

Issue 12226080: Thread ui transform animations (Closed) Base URL: http://git.chromium.org/chromium/src.git@DefineThreadedLayerAnimationElements
Patch Set: Speed up animations in WebContentsViewAuraTest.QuickOverscrollDirectionChange Created 7 years, 9 months 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 | « ui/compositor/test/test_layer_animation_delegate.cc ('k') | ui/views/view.h » ('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 (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/transform_animation_curve_adapter.h" 5 #include "ui/compositor/transform_animation_curve_adapter.h"
6 6
7 namespace ui { 7 namespace ui {
8 8
9 TransformAnimationCurveAdapter::TransformAnimationCurveAdapter( 9 TransformAnimationCurveAdapter::TransformAnimationCurveAdapter(
10 Tween::Type tween_type, 10 Tween::Type tween_type,
(...skipping 27 matching lines...) Expand all
38 gfx::Transform TransformAnimationCurveAdapter::GetValue( 38 gfx::Transform TransformAnimationCurveAdapter::GetValue(
39 double t) const { 39 double t) const {
40 if (t >= duration_.InSecondsF()) 40 if (t >= duration_.InSecondsF())
41 return target_value_; 41 return target_value_;
42 if (t <= 0.0) 42 if (t <= 0.0)
43 return initial_value_; 43 return initial_value_;
44 double progress = t / duration_.InSecondsF(); 44 double progress = t / duration_.InSecondsF();
45 45
46 gfx::DecomposedTransform to_return; 46 gfx::DecomposedTransform to_return;
47 gfx::BlendDecomposedTransforms(&to_return, 47 gfx::BlendDecomposedTransforms(&to_return,
48 decomposed_target_value_,
48 decomposed_initial_value_, 49 decomposed_initial_value_,
49 decomposed_target_value_,
50 Tween::CalculateValue(tween_type_, progress)); 50 Tween::CalculateValue(tween_type_, progress));
51 return gfx::ComposeTransform(to_return); 51 return gfx::ComposeTransform(to_return);
52 } 52 }
53 53
54 } // namespace ui 54 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/test/test_layer_animation_delegate.cc ('k') | ui/views/view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698