Changeset 123786 in webkit
- Timestamp:
- Jul 26, 2012 1:15:53 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r123744 r123786 1 2012-07-26 Zeno Albisser <zeno@webkit.org> 2 3 [Qt] requestAnimationFrame should only trigger when a new frame can be displayed. 4 https://bugs.webkit.org/show_bug.cgi?id=88638 5 6 Disable REQUEST_ANIMATION_FRAME_TIMER for the Qt port and tie 7 the servicing of scripted animations to layer syncing for WK2. 8 For WK1 we rely on the RefreshAnimation that is based on QAbstractAnimation. 9 10 Reviewed by Jocelyn Turcotte. 11 12 * wtf/Platform.h: 13 1 14 2012-07-26 Yury Semikhatsky <yurys@chromium.org> 2 15 -
trunk/Source/WTF/wtf/Platform.h
r123590 r123786 1106 1106 #endif 1107 1107 1108 #if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(EFL) || (PLATFORM(WIN) && !OS(WINCE) && !PLATFORM(WIN_CAIRO)) || PLATFORM( QT) || PLATFORM(BLACKBERRY)1108 #if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(EFL) || (PLATFORM(WIN) && !OS(WINCE) && !PLATFORM(WIN_CAIRO)) || PLATFORM(BLACKBERRY) 1109 1109 #define WTF_USE_REQUEST_ANIMATION_FRAME_TIMER 1 1110 1110 #endif -
trunk/Source/WebKit/qt/ChangeLog
r123711 r123786 1 2012-07-26 Zeno Albisser <zeno@webkit.org> 2 3 [Qt] requestAnimationFrame should only trigger when a new frame can be displayed. 4 https://bugs.webkit.org/show_bug.cgi?id=88638 5 6 Disable REQUEST_ANIMATION_FRAME_TIMER for the Qt port and tie 7 the servicing of scripted animations to the renderNextFrame call for WK2. 8 For WK1 we rely on the RefreshAnimation that is based on QAbstractAnimation. 9 10 Reviewed by Jocelyn Turcotte. 11 12 * WebCoreSupport/ChromeClientQt.cpp: 13 (RefreshAnimation): 14 Add a RefreshAnimation that is based on QAbstractAnimation 15 and drives the servicing of the scripted animations for WK1. 16 (WebCore::RefreshAnimation::RefreshAnimation): 17 (WebCore::RefreshAnimation::duration): 18 (WebCore::RefreshAnimation::scheduleAnimation): 19 Set m_animationScheduled to true and start the animation 20 timer in case it is not running yet. 21 (WebCore::RefreshAnimation::updateCurrentTime): 22 Call serviceScriptedAnimations if m_animationScheduled is true. 23 If this is not the case, the animation timer can be stopped, 24 because no animation needs to be scheduled anymore. 25 (WebCore): 26 (WebCore::ChromeClientQt::scheduleAnimation): 27 Create and start the RefreshAnimation instance with the 28 first call to scheduleAnimation. 29 * WebCoreSupport/ChromeClientQt.h: 30 (WebCore): 31 (ChromeClientQt): 32 1 33 2012-07-26 Kaustubh Atrawalkar <kaustubh@motorola.com> 2 34 -
trunk/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
r123458 r123786 71 71 #include "qwebsecurityorigin_p.h" 72 72 #include "qwebview.h" 73 #include <qabstractanimation.h> 73 74 #include <qdebug.h> 74 75 #include <qeventloop.h> … … 88 89 89 90 namespace WebCore { 91 92 class RefreshAnimation : public QAbstractAnimation { 93 public: 94 RefreshAnimation(ChromeClientQt* chromeClient) 95 : QAbstractAnimation() 96 , m_chromeClient(chromeClient) 97 , m_animationScheduled(false) 98 { } 99 100 virtual int duration() const { return -1; } 101 102 void scheduleAnimation() 103 { 104 m_animationScheduled = true; 105 if (state() != QAbstractAnimation::Running) 106 start(); 107 } 108 109 protected: 110 virtual void updateCurrentTime(int currentTime) 111 { 112 UNUSED_PARAM(currentTime); 113 if (m_animationScheduled) { 114 m_animationScheduled = false; 115 m_chromeClient->serviceScriptedAnimations(); 116 } else 117 stop(); 118 } 119 private: 120 ChromeClientQt* m_chromeClient; 121 bool m_animationScheduled; 122 }; 90 123 91 124 bool ChromeClientQt::dumpVisitedLinksCallbacks = false; … … 619 652 } 620 653 654 void ChromeClientQt::scheduleAnimation() 655 { 656 if (!m_refreshAnimation) 657 m_refreshAnimation = adoptPtr(new RefreshAnimation(this)); 658 m_refreshAnimation->scheduleAnimation(); 659 } 660 661 void ChromeClientQt::serviceScriptedAnimations() 662 { 663 m_webPage->mainFrame()->d->frame->view()->serviceScriptedAnimations(convertSecondsToDOMTimeStamp(currentTime())); 664 } 621 665 622 666 #if USE(ACCELERATED_COMPOSITING) -
trunk/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h
r123354 r123786 50 50 class FloatRect; 51 51 class Page; 52 class RefreshAnimation; 52 53 struct FrameLoadRequest; 53 54 class QtAbstractWebPopup; … … 177 178 virtual void setCursorHiddenUntilMouseMoves(bool) { } 178 179 180 virtual void scheduleAnimation(); 181 virtual void serviceScriptedAnimations(); 182 179 183 virtual void scrollRectIntoView(const LayoutRect) const { } 180 184 … … 202 206 bool menuBarVisible; 203 207 QEventLoop* m_eventLoop; 208 OwnPtr<RefreshAnimation> m_refreshAnimation; 204 209 205 210 #if ENABLE(VIDEO) && (USE(GSTREAMER) || USE(QT_MULTIMEDIA) || USE(QTKIT)) -
trunk/Source/WebKit2/ChangeLog
r123782 r123786 1 2012-07-26 Zeno Albisser <zeno@webkit.org> 2 3 [Qt] requestAnimationFrame should only trigger when a new frame can be displayed. 4 https://bugs.webkit.org/show_bug.cgi?id=88638 5 6 Disable REQUEST_ANIMATION_FRAME_TIMER for the Qt port and tie 7 the servicing of scripted animations to layer syncing for WK2. 8 For WK1 we rely on the RefreshAnimation that is based on QAbstractAnimation. 9 10 Reviewed by Jocelyn Turcotte. 11 12 * WebProcess/WebCoreSupport/WebChromeClient.cpp: 13 (WebKit): 14 (WebKit::WebChromeClient::scheduleAnimation): 15 * WebProcess/WebCoreSupport/WebChromeClient.h: 16 (WebChromeClient): 17 * WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.cpp: 18 (WebKit::LayerTreeCoordinator::performScheduledLayerFlush): 19 (WebKit::LayerTreeCoordinator::scheduleAnimation): 20 (WebKit): 21 * WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.h: 22 (LayerTreeCoordinator): 23 * WebProcess/WebPage/LayerTreeHost.h: 24 (LayerTreeHost): 25 1 26 2012-07-26 Jer Noble <jer.noble@apple.com> 2 27 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
r123778 r123786 636 636 } 637 637 638 #if ENABLE(REQUEST_ANIMATION_FRAME) && !USE(REQUEST_ANIMATION_FRAME_TIMER) 639 void WebChromeClient::scheduleAnimation() 640 { 641 #if USE(UI_SIDE_COMPOSITING) 642 m_page->drawingArea()->layerTreeHost()->scheduleAnimation(); 643 #endif 644 } 645 #endif 646 638 647 void WebChromeClient::formStateDidChange(const Node*) 639 648 { -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
r123778 r123786 163 163 virtual void setCursor(const WebCore::Cursor&) OVERRIDE; 164 164 virtual void setCursorHiddenUntilMouseMoves(bool) OVERRIDE; 165 #if ENABLE(REQUEST_ANIMATION_FRAME) && !USE(REQUEST_ANIMATION_FRAME_TIMER) 166 virtual void scheduleAnimation() OVERRIDE; 167 #endif 165 168 166 169 // Notification that the given form element has changed. This function -
trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.cpp
r122720 r123786 357 357 if (m_isSuspended || m_waitingForUIProcess) 358 358 return; 359 #if ENABLE(REQUEST_ANIMATION_FRAME) && !USE(REQUEST_ANIMATION_FRAME_TIMER) && !USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) 360 // Make sure that any previously registered animation callbacks are being executed before we flush the layers. 361 m_webPage->corePage()->mainFrame()->view()->serviceScriptedAnimations(convertSecondsToDOMTimeStamp(currentTime())); 362 #endif 359 363 360 364 m_webPage->layoutIfNeeded(); … … 543 547 if (contentsRectDidChange) 544 548 m_shouldSendScrollPositionUpdate = true; 549 } 550 551 void LayerTreeCoordinator::scheduleAnimation() 552 { 553 scheduleLayerFlush(); 545 554 } 546 555 -
trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.h
r122340 r123786 87 87 88 88 virtual PassOwnPtr<WebCore::GraphicsContext> beginContentUpdate(const WebCore::IntSize&, ShareableBitmap::Flags, ShareableSurface::Handle&, WebCore::IntPoint&); 89 virtual void scheduleAnimation() OVERRIDE; 89 90 90 91 protected: -
trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h
r122676 r123786 106 106 #endif 107 107 108 #if USE(UI_SIDE_COMPOSITING) 109 virtual void scheduleAnimation() = 0; 110 #endif 111 108 112 protected: 109 113 explicit LayerTreeHost(WebPage*);
Note: See TracChangeset
for help on using the changeset viewer.