OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "CCPageScaleAnimation.h" | 7 #include "cc/page_scale_animation.h" |
8 | 8 |
9 #include "FloatRect.h" | 9 #include "FloatRect.h" |
10 #include "FloatSize.h" | 10 #include "FloatSize.h" |
11 | 11 |
12 #include <math.h> | 12 #include <math.h> |
13 | 13 |
14 namespace cc { | 14 namespace cc { |
15 | 15 |
16 scoped_ptr<CCPageScaleAnimation> CCPageScaleAnimation::create(const IntSize& scr
ollStart, float pageScaleStart, const IntSize& windowSize, const IntSize& conten
tSize, double startTime) | 16 scoped_ptr<CCPageScaleAnimation> CCPageScaleAnimation::create(const IntSize& scr
ollStart, float pageScaleStart, const IntSize& windowSize, const IntSize& conten
tSize, double startTime) |
17 { | 17 { |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 // example, if we zoom from 0.5 to 4.0 in 3 seconds, then we should | 149 // example, if we zoom from 0.5 to 4.0 in 3 seconds, then we should |
150 // be zooming by 2x every second. | 150 // be zooming by 2x every second. |
151 float diff = m_pageScaleEnd / m_pageScaleStart; | 151 float diff = m_pageScaleEnd / m_pageScaleStart; |
152 float logDiff = log(diff); | 152 float logDiff = log(diff); |
153 logDiff *= ratio; | 153 logDiff *= ratio; |
154 diff = exp(logDiff); | 154 diff = exp(logDiff); |
155 return m_pageScaleStart * diff; | 155 return m_pageScaleStart * diff; |
156 } | 156 } |
157 | 157 |
158 } // namespace cc | 158 } // namespace cc |
OLD | NEW |