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

Side by Side Diff: cc/CCActiveGestureAnimation.cpp

Issue 10917153: Update cc snapshot to r127918 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/CCActiveGestureAnimation.h ('k') | cc/CCDirectRenderer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "config.h"
6
7 #include "CCActiveGestureAnimation.h"
8
9 #include "CCGestureCurve.h"
10 #include "TraceEvent.h"
11
12 namespace WebCore {
13
14 PassOwnPtr<CCActiveGestureAnimation> CCActiveGestureAnimation::create(PassOwnPtr <CCGestureCurve> curve, CCGestureCurveTarget* target)
15 {
16 return adoptPtr(new CCActiveGestureAnimation(curve, target));
17 }
18
19 CCActiveGestureAnimation::CCActiveGestureAnimation(PassOwnPtr<CCGestureCurve> cu rve, CCGestureCurveTarget* target)
20 : m_startTime(0)
21 , m_waitingForFirstTick(true)
22 , m_gestureCurve(curve)
23 , m_gestureCurveTarget(target)
24 {
25 TRACE_EVENT_ASYNC_BEGIN1("input", "GestureAnimation", this, "curve", m_gestu reCurve->debugName());
26 }
27
28 CCActiveGestureAnimation::~CCActiveGestureAnimation()
29 {
30 TRACE_EVENT_ASYNC_END0("input", "GestureAnimation", this);
31 }
32
33 bool CCActiveGestureAnimation::animate(double monotonicTime)
34 {
35 if (m_waitingForFirstTick) {
36 m_startTime = monotonicTime;
37 m_waitingForFirstTick = false;
38 }
39
40 // CCGestureCurves used zero-based time, so subtract start-time.
41 return m_gestureCurve->apply(monotonicTime - m_startTime, m_gestureCurveTarg et);
42 }
43
44 } // namespace WebCore
OLDNEW
« no previous file with comments | « cc/CCActiveGestureAnimation.h ('k') | cc/CCDirectRenderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698