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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 } | 47 } |
48 ~ScriptedAnimationController(); | 48 ~ScriptedAnimationController(); |
49 void clearDocumentPointer() { m_document = 0; } | 49 void clearDocumentPointer() { m_document = 0; } |
50 | 50 |
51 typedef int CallbackId; | 51 typedef int CallbackId; |
52 | 52 |
53 int registerCallback(PassRefPtr<RequestAnimationFrameCallback>); | 53 int registerCallback(PassRefPtr<RequestAnimationFrameCallback>); |
54 void cancelCallback(CallbackId); | 54 void cancelCallback(CallbackId); |
55 void serviceScriptedAnimations(double monotonicTimeNow); | 55 void serviceScriptedAnimations(double monotonicTimeNow); |
56 | 56 |
57 void scheduleEvent(PassRefPtr<Event>); | 57 void enqueueEvent(PassRefPtr<Event>); |
| 58 void enqueuePerFrameEvent(PassRefPtr<Event>); |
58 | 59 |
59 void suspend(); | 60 void suspend(); |
60 void resume(); | 61 void resume(); |
61 | 62 |
62 private: | 63 private: |
63 explicit ScriptedAnimationController(Document*); | 64 explicit ScriptedAnimationController(Document*); |
64 | 65 |
65 void scheduleAnimationIfNeeded(); | 66 void scheduleAnimationIfNeeded(); |
66 | 67 |
67 void dispatchEvents(); | 68 void dispatchEvents(); |
68 void executeCallbacks(double monotonicTimeNow); | 69 void executeCallbacks(double monotonicTimeNow); |
69 | 70 |
70 typedef Vector<RefPtr<RequestAnimationFrameCallback> > CallbackList; | 71 typedef Vector<RefPtr<RequestAnimationFrameCallback> > CallbackList; |
71 CallbackList m_callbacks; | 72 CallbackList m_callbacks; |
72 | 73 |
73 Document* m_document; | 74 Document* m_document; |
74 CallbackId m_nextCallbackId; | 75 CallbackId m_nextCallbackId; |
75 int m_suspendCount; | 76 int m_suspendCount; |
76 Vector<RefPtr<Event> > m_eventQueue; | 77 Vector<RefPtr<Event> > m_eventQueue; |
77 ListHashSet<std::pair<const EventTarget*, const StringImpl*> > m_scheduledEv
entTargets; | 78 ListHashSet<std::pair<const EventTarget*, const StringImpl*> > m_perFrameEve
nts; |
78 }; | 79 }; |
79 | 80 |
80 } | 81 } |
81 | 82 |
82 #endif // ScriptedAnimationController_h | 83 #endif // ScriptedAnimationController_h |
OLD | NEW |