-
requestAnimationFrame()
-
http://trac.webkit.org/browser/trunk/Source/WebCore/dom/Document.cpp?rev=131214#L5544
int Document::requestAnimationFrame(PassRefPtr<RequestAnimationFrameCallback> callback) { return m_scriptedAnimationController->registerCallback(callback); } -
http://trac.webkit.org/browser/trunk/Source/WebCore/dom/ScriptedAnimationController.cpp#L104
ScriptedAnimationController::CallbackId ScriptedAnimationController::registerCallback(PassRefPtr<RequestAnimationFrameCallback> callback) { m_callbacks.append(callback); } -
http://trac.webkit.org/browser/trunk/Source/WebCore/dom/ScriptedAnimationController.cpp#L214
void ScriptedAnimationController::animationTimerFired() { m_lastAnimationFrameTimeMonotonic = monotonicallyIncreasingTime(); serviceScriptedAnimations(m_lastAnimationFrameTimeMonotonic); } -
http://trac.webkit.org/browser/trunk/Source/WebCore/dom/ScriptedAnimationController.cpp#L130
void ScriptedAnimationController::serviceScriptedAnimations(double monotonicTimeNow) { double highResNowMs = 1000.0 * m_document->loader()->timing().monotonicTimeToZeroBasedDocumentTime(monotonicTimeNow); ... callback->handleEvent(legacyHighResNowMs); // requestAnimationFrame() に登録した関数がここからコールバックされる }
-
-
monotonicallyIncreasingTime()
-
http://trac.webkit.org/browser/trunk/Source/WTF/wtf/CurrentTime.cpp#L285
double monotonicallyIncreasingTime() { double currentTimeNow = currentTime(); }
-
-
performance.now()
-
http://trac.webkit.org/browser/trunk/Source/WebCore/page/Performance.cpp#L229
double Performance::now() const { return 1000.0 * m_frame->document()->loader()->timing().monotonicTimeToZeroBasedDocumentTime(monotonicallyIncreasingTime()); }
-
-
Date.now()
-
http://trac.webkit.org/browser/trunk/Source/JavaScriptCore/runtime/DateConstructor.cpp#L204
EncodedJSValue JSC_HOST_CALL dateNow(ExecState* exec) { return JSValue::encode(jsNumber(jsCurrentTime()); } -
http://trac.webkit.org/browser/trunk/Source/WTF/wtf/DateMath.h#L99
inline double jsCurrentTime() { return floor(WTF::currentTimeMS()); } -
http://trac.webkit.org/browser/trunk/Source/WTF/wtf/CurrentTime.h#L48
inline double currentTimeMS() { return currentTime() * 1000.0; }
-
-
currentTime()
-
http://trac.webkit.org/browser/trunk/Source/WTF/wtf/CurrentTime.cpp#L153
-
http://trac.webkit.org/browser/trunk/Source/WTF/wtf/CurrentTime.cpp#L198
double currentTime() { // OSが提供している時間取得APIを呼び出す GetTickCount() g_get_current_time() ecore_time_unix_get() gettimeofday() }
-
Last active
August 29, 2015 14:16
-
-
Save uupaa/df4d7dd1251a0ee88c34 to your computer and use it in GitHub Desktop.
requestAnimationFrame and Date.now in WebKit
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment