| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 { | 54 { |
| 55 return adoptRef(new ScriptedAnimationController(document, displayID)); | 55 return adoptRef(new ScriptedAnimationController(document, displayID)); |
| 56 } | 56 } |
| 57 ~ScriptedAnimationController(); | 57 ~ScriptedAnimationController(); |
| 58 void clearDocumentPointer() { m_document = 0; } | 58 void clearDocumentPointer() { m_document = 0; } |
| 59 | 59 |
| 60 typedef int CallbackId; | 60 typedef int CallbackId; |
| 61 | 61 |
| 62 CallbackId registerCallback(PassRefPtr<RequestAnimationFrameCallback>); | 62 CallbackId registerCallback(PassRefPtr<RequestAnimationFrameCallback>); |
| 63 void cancelCallback(CallbackId); | 63 void cancelCallback(CallbackId); |
| 64 void serviceScriptedAnimations(double monotonicTimeNow); | 64 void serviceScriptedAnimations(DOMTimeStamp); |
| 65 | 65 |
| 66 void suspend(); | 66 void suspend(); |
| 67 void resume(); | 67 void resume(); |
| 68 | 68 |
| 69 void windowScreenDidChange(PlatformDisplayID); | 69 void windowScreenDidChange(PlatformDisplayID); |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 ScriptedAnimationController(Document*, PlatformDisplayID); | 72 ScriptedAnimationController(Document*, PlatformDisplayID); |
| 73 | 73 |
| 74 typedef Vector<RefPtr<RequestAnimationFrameCallback> > CallbackList; | 74 typedef Vector<RefPtr<RequestAnimationFrameCallback> > CallbackList; |
| 75 CallbackList m_callbacks; | 75 CallbackList m_callbacks; |
| 76 | 76 |
| 77 Document* m_document; | 77 Document* m_document; |
| 78 CallbackId m_nextCallbackId; | 78 CallbackId m_nextCallbackId; |
| 79 int m_suspendCount; | 79 int m_suspendCount; |
| 80 | 80 |
| 81 void scheduleAnimation(); | 81 void scheduleAnimation(); |
| 82 | 82 |
| 83 #if USE(REQUEST_ANIMATION_FRAME_TIMER) | 83 #if USE(REQUEST_ANIMATION_FRAME_TIMER) |
| 84 void animationTimerFired(Timer<ScriptedAnimationController>*); | 84 void animationTimerFired(Timer<ScriptedAnimationController>*); |
| 85 Timer<ScriptedAnimationController> m_animationTimer; | 85 Timer<ScriptedAnimationController> m_animationTimer; |
| 86 double m_lastAnimationFrameTimeMonotonic; | 86 double m_lastAnimationFrameTime; |
| 87 | 87 |
| 88 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) | 88 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) |
| 89 // Override for DisplayRefreshMonitorClient | 89 // Override for DisplayRefreshMonitorClient |
| 90 virtual void displayRefreshFired(double timestamp); | 90 virtual void displayRefreshFired(double timestamp) { serviceScriptedAnimatio
ns(convertSecondsToDOMTimeStamp(timestamp)); } |
| 91 | 91 |
| 92 bool m_useTimer; | 92 bool m_useTimer; |
| 93 #endif | 93 #endif |
| 94 #endif | 94 #endif |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 } | 97 } |
| 98 | 98 |
| 99 #endif // ENABLE(REQUEST_ANIMATION_FRAME) | 99 #endif // ENABLE(REQUEST_ANIMATION_FRAME) |
| 100 | 100 |
| 101 #endif // ScriptedAnimationController_h | 101 #endif // ScriptedAnimationController_h |
| 102 |
| OLD | NEW |