OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011, Google Inc. All rights reserved. | 2 * Copyright (c) 2011, 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 23 matching lines...) Expand all Loading... |
34 #include "platform/TraceEvent.h" | 34 #include "platform/TraceEvent.h" |
35 #include "platform/scroll/ScrollableArea.h" | 35 #include "platform/scroll/ScrollableArea.h" |
36 #include "public/platform/Platform.h" | 36 #include "public/platform/Platform.h" |
37 #include "public/platform/WebCompositorSupport.h" | 37 #include "public/platform/WebCompositorSupport.h" |
38 #include "wtf/CurrentTime.h" | 38 #include "wtf/CurrentTime.h" |
39 #include "wtf/PassRefPtr.h" | 39 #include "wtf/PassRefPtr.h" |
40 #include <algorithm> | 40 #include <algorithm> |
41 | 41 |
42 namespace blink { | 42 namespace blink { |
43 | 43 |
44 PassOwnPtr<ScrollAnimatorBase> ScrollAnimatorBase::create(ScrollableArea* scroll
ableArea) | 44 ScrollAnimatorBase* ScrollAnimatorBase::create(ScrollableArea* scrollableArea) |
45 { | 45 { |
46 if (scrollableArea && scrollableArea->scrollAnimatorEnabled()) | 46 if (scrollableArea && scrollableArea->scrollAnimatorEnabled()) |
47 return adoptPtr(new ScrollAnimator(scrollableArea)); | 47 return new ScrollAnimator(scrollableArea); |
48 return adoptPtr(new ScrollAnimatorBase(scrollableArea)); | 48 return new ScrollAnimatorBase(scrollableArea); |
49 } | 49 } |
50 | 50 |
51 ScrollAnimator::ScrollAnimator(ScrollableArea* scrollableArea, WTF::TimeFunction
timeFunction) | 51 ScrollAnimator::ScrollAnimator(ScrollableArea* scrollableArea, WTF::TimeFunction
timeFunction) |
52 : ScrollAnimatorBase(scrollableArea) | 52 : ScrollAnimatorBase(scrollableArea) |
53 , m_timeFunction(timeFunction) | 53 , m_timeFunction(timeFunction) |
54 { | 54 { |
55 } | 55 } |
56 | 56 |
57 ScrollAnimator::~ScrollAnimator() | 57 ScrollAnimator::~ScrollAnimator() |
58 { | 58 { |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 143 |
144 if (isFinished) | 144 if (isFinished) |
145 m_animationCurve.clear(); | 145 m_animationCurve.clear(); |
146 else | 146 else |
147 scrollableArea()->scheduleAnimation(); | 147 scrollableArea()->scheduleAnimation(); |
148 | 148 |
149 TRACE_EVENT0("blink", "ScrollAnimator::notifyPositionChanged"); | 149 TRACE_EVENT0("blink", "ScrollAnimator::notifyPositionChanged"); |
150 notifyPositionChanged(); | 150 notifyPositionChanged(); |
151 } | 151 } |
152 | 152 |
| 153 DEFINE_TRACE(ScrollAnimator) |
| 154 { |
| 155 ScrollAnimatorBase::trace(visitor); |
| 156 } |
| 157 |
153 } // namespace blink | 158 } // namespace blink |
OLD | NEW |