Changeset 116319 in webkit
- Timestamp:
- May 7, 2012 10:37:30 AM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r116317 r116319 1 2012-05-07 Nat Duca <nduca@chromium.org> 2 3 Unreviewed, rolling out r115525. 4 http://trac.webkit.org/changeset/115525 5 https://bugs.webkit.org/show_bug.cgi?id=66683 6 7 Too many pages rely on DOMTimeStamp as first argument. 8 Reverting while we consider next steps. 9 10 * WebCore.exp.in: 11 * bindings/js/JSRequestAnimationFrameCallbackCustom.cpp: 12 (WebCore::JSRequestAnimationFrameCallback::handleEvent): 13 * dom/Document.cpp: 14 (WebCore::Document::serviceScriptedAnimations): 15 * dom/Document.h: 16 (Document): 17 * dom/RequestAnimationFrameCallback.h: 18 (RequestAnimationFrameCallback): 19 * dom/RequestAnimationFrameCallback.idl: 20 * dom/ScriptedAnimationController.cpp: 21 (WebCore::ScriptedAnimationController::ScriptedAnimationController): 22 (WebCore::ScriptedAnimationController::serviceScriptedAnimations): 23 (WebCore): 24 (WebCore::ScriptedAnimationController::windowScreenDidChange): 25 (WebCore::ScriptedAnimationController::scheduleAnimation): 26 (WebCore::ScriptedAnimationController::animationTimerFired): 27 * dom/ScriptedAnimationController.h: 28 (ScriptedAnimationController): 29 (WebCore::ScriptedAnimationController::displayRefreshFired): 30 * page/FrameView.cpp: 31 (WebCore::FrameView::serviceScriptedAnimations): 32 * page/FrameView.h: 33 (FrameView): 34 * platform/graphics/DisplayRefreshMonitor.cpp: 35 (WebCore::DisplayRefreshMonitor::DisplayRefreshMonitor): 36 (WebCore::DisplayRefreshMonitor::notifyClients): 37 * platform/graphics/DisplayRefreshMonitor.h: 38 (DisplayRefreshMonitor): 39 * platform/graphics/blackberry/DisplayRefreshMonitorBlackBerry.cpp: 40 (WebCore::DisplayRefreshMonitor::displayLinkFired): 41 * platform/graphics/mac/DisplayRefreshMonitorMac.cpp: 42 (WebCore): 43 (WebCore::DisplayRefreshMonitor::requestRefreshCallback): 44 (WebCore::DisplayRefreshMonitor::displayLinkFired): 45 1 46 2012-05-07 Tommy Widenflycht <tommyw@google.com> 2 47 -
trunk/Source/WebCore/WebCore.exp.in
r116277 r116319 2051 2051 2052 2052 #if ENABLE(REQUEST_ANIMATION_FRAME) 2053 __ZN7WebCore9FrameView25serviceScriptedAnimationsE d2053 __ZN7WebCore9FrameView25serviceScriptedAnimationsEy 2054 2054 #endif 2055 2055 -
trunk/Source/WebCore/bindings/js/JSRequestAnimationFrameCallbackCustom.cpp
r115525 r116319 34 34 namespace WebCore { 35 35 36 bool JSRequestAnimationFrameCallback::handleEvent( double highResNowMs)36 bool JSRequestAnimationFrameCallback::handleEvent(DOMTimeStamp time) 37 37 { 38 38 if (!canInvokeCallback()) … … 44 44 45 45 MarkedArgumentBuffer args; 46 args.append(jsNumber( highResNowMs));46 args.append(jsNumber(time)); 47 47 48 48 bool raisedException = false; -
trunk/Source/WebCore/dom/Document.cpp
r116277 r116319 5806 5806 } 5807 5807 5808 void Document::serviceScriptedAnimations( double monotonicAnimationStartTime)5808 void Document::serviceScriptedAnimations(DOMTimeStamp time) 5809 5809 { 5810 5810 if (!m_scriptedAnimationController) 5811 5811 return; 5812 m_scriptedAnimationController->serviceScriptedAnimations( monotonicAnimationStartTime);5812 m_scriptedAnimationController->serviceScriptedAnimations(time); 5813 5813 } 5814 5814 #endif -
trunk/Source/WebCore/dom/Document.h
r116066 r116319 1125 1125 int webkitRequestAnimationFrame(PassRefPtr<RequestAnimationFrameCallback>); 1126 1126 void webkitCancelAnimationFrame(int id); 1127 void serviceScriptedAnimations( double monotonicAnimationStartTime);1127 void serviceScriptedAnimations(DOMTimeStamp); 1128 1128 #endif 1129 1129 -
trunk/Source/WebCore/dom/RequestAnimationFrameCallback.h
r115525 r116319 32 32 #define RequestAnimationFrameCallback_h 33 33 34 #include "DOMTimeStamp.h" 34 35 #include <wtf/RefCounted.h> 35 36 … … 39 40 public: 40 41 virtual ~RequestAnimationFrameCallback() { } 41 virtual bool handleEvent( double highResTimeMs) = 0;42 virtual bool handleEvent(DOMTimeStamp) = 0; 42 43 43 44 int m_id; … … 48 49 49 50 #endif // RequestAnimationFrameCallback_h 51 -
trunk/Source/WebCore/dom/RequestAnimationFrameCallback.idl
r115525 r116319 34 34 Conditional=REQUEST_ANIMATION_FRAME, 35 35 ] RequestAnimationFrameCallback{ 36 // highResTime is passed as high resolution timestamp, see37 // http://www.w3.org/TR/hr-time/ for details.38 36 #if defined(V8_BINDING) && V8_BINDING 39 boolean handleEvent(in double highResTime);37 boolean handleEvent(in DOMTimeStamp time); 40 38 #else 41 [Custom] boolean handleEvent(in double highResTime);39 [Custom] boolean handleEvent(in DOMTimeStamp time); 42 40 #endif 43 41 44 42 }; 45 43 } -
trunk/Source/WebCore/dom/ScriptedAnimationController.cpp
r116230 r116319 30 30 31 31 #include "Document.h" 32 #include "DocumentLoader.h"33 32 #include "FrameView.h" 34 33 #include "InspectorInstrumentation.h" … … 54 53 #if USE(REQUEST_ANIMATION_FRAME_TIMER) 55 54 , m_animationTimer(this, &ScriptedAnimationController::animationTimerFired) 56 , m_lastAnimationFrameTime Monotonic(0)55 , m_lastAnimationFrameTime(0) 57 56 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 58 57 , m_useTimer(false) … … 109 108 } 110 109 111 void ScriptedAnimationController::serviceScriptedAnimations( double monotonicTimeNow)110 void ScriptedAnimationController::serviceScriptedAnimations(DOMTimeStamp time) 112 111 { 113 112 if (!m_callbacks.size() || m_suspendCount || (m_document->settings() && !m_document->settings()->requestAnimationFrameEnabled())) 114 113 return; 115 116 double highResNowMs = 1000.0 * m_document->loader()->timing()->convertMonotonicTimeToZeroBasedDocumentTime(monotonicTimeNow);117 114 118 115 // First, generate a list of callbacks to consider. Callbacks registered from this point … … 129 126 callback->m_firedOrCancelled = true; 130 127 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willFireAnimationFrame(m_document, callback->m_id); 131 callback->handleEvent( highResNowMs);128 callback->handleEvent(time); 132 129 InspectorInstrumentation::didFireAnimationFrame(cookie); 133 130 } … … 145 142 scheduleAnimation(); 146 143 } 147 144 148 145 void ScriptedAnimationController::windowScreenDidChange(PlatformDisplayID displayID) 149 146 { … … 154 151 #else 155 152 UNUSED_PARAM(displayID); 156 #endif 153 #endif 157 154 } 158 155 … … 167 164 if (DisplayRefreshMonitorManager::sharedManager()->scheduleAnimation(this)) 168 165 return; 169 166 170 167 m_useTimer = true; 171 168 } … … 173 170 if (m_animationTimer.isActive()) 174 171 return; 175 176 double scheduleDelay = max<double>(MinimumAnimationInterval - ( monotonicallyIncreasingTime() - m_lastAnimationFrameTimeMonotonic), 0);172 173 double scheduleDelay = max<double>(MinimumAnimationInterval - (currentTime() - m_lastAnimationFrameTime), 0); 177 174 m_animationTimer.startOneShot(scheduleDelay); 178 175 #else … … 185 182 void ScriptedAnimationController::animationTimerFired(Timer<ScriptedAnimationController>*) 186 183 { 187 m_lastAnimationFrameTimeMonotonic = monotonicallyIncreasingTime(); 188 serviceScriptedAnimations(m_lastAnimationFrameTimeMonotonic); 189 } 190 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 191 void ScriptedAnimationController::displayRefreshFired(double monotonicTimeNow) 192 { 193 serviceScriptedAnimations(monotonicTimeNow); 184 m_lastAnimationFrameTime = currentTime(); 185 serviceScriptedAnimations(convertSecondsToDOMTimeStamp(m_lastAnimationFrameTime)); 194 186 } 195 187 #endif 196 #endif197 198 199 188 200 189 } 201 190 202 191 #endif 192 -
trunk/Source/WebCore/dom/ScriptedAnimationController.h
r115525 r116319 62 62 CallbackId registerCallback(PassRefPtr<RequestAnimationFrameCallback>); 63 63 void cancelCallback(CallbackId); 64 void serviceScriptedAnimations( double monotonicTimeNow);64 void serviceScriptedAnimations(DOMTimeStamp); 65 65 66 66 void suspend(); … … 71 71 private: 72 72 ScriptedAnimationController(Document*, PlatformDisplayID); 73 73 74 74 typedef Vector<RefPtr<RequestAnimationFrameCallback> > CallbackList; 75 75 CallbackList m_callbacks; … … 84 84 void animationTimerFired(Timer<ScriptedAnimationController>*); 85 85 Timer<ScriptedAnimationController> m_animationTimer; 86 double m_lastAnimationFrameTime Monotonic;86 double m_lastAnimationFrameTime; 87 87 88 88 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 89 89 // Override for DisplayRefreshMonitorClient 90 virtual void displayRefreshFired(double timestamp) ;90 virtual void displayRefreshFired(double timestamp) { serviceScriptedAnimations(convertSecondsToDOMTimeStamp(timestamp)); } 91 91 92 92 bool m_useTimer; … … 100 100 101 101 #endif // ScriptedAnimationController_h 102 -
trunk/Source/WebCore/page/FrameView.cpp
r115525 r116319 2162 2162 2163 2163 #if ENABLE(REQUEST_ANIMATION_FRAME) 2164 void FrameView::serviceScriptedAnimations( double monotonicAnimationStartTime)2164 void FrameView::serviceScriptedAnimations(DOMTimeStamp time) 2165 2165 { 2166 2166 for (Frame* frame = m_frame.get(); frame; frame = frame->tree()->traverseNext()) { … … 2174 2174 2175 2175 for (size_t i = 0; i < documents.size(); ++i) 2176 documents[i]->serviceScriptedAnimations( monotonicAnimationStartTime);2176 documents[i]->serviceScriptedAnimations(time); 2177 2177 } 2178 2178 #endif -
trunk/Source/WebCore/page/FrameView.h
r115525 r116319 113 113 114 114 #if ENABLE(REQUEST_ANIMATION_FRAME) 115 void serviceScriptedAnimations( double monotonicAnimationStartTime);115 void serviceScriptedAnimations(DOMTimeStamp); 116 116 #endif 117 117 -
trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitor.cpp
r115525 r116319 54 54 55 55 DisplayRefreshMonitor::DisplayRefreshMonitor(PlatformDisplayID displayID) 56 : m_ monotonicAnimationStartTime(0)56 : m_timestamp(0) 57 57 , m_active(true) 58 58 , m_scheduled(false) … … 76 76 void DisplayRefreshMonitor::notifyClients() 77 77 { 78 double monotonicAnimationStartTime;78 double timestamp; 79 79 { 80 80 MutexLocker lock(m_mutex); 81 81 m_scheduled = false; 82 monotonicAnimationStartTime = m_monotonicAnimationStartTime;82 timestamp = m_timestamp; 83 83 } 84 84 85 85 for (size_t i = 0; i < m_clients.size(); ++i) 86 m_clients[i]->fireDisplayRefreshIfNeeded( monotonicAnimationStartTime);86 m_clients[i]->fireDisplayRefreshIfNeeded(timestamp); 87 87 88 88 { -
trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitor.h
r115525 r116319 114 114 static void refreshDisplayOnMainThread(void* data); 115 115 116 double m_ monotonicAnimationStartTime;116 double m_timestamp; 117 117 bool m_active; 118 118 bool m_scheduled; -
trunk/Source/WebCore/platform/graphics/blackberry/DisplayRefreshMonitorBlackBerry.cpp
r115525 r116319 82 82 m_previousFrameDone = false; 83 83 84 m_ monotonicAnimationStartTime = monotonicallyIncreasingTime();84 m_timestamp = currentTime(); 85 85 86 86 callOnMainThread(refreshDisplayOnMainThread, this); -
trunk/Source/WebCore/platform/graphics/mac/DisplayRefreshMonitorMac.cpp
r115525 r116319 46 46 return kCVReturnSuccess; 47 47 } 48 48 49 49 DisplayRefreshMonitor::~DisplayRefreshMonitor() 50 50 { … … 62 62 if (!m_active) 63 63 return false; 64 64 65 65 if (!m_displayLink) { 66 66 m_active = false; … … 79 79 m_active = true; 80 80 } 81 81 82 82 MutexLocker lock(m_mutex); 83 83 m_scheduled = true; … … 93 93 m_previousFrameDone = false; 94 94 95 double webKitMonotonicNow = monotonicallyIncreasingTime(); 96 double timeUntilOutput = outputTimeSeconds - nowSeconds; 97 // FIXME: Should this be using webKitMonotonicNow? 98 m_monotonicAnimationStartTime = webKitMonotonicNow + timeUntilOutput; 99 95 double webKitNow = currentTime(); 96 m_timestamp = webKitNow - nowSeconds + outputTimeSeconds; 97 100 98 callOnMainThread(refreshDisplayOnMainThread, this); 101 99 } -
trunk/Source/WebKit/chromium/ChangeLog
r116317 r116319 1 2012-05-07 Nat Duca <nduca@chromium.org> 2 3 Unreviewed, rolling out r115525. 4 http://trac.webkit.org/changeset/115525 5 https://bugs.webkit.org/show_bug.cgi?id=66683 6 7 Too many pages rely on DOMTimeStamp as first argument. 8 Reverting while we consider next steps. 9 10 * src/PageWidgetDelegate.cpp: 11 (WebKit::PageWidgetDelegate::animate): 12 * src/WebViewImpl.cpp: 13 (WebKit::WebViewImpl::updateAnimations): 14 1 15 2012-05-07 Tommy Widenflycht <tommyw@google.com> 2 16 -
trunk/Source/WebKit/chromium/src/PageWidgetDelegate.cpp
r115525 r116319 60 60 if (!view) 61 61 return; 62 view->serviceScriptedAnimations(monotonicFrameBeginTime); 62 double timeShift = currentTime() - monotonicallyIncreasingTime(); 63 view->serviceScriptedAnimations(convertSecondsToDOMTimeStamp(monotonicFrameBeginTime + timeShift)); 63 64 #endif 64 65 } -
trunk/Source/WebKit/chromium/src/WebViewImpl.cpp
r115771 r116319 1433 1433 TRACE_EVENT("WebViewImpl::updateAnimations", this, 0); 1434 1434 1435 WebFrameImpl* webframe = mainFrameImpl(); 1436 if (!webframe) 1437 return; 1438 FrameView* view = webframe->frameView(); 1439 if (!view) 1440 return; 1441 1435 1442 // Create synthetic wheel events as necessary for fling. 1436 1443 if (m_gestureAnimation) { … … 1440 1447 m_gestureAnimation.clear(); 1441 1448 } 1442 1443 if (!m_page)1444 return;1445 1449 1446 1450 PageWidgetDelegate::animate(m_page.get(), monotonicFrameBeginTime);
Note: See TracChangeset
for help on using the changeset viewer.