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

Side by Side Diff: cc/CCPageScaleAnimation.cpp

Issue 10914268: Change cc files from namespace WebCore to cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « cc/CCPageScaleAnimation.h ('k') | cc/CCPrioritizedTexture.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 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 "CCPageScaleAnimation.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 WebCore { 14 namespace cc {
15 15
16 PassOwnPtr<CCPageScaleAnimation> CCPageScaleAnimation::create(const IntSize& scr ollStart, float pageScaleStart, const IntSize& windowSize, const IntSize& conten tSize, double startTime) 16 PassOwnPtr<CCPageScaleAnimation> CCPageScaleAnimation::create(const IntSize& scr ollStart, float pageScaleStart, const IntSize& windowSize, const IntSize& conten tSize, double startTime)
17 { 17 {
18 return adoptPtr(new CCPageScaleAnimation(scrollStart, pageScaleStart, window Size, contentSize, startTime)); 18 return adoptPtr(new CCPageScaleAnimation(scrollStart, pageScaleStart, window Size, contentSize, startTime));
19 } 19 }
20 20
21 21
22 CCPageScaleAnimation::CCPageScaleAnimation(const IntSize& scrollStart, float pag eScaleStart, const IntSize& windowSize, const IntSize& contentSize, double start Time) 22 CCPageScaleAnimation::CCPageScaleAnimation(const IntSize& scrollStart, float pag eScaleStart, const IntSize& windowSize, const IntSize& contentSize, double start Time)
23 : m_scrollStart(scrollStart) 23 : m_scrollStart(scrollStart)
24 , m_pageScaleStart(pageScaleStart) 24 , m_pageScaleStart(pageScaleStart)
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 // Log scale is needed to maintain the appearance of uniform zoom. For 149 // Log scale is needed to maintain the appearance of uniform zoom. For
150 // example, if we zoom from 0.5 to 4.0 in 3 seconds, then we should 150 // example, if we zoom from 0.5 to 4.0 in 3 seconds, then we should
151 // be zooming by 2x every second. 151 // be zooming by 2x every second.
152 float diff = m_pageScaleEnd / m_pageScaleStart; 152 float diff = m_pageScaleEnd / m_pageScaleStart;
153 float logDiff = log(diff); 153 float logDiff = log(diff);
154 logDiff *= ratio; 154 logDiff *= ratio;
155 diff = exp(logDiff); 155 diff = exp(logDiff);
156 return m_pageScaleStart * diff; 156 return m_pageScaleStart * diff;
157 } 157 }
158 158
159 } // namespace WebCore 159 } // namespace cc
OLDNEW
« no previous file with comments | « cc/CCPageScaleAnimation.h ('k') | cc/CCPrioritizedTexture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698