| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 // Implements a gesture animation (fling scroll, etc.) using a curve with a | 39 // Implements a gesture animation (fling scroll, etc.) using a curve with a |
| 40 // generic interface to define the animation parameters as a function of time, | 40 // generic interface to define the animation parameters as a function of time, |
| 41 // and applies the animation to a target, again via a generic interface. It is | 41 // and applies the animation to a target, again via a generic interface. It is |
| 42 // assumed that animate() is called on a more-or-less regular basis by the | 42 // assumed that animate() is called on a more-or-less regular basis by the |
| 43 // owner. | 43 // owner. |
| 44 class PLATFORM_EXPORT WebActiveGestureAnimation { | 44 class PLATFORM_EXPORT WebActiveGestureAnimation { |
| 45 USING_FAST_MALLOC(WebActiveGestureAnimation); | 45 USING_FAST_MALLOC(WebActiveGestureAnimation); |
| 46 WTF_MAKE_NONCOPYABLE(WebActiveGestureAnimation); | 46 WTF_MAKE_NONCOPYABLE(WebActiveGestureAnimation); |
| 47 | 47 |
| 48 public: | 48 public: |
| 49 static std::unique_ptr<WebActiveGestureAnimation> CreateAtAnimationStart( |
| 50 std::unique_ptr<WebGestureCurve>, |
| 51 WebGestureCurveTarget*); |
| 49 static std::unique_ptr<WebActiveGestureAnimation> CreateWithTimeOffset( | 52 static std::unique_ptr<WebActiveGestureAnimation> CreateWithTimeOffset( |
| 50 std::unique_ptr<WebGestureCurve>, | 53 std::unique_ptr<WebGestureCurve>, |
| 51 WebGestureCurveTarget*, | 54 WebGestureCurveTarget*, |
| 52 double start_time); | 55 double start_time); |
| 53 ~WebActiveGestureAnimation(); | 56 ~WebActiveGestureAnimation(); |
| 54 | 57 |
| 55 bool Animate(double time); | 58 bool Animate(double time); |
| 56 | 59 |
| 57 private: | 60 private: |
| 58 // Assumes a valid WebGestureCurveTarget that outlives the animation. | 61 // Assumes a valid WebGestureCurveTarget that outlives the animation. |
| 59 WebActiveGestureAnimation(std::unique_ptr<WebGestureCurve>, | 62 WebActiveGestureAnimation(std::unique_ptr<WebGestureCurve>, |
| 60 WebGestureCurveTarget*, | 63 WebGestureCurveTarget*, |
| 61 double start_time); | 64 double start_time, |
| 65 bool waiting_for_first_tick); |
| 62 | 66 |
| 63 double start_time_; | 67 double start_time_; |
| 68 bool waiting_for_first_tick_; |
| 64 std::unique_ptr<WebGestureCurve> curve_; | 69 std::unique_ptr<WebGestureCurve> curve_; |
| 65 WebGestureCurveTarget* target_; | 70 WebGestureCurveTarget* target_; |
| 66 }; | 71 }; |
| 67 | 72 |
| 68 } // namespace blink | 73 } // namespace blink |
| 69 | 74 |
| 70 #endif | 75 #endif |
| OLD | NEW |