summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcmarrin@apple.com <cmarrin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>2011-09-10 14:21:01 (GMT)
committercmarrin@apple.com <cmarrin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>2011-09-10 14:21:01 (GMT)
commitd9dca741b4762c433ae18f7a1bc59a3a81861fc8 (patch)
treeb9750ce9e6bc9bff6ad77ae749d4c3b475626c37
parent1542f5500b36449b306a391e0247cdb085b0fd5f (diff)
requestAnimationFrame doesn't throttle on Mac
https://bugs.webkit.org/show_bug.cgi?id=67171 Reviewed by Simon Fraser. Source/JavaScriptCore: Added WTF_USE_REQUEST_ANIMATION_FRAME_TIMER to allow any platform to run requestAnimationFrame callbacks on a Timer defined in ScriptedAnimationController. Currently only enabled for PLATFORM(MAC) * wtf/Platform.h: Source/WebCore: Changed requestAnimationFrame to use a Timer in ScriptedAnimationController on Mac, rather than runLoopObservers. The Timer is throttled to fire no faster than every 15ms. It is behind a WTF_USE_REQUEST_ANIMATION_FRAME_TIMER flag and can be used by any implementation, but currently it is only enabled by PLATFORM(MAC). * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::ScriptedAnimationController): (WebCore::ScriptedAnimationController::resume): (WebCore::ScriptedAnimationController::registerCallback): (WebCore::ScriptedAnimationController::serviceScriptedAnimations): (WebCore::ScriptedAnimationController::scheduleAnimation): (WebCore::ScriptedAnimationController::animationTimerFired): * dom/ScriptedAnimationController.h: * loader/EmptyClients.h: * page/Chrome.cpp: (WebCore::Chrome::scheduleAnimation): * page/ChromeClient.h: Source/WebKit/mac: Removed runLoopObserver for requestAnimationFrame. It's now done by a Timer in ScriptedAnimationController in WebCore. * WebCoreSupport/WebChromeClient.h: * WebCoreSupport/WebChromeClient.mm: * WebView/WebView.mm: (-[WebView _close]): * WebView/WebViewData.h: * WebView/WebViewInternal.h: Source/WebKit2: Removed runLoopObserver for requestAnimationFrame. It's now done by a Timer in ScriptedAnimationController in WebCore. * WebProcess/WebCoreSupport/WebChromeClient.cpp: * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::~WebPage): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/mac/WebPageMac.mm: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@94908 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-rw-r--r--Source/JavaScriptCore/ChangeLog13
-rw-r--r--Source/JavaScriptCore/wtf/Platform.h4
-rwxr-xr-xSource/WebCore/ChangeLog26
-rw-r--r--Source/WebCore/dom/ScriptedAnimationController.cpp42
-rw-r--r--Source/WebCore/dom/ScriptedAnimationController.h12
-rw-r--r--Source/WebCore/loader/EmptyClients.h2
-rw-r--r--Source/WebCore/page/Chrome.cpp2
-rw-r--r--Source/WebCore/page/ChromeClient.h2
-rw-r--r--Source/WebKit/mac/ChangeLog17
-rw-r--r--Source/WebKit/mac/WebCoreSupport/WebChromeClient.h4
-rw-r--r--Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm9
-rw-r--r--Source/WebKit/mac/WebView/WebView.mm47
-rw-r--r--Source/WebKit/mac/WebView/WebViewData.h4
-rw-r--r--Source/WebKit/mac/WebView/WebViewInternal.h4
-rw-r--r--Source/WebKit2/ChangeLog17
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp7
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h4
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebPage.cpp6
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebPage.h9
-rw-r--r--Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm40
20 files changed, 129 insertions, 142 deletions
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index 7e64a36..ebd445a 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,16 @@
+2011-09-09 Chris Marrin <cmarrin@apple.com>
+
+ requestAnimationFrame doesn't throttle on Mac
+ https://bugs.webkit.org/show_bug.cgi?id=67171
+
+ Reviewed by Simon Fraser.
+
+ Added WTF_USE_REQUEST_ANIMATION_FRAME_TIMER to allow any platform to run
+ requestAnimationFrame callbacks on a Timer defined in ScriptedAnimationController.
+ Currently only enabled for PLATFORM(MAC)
+
+ * wtf/Platform.h:
+
2011-09-09 Geoffrey Garen <ggaren@apple.com>
Reviewed by Dan Bernstein.
diff --git a/Source/JavaScriptCore/wtf/Platform.h b/Source/JavaScriptCore/wtf/Platform.h
index e41e0a5..b3e2a19 100644
--- a/Source/JavaScriptCore/wtf/Platform.h
+++ b/Source/JavaScriptCore/wtf/Platform.h
@@ -1159,4 +1159,8 @@
#define WTF_USE_AVFOUNDATION 1
#endif
+#if PLATFORM(MAC)
+#define WTF_USE_REQUEST_ANIMATION_FRAME_TIMER 1
+#endif
+
#endif /* WTF_Platform_h */
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 0182484..282ffe1 100755
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,29 @@
+2011-09-09 Chris Marrin <cmarrin@apple.com>
+
+ requestAnimationFrame doesn't throttle on Mac
+ https://bugs.webkit.org/show_bug.cgi?id=67171
+
+ Reviewed by Simon Fraser.
+
+ Changed requestAnimationFrame to use a Timer in ScriptedAnimationController
+ on Mac, rather than runLoopObservers. The Timer is throttled to fire no
+ faster than every 15ms. It is behind a WTF_USE_REQUEST_ANIMATION_FRAME_TIMER
+ flag and can be used by any implementation, but currently it is only enabled
+ by PLATFORM(MAC).
+
+ * dom/ScriptedAnimationController.cpp:
+ (WebCore::ScriptedAnimationController::ScriptedAnimationController):
+ (WebCore::ScriptedAnimationController::resume):
+ (WebCore::ScriptedAnimationController::registerCallback):
+ (WebCore::ScriptedAnimationController::serviceScriptedAnimations):
+ (WebCore::ScriptedAnimationController::scheduleAnimation):
+ (WebCore::ScriptedAnimationController::animationTimerFired):
+ * dom/ScriptedAnimationController.h:
+ * loader/EmptyClients.h:
+ * page/Chrome.cpp:
+ (WebCore::Chrome::scheduleAnimation):
+ * page/ChromeClient.h:
+
2011-09-10 Jarred Nicholls <jarred@sencha.com>
[Qt] QWebSettings::setUserStyleSheetUrl() does not work with windows paths that contain drive letters
diff --git a/Source/WebCore/dom/ScriptedAnimationController.cpp b/Source/WebCore/dom/ScriptedAnimationController.cpp
index 0c70359..5d31d9d 100644
--- a/Source/WebCore/dom/ScriptedAnimationController.cpp
+++ b/Source/WebCore/dom/ScriptedAnimationController.cpp
@@ -33,12 +33,26 @@
#include "FrameView.h"
#include "RequestAnimationFrameCallback.h"
+#if USE(REQUEST_ANIMATION_FRAME_TIMER)
+#include <algorithm>
+#include <wtf/CurrentTime.h>
+
+using namespace std;
+
+// Allow a little more than 60fps to make sure we can at least hit that frame rate.
+#define MinimumAnimationInterval 0.015
+#endif
+
namespace WebCore {
ScriptedAnimationController::ScriptedAnimationController(Document* document)
: m_document(document)
, m_nextCallbackId(0)
, m_suspendCount(0)
+#if USE(REQUEST_ANIMATION_FRAME_TIMER)
+ , m_animationTimer(this, &ScriptedAnimationController::animationTimerFired)
+ , m_lastAnimationFrameTime(0)
+#endif
{
}
@@ -51,8 +65,7 @@ void ScriptedAnimationController::resume()
{
--m_suspendCount;
if (!m_suspendCount && m_callbacks.size())
- if (FrameView* fv = m_document->view())
- fv->scheduleAnimation();
+ scheduleAnimation();
}
ScriptedAnimationController::CallbackId ScriptedAnimationController::registerCallback(PassRefPtr<RequestAnimationFrameCallback> callback, Element* animationElement)
@@ -63,8 +76,7 @@ ScriptedAnimationController::CallbackId ScriptedAnimationController::registerCal
callback->m_element = animationElement;
m_callbacks.append(callback);
if (!m_suspendCount)
- if (FrameView* view = m_document->view())
- view->scheduleAnimation();
+ scheduleAnimation();
return id;
}
@@ -124,9 +136,27 @@ void ScriptedAnimationController::serviceScriptedAnimations(DOMTimeStamp time)
}
if (m_callbacks.size())
- if (FrameView* view = m_document->view())
- view->scheduleAnimation();
+ scheduleAnimation();
+}
+
+void ScriptedAnimationController::scheduleAnimation()
+{
+#if USE(REQUEST_ANIMATION_FRAME_TIMER)
+ double scheduleDelay = max<double>(MinimumAnimationInterval - (currentTime() - m_lastAnimationFrameTime), 0);
+ m_animationTimer.startOneShot(scheduleDelay);
+#else
+ if (FrameView* frameView = m_document->view())
+ frameView->scheduleAnimation();
+#endif
+}
+
+#if USE(REQUEST_ANIMATION_FRAME_TIMER)
+void ScriptedAnimationController::animationTimerFired(Timer<ScriptedAnimationController>*)
+{
+ m_lastAnimationFrameTime = currentTime();
+ serviceScriptedAnimations(m_lastAnimationFrameTime);
}
+#endif
}
diff --git a/Source/WebCore/dom/ScriptedAnimationController.h b/Source/WebCore/dom/ScriptedAnimationController.h
index 7141968..ec24fb3 100644
--- a/Source/WebCore/dom/ScriptedAnimationController.h
+++ b/Source/WebCore/dom/ScriptedAnimationController.h
@@ -28,6 +28,9 @@
#if ENABLE(REQUEST_ANIMATION_FRAME)
#include "DOMTimeStamp.h"
+#if USE(REQUEST_ANIMATION_FRAME_TIMER)
+#include "Timer.h"
+#endif
#include <wtf/Noncopyable.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/RefPtr.h>
@@ -58,12 +61,21 @@ public:
private:
explicit ScriptedAnimationController(Document*);
+
typedef Vector<RefPtr<RequestAnimationFrameCallback> > CallbackList;
CallbackList m_callbacks;
Document* m_document;
CallbackId m_nextCallbackId;
int m_suspendCount;
+
+ void scheduleAnimation();
+
+#if USE(REQUEST_ANIMATION_FRAME_TIMER)
+ void animationTimerFired(Timer<ScriptedAnimationController>*);
+ Timer<ScriptedAnimationController> m_animationTimer;
+ double m_lastAnimationFrameTime;
+#endif
};
}
diff --git a/Source/WebCore/loader/EmptyClients.h b/Source/WebCore/loader/EmptyClients.h
index cedb333..75c535a 100644
--- a/Source/WebCore/loader/EmptyClients.h
+++ b/Source/WebCore/loader/EmptyClients.h
@@ -164,7 +164,7 @@ public:
#if ENABLE(TILED_BACKING_STORE)
virtual void delegatedScrollRequested(const IntPoint&) { }
#endif
-#if ENABLE(REQUEST_ANIMATION_FRAME)
+#if ENABLE(REQUEST_ANIMATION_FRAME) && !USE(REQUEST_ANIMATION_FRAME_TIMER)
virtual void scheduleAnimation() { }
#endif
diff --git a/Source/WebCore/page/Chrome.cpp b/Source/WebCore/page/Chrome.cpp
index d6cb68a..8de07f4 100644
--- a/Source/WebCore/page/Chrome.cpp
+++ b/Source/WebCore/page/Chrome.cpp
@@ -514,7 +514,9 @@ void Chrome::setCursorHiddenUntilMouseMoves(bool hiddenUntilMouseMoves)
#if ENABLE(REQUEST_ANIMATION_FRAME)
void Chrome::scheduleAnimation()
{
+#if !USE(REQUEST_ANIMATION_FRAME_TIMER)
m_client->scheduleAnimation();
+#endif
}
#endif
diff --git a/Source/WebCore/page/ChromeClient.h b/Source/WebCore/page/ChromeClient.h
index 3c9a75a..0ad7661 100644
--- a/Source/WebCore/page/ChromeClient.h
+++ b/Source/WebCore/page/ChromeClient.h
@@ -159,7 +159,7 @@ namespace WebCore {
virtual void scrollbarsModeDidChange() const = 0;
virtual void setCursor(const Cursor&) = 0;
virtual void setCursorHiddenUntilMouseMoves(bool) = 0;
-#if ENABLE(REQUEST_ANIMATION_FRAME)
+#if ENABLE(REQUEST_ANIMATION_FRAME) && !USE(REQUEST_ANIMATION_FRAME_TIMER)
virtual void scheduleAnimation() = 0;
#endif
// End methods used by HostWindow.
diff --git a/Source/WebKit/mac/ChangeLog b/Source/WebKit/mac/ChangeLog
index a900820..7e15ed2 100644
--- a/Source/WebKit/mac/ChangeLog
+++ b/Source/WebKit/mac/ChangeLog
@@ -1,3 +1,20 @@
+2011-09-09 Chris Marrin <cmarrin@apple.com>
+
+ requestAnimationFrame doesn't throttle on Mac
+ https://bugs.webkit.org/show_bug.cgi?id=67171
+
+ Reviewed by Simon Fraser.
+
+ Removed runLoopObserver for requestAnimationFrame. It's now
+ done by a Timer in ScriptedAnimationController in WebCore.
+
+ * WebCoreSupport/WebChromeClient.h:
+ * WebCoreSupport/WebChromeClient.mm:
+ * WebView/WebView.mm:
+ (-[WebView _close]):
+ * WebView/WebViewData.h:
+ * WebView/WebViewInternal.h:
+
2011-09-09 Fady Samuel <fsamuel@chromium.org>
Move pageScaleFactor code from Frame.{h|cpp} to Page.{h|cpp}
diff --git a/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h b/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h
index dc47e87..bd2d3ca 100644
--- a/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h
+++ b/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h
@@ -128,10 +128,6 @@ public:
virtual void setCursor(const WebCore::Cursor&);
virtual void setCursorHiddenUntilMouseMoves(bool);
-#if ENABLE(REQUEST_ANIMATION_FRAME)
- virtual void scheduleAnimation();
-#endif
-
virtual WebCore::FloatRect customHighlightRect(WebCore::Node*, const WTF::AtomicString& type,
const WebCore::FloatRect& lineRect);
virtual void paintCustomHighlight(WebCore::Node*, const WTF::AtomicString& type,
diff --git a/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm b/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm
index 96d657e..cf5cdce 100644
--- a/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm
+++ b/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm
@@ -942,15 +942,6 @@ void WebChromeClient::scheduleCompositingLayerSync()
#endif
-#if ENABLE(REQUEST_ANIMATION_FRAME)
-void WebChromeClient::scheduleAnimation()
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- [m_webView _scheduleAnimation];
- END_BLOCK_OBJC_EXCEPTIONS;
-}
-#endif
-
#if ENABLE(VIDEO)
bool WebChromeClient::supportsFullscreenForNode(const Node* node)
diff --git a/Source/WebKit/mac/WebView/WebView.mm b/Source/WebKit/mac/WebView/WebView.mm
index 64d6bf2..efd3db1 100644
--- a/Source/WebKit/mac/WebView/WebView.mm
+++ b/Source/WebKit/mac/WebView/WebView.mm
@@ -395,9 +395,6 @@ FindOptions coreOptions(WebFindOptions options)
#if USE(ACCELERATED_COMPOSITING)
- (void)_clearLayerSyncLoopObserver;
#endif
-#if ENABLE(REQUEST_ANIMATION_FRAME)
-- (void)_unscheduleAnimation;
-#endif
#if ENABLE(GLIB_SUPPORT)
- (void)_clearGlibLoopObserver;
#endif
@@ -1226,10 +1223,6 @@ static bool fastDocumentTeardownEnabled()
[self _clearLayerSyncLoopObserver];
#endif
-#if ENABLE(REQUEST_ANIMATION_FRAME)
- [self _unscheduleAnimation];
-#endif
-
#if ENABLE(GLIB_SUPPORT)
[self _clearGlibLoopObserver];
#endif
@@ -5921,18 +5914,6 @@ static inline uint64_t roundUpToPowerOf2(uint64_t num)
}
#endif
-#if ENABLE(REQUEST_ANIMATION_FRAME)
-- (void)_unscheduleAnimation
-{
- if (!_private->requestAnimationFrameRunLoopObserver)
- return;
-
- CFRunLoopObserverInvalidate(_private->requestAnimationFrameRunLoopObserver);
- CFRelease(_private->requestAnimationFrameRunLoopObserver);
- _private->requestAnimationFrameRunLoopObserver = 0;
-}
-#endif
-
#if ENABLE(GLIB_SUPPORT)
- (void)_clearGlibLoopObserver
{
@@ -6212,34 +6193,6 @@ static void layerSyncRunLoopObserverCallBack(CFRunLoopObserverRef, CFRunLoopActi
#endif
-#if ENABLE(REQUEST_ANIMATION_FRAME)
-static void requestAnimationFrameRunLoopObserverCallback(CFRunLoopObserverRef, CFRunLoopActivity, void* info)
-{
- WebView *webView = reinterpret_cast<WebView*>(info);
- [webView _unscheduleAnimation];
-
- if (Frame* frame = [webView _mainCoreFrame])
- if (FrameView* frameView = frame->view())
- frameView->serviceScriptedAnimations(convertSecondsToDOMTimeStamp(currentTime()));
-}
-
-- (void)_scheduleAnimation
-{
- if (!_private->requestAnimationFrameRunLoopObserver) {
- CFRunLoopRef currentRunLoop = CFRunLoopGetCurrent();
-
- // Make sure we wake up the loop or the observer could be delayed until some other source fires.
- CFRunLoopWakeUp(currentRunLoop);
-
- // Run before the layerSyncRunLoopObserver, which has order NSDisplayWindowRunLoopOrdering + 2.
- const CFIndex runLoopOrder = NSDisplayWindowRunLoopOrdering + 1;
- CFRunLoopObserverContext context = { 0, self, 0, 0, 0 };
- _private->requestAnimationFrameRunLoopObserver = CFRunLoopObserverCreate(0, kCFRunLoopBeforeWaiting | kCFRunLoopExit, NO, runLoopOrder, requestAnimationFrameRunLoopObserverCallback, &context);
- CFRunLoopAddObserver(currentRunLoop, _private->requestAnimationFrameRunLoopObserver, kCFRunLoopCommonModes);
- }
-}
-#endif
-
#if ENABLE(VIDEO)
- (void)_enterFullscreenForNode:(WebCore::Node*)node
diff --git a/Source/WebKit/mac/WebView/WebViewData.h b/Source/WebKit/mac/WebView/WebViewData.h
index dd968da..a073eb1 100644
--- a/Source/WebKit/mac/WebView/WebViewData.h
+++ b/Source/WebKit/mac/WebView/WebViewData.h
@@ -155,10 +155,6 @@ extern int pluginDatabaseClientCount;
CFRunLoopObserverRef layerSyncRunLoopObserver;
#endif
-#if ENABLE(REQUEST_ANIMATION_FRAME)
- CFRunLoopObserverRef requestAnimationFrameRunLoopObserver;
-#endif
-
NSPasteboard *insertionPasteboard;
NSSize lastLayoutSize;
diff --git a/Source/WebKit/mac/WebView/WebViewInternal.h b/Source/WebKit/mac/WebView/WebViewInternal.h
index a107b8f..43b9b08 100644
--- a/Source/WebKit/mac/WebView/WebViewInternal.h
+++ b/Source/WebKit/mac/WebView/WebViewInternal.h
@@ -93,10 +93,6 @@ WebCore::FindOptions coreOptions(WebFindOptions options);
- (void)_scheduleCompositingLayerSync;
#endif
-#if ENABLE(REQUEST_ANIMATION_FRAME)
-- (void)_scheduleAnimation;
-#endif
-
#if ENABLE(GLIB_SUPPORT)
- (void)_scheduleGlibContextIterations;
#endif
diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog
index c3884f9..3a6a0a9 100644
--- a/Source/WebKit2/ChangeLog
+++ b/Source/WebKit2/ChangeLog
@@ -1,3 +1,20 @@
+2011-09-09 Chris Marrin <cmarrin@apple.com>
+
+ requestAnimationFrame doesn't throttle on Mac
+ https://bugs.webkit.org/show_bug.cgi?id=67171
+
+ Reviewed by Simon Fraser.
+
+ Removed runLoopObserver for requestAnimationFrame. It's now
+ done by a Timer in ScriptedAnimationController in WebCore.
+
+ * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+ * WebProcess/WebCoreSupport/WebChromeClient.h:
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::~WebPage):
+ * WebProcess/WebPage/WebPage.h:
+ * WebProcess/WebPage/mac/WebPageMac.mm:
+
2011-09-09 Fady Samuel <fsamuel@chromium.org>
Move pageScaleFactor code from Frame.{h|cpp} to Page.{h|cpp}
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
index 9632c80..80d8922 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
@@ -654,13 +654,6 @@ void WebChromeClient::setCursorHiddenUntilMouseMoves(bool hiddenUntilMouseMoves)
m_page->send(Messages::WebPageProxy::SetCursorHiddenUntilMouseMoves(hiddenUntilMouseMoves));
}
-#if ENABLE(REQUEST_ANIMATION_FRAME)
-void WebChromeClient::scheduleAnimation()
-{
- m_page->scheduleAnimation();
-}
-#endif
-
void WebChromeClient::formStateDidChange(const Node*)
{
notImplemented();
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
index 8601666..b2222ac 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
@@ -172,10 +172,6 @@ private:
virtual void setCursor(const WebCore::Cursor&);
virtual void setCursorHiddenUntilMouseMoves(bool);
-#if ENABLE(REQUEST_ANIMATION_FRAME)
- virtual void scheduleAnimation();
-#endif
-
// Notification that the given form element has changed. This function
// will be called frequently, so handling should be very fast.
virtual void formStateDidChange(const WebCore::Node*);
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
index 8915bf4..5e21123 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -262,12 +262,6 @@ WebPage::~WebPage()
#if PLATFORM(MAC)
ASSERT(m_pluginViews.isEmpty());
-
-#if ENABLE(REQUEST_ANIMATION_FRAME)
- unscheduleAnimation();
- ASSERT(!m_requestAnimationFrameRunLoopObserver);
-#endif
-
#endif
#ifndef NDEBUG
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.h b/Source/WebKit2/WebProcess/WebPage/WebPage.h
index 16d4988..7179901 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.h
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.h
@@ -351,10 +351,6 @@ public:
void acceptsFirstMouse(int eventNumber, const WebKit::WebMouseEvent&, bool& result);
bool performNonEditingBehaviorForSelector(const String&);
-#if ENABLE(REQUEST_ANIMATION_FRAME)
- void scheduleAnimation();
- void unscheduleAnimation();
-#endif
#elif PLATFORM(WIN)
void confirmComposition(const String& compositionString);
void setComposition(const WTF::String& compositionString, const WTF::Vector<WebCore::CompositionUnderline>& underlines, uint64_t cursorPosition);
@@ -612,11 +608,6 @@ private:
WebCore::KeyboardEvent* m_keyboardEventBeingInterpreted;
-#if ENABLE(REQUEST_ANIMATION_FRAME)
- static void requestAnimationFrameRunLoopObserverCallback(CFRunLoopObserverRef, CFRunLoopActivity, void*);
- RetainPtr<CFRunLoopObserverRef> m_requestAnimationFrameRunLoopObserver;
-#endif
-
#elif PLATFORM(WIN)
// Our view's window (in the UI process).
HWND m_nativeWindow;
diff --git a/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm b/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
index 1e2bcdd..af35a97 100644
--- a/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
+++ b/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
@@ -30,7 +30,6 @@
#import "AttributedString.h"
#import "DataReference.h"
#import "EditorState.h"
-#import "LayerTreeHostCAMac.h"
#import "PluginView.h"
#import "WebCoreArgumentCoders.h"
#import "WebEvent.h"
@@ -584,45 +583,6 @@ bool WebPage::performNonEditingBehaviorForSelector(const String& selector)
return true;
}
-#if ENABLE(REQUEST_ANIMATION_FRAME)
-void WebPage::requestAnimationFrameRunLoopObserverCallback(CFRunLoopObserverRef, CFRunLoopActivity, void* context)
-{
- WebPage* webPage = static_cast<WebPage*>(context);
- webPage->unscheduleAnimation();
-
- // This gets called outside of the normal event loop so wrap in an autorelease pool
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- if (webPage->corePage()->mainFrame() && webPage->corePage()->mainFrame()->view())
- webPage->corePage()->mainFrame()->view()->serviceScriptedAnimations(convertSecondsToDOMTimeStamp(currentTime()));
- [pool drain];
-}
-
-void WebPage::scheduleAnimation()
-{
- if (!m_requestAnimationFrameRunLoopObserver) {
- CFRunLoopRef currentRunLoop = CFRunLoopGetCurrent();
-
- // Make sure we wake up the loop or the observer could be delayed until some other source fires.
- CFRunLoopWakeUp(currentRunLoop);
-
- // Run before the flushPendingLayerChangesRunLoopObserver, which has order CoreAnimationRunLoopOrder - 1.
- const CFIndex runLoopOrder = CoreAnimationRunLoopOrder - 2;
- CFRunLoopObserverContext context = { 0, this, 0, 0, 0 };
- m_requestAnimationFrameRunLoopObserver.adoptCF(CFRunLoopObserverCreate(0, kCFRunLoopBeforeWaiting | kCFRunLoopExit, false, runLoopOrder, requestAnimationFrameRunLoopObserverCallback, &context));
-
- CFRunLoopAddObserver(currentRunLoop, m_requestAnimationFrameRunLoopObserver.get(), kCFRunLoopCommonModes);
- }
-}
-
-void WebPage::unscheduleAnimation()
-{
- if (m_requestAnimationFrameRunLoopObserver) {
- CFRunLoopObserverInvalidate(m_requestAnimationFrameRunLoopObserver.get());
- m_requestAnimationFrameRunLoopObserver = nullptr;
- }
-}
-#endif
-
bool WebPage::performDefaultBehaviorForKeyEvent(const WebKeyboardEvent&)
{
return false;