| OLD | NEW |
| (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 #ifndef WheelFlingPlatformGestureCurve_h | |
| 6 #define WheelFlingPlatformGestureCurve_h | |
| 7 | |
| 8 #include "FloatPoint.h" | |
| 9 #include "PlatformGestureCurve.h" | |
| 10 #include <wtf/OwnPtr.h> | |
| 11 #include <wtf/PassOwnPtr.h> | |
| 12 | |
| 13 namespace WebCore { | |
| 14 | |
| 15 class PlatformGestureCurveTarget; | |
| 16 | |
| 17 // Implementation of PlatformGestureCurve suitable for mouse wheel-based fling | |
| 18 // scroll. A Rayleigh distribtution curve is used to define the velocity profile
, | |
| 19 // so velocity starts at zero, accelerates to a maximum proportional to 'velocit
y', | |
| 20 // then gently tails off to zero again. | |
| 21 class WheelFlingPlatformGestureCurve : public PlatformGestureCurve { | |
| 22 public: | |
| 23 static PassOwnPtr<PlatformGestureCurve> create(const FloatPoint& velocity); | |
| 24 virtual ~WheelFlingPlatformGestureCurve(); | |
| 25 | |
| 26 virtual const char* debugName() const OVERRIDE; | |
| 27 virtual bool apply(double time, PlatformGestureCurveTarget*) OVERRIDE; | |
| 28 | |
| 29 private: | |
| 30 explicit WheelFlingPlatformGestureCurve(const FloatPoint& velocity); | |
| 31 | |
| 32 FloatPoint m_velocity; | |
| 33 IntPoint m_cumulativeScroll; | |
| 34 }; | |
| 35 | |
| 36 } // namespace WebCore | |
| 37 | |
| 38 #endif | |
| OLD | NEW |