| 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" | |
| 6 | |
| 7 #include "cc/page_scale_animation.h" | 5 #include "cc/page_scale_animation.h" |
| 8 #include "ui/gfx/point_f.h" | 6 #include "ui/gfx/point_f.h" |
| 9 #include "ui/gfx/rect_f.h" | 7 #include "ui/gfx/rect_f.h" |
| 10 | 8 |
| 11 #include <algorithm> | 9 #include <algorithm> |
| 12 #include <math.h> | 10 #include <math.h> |
| 13 | 11 |
| 14 namespace { | 12 namespace { |
| 15 | 13 |
| 16 gfx::PointF toPointF(const gfx::Vector2dF& vector) | 14 gfx::PointF toPointF(const gfx::Vector2dF& vector) |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 | 205 |
| 208 // Linearly interpolate the magnitude in log scale. | 206 // Linearly interpolate the magnitude in log scale. |
| 209 float diff = m_targetPageScaleFactor / m_startPageScaleFactor; | 207 float diff = m_targetPageScaleFactor / m_startPageScaleFactor; |
| 210 float logDiff = log(diff); | 208 float logDiff = log(diff); |
| 211 logDiff *= interp; | 209 logDiff *= interp; |
| 212 diff = exp(logDiff); | 210 diff = exp(logDiff); |
| 213 return m_startPageScaleFactor * diff; | 211 return m_startPageScaleFactor * diff; |
| 214 } | 212 } |
| 215 | 213 |
| 216 } // namespace cc | 214 } // namespace cc |
| OLD | NEW |