Changeset 150071 in webkit
- Timestamp:
- May 14, 2013 9:17:09 AM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r150062 r150071 1 2013-05-14 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [BlackBerry] Use requestAnimationFrame for animations 4 https://bugs.webkit.org/show_bug.cgi?id=115896 5 6 Reviewed by Rob Buis. 7 8 * wtf/Platform.h: Disable REQUEST_ANIMATION_FRAME_TIMER and 9 WTF_USE_REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR for BlackBerry 10 port. 11 1 12 2013-05-14 Carlos Garcia Campos <cgarcia@igalia.com> 2 13 -
trunk/Source/WTF/wtf/Platform.h
r150062 r150071 976 976 #endif 977 977 978 #if PLATFORM(MAC) || PLATFORM(GTK) || (PLATFORM(WIN) && !OS(WINCE) && !PLATFORM(WIN_CAIRO)) || PLATFORM(BLACKBERRY)978 #if PLATFORM(MAC) || PLATFORM(GTK) || (PLATFORM(WIN) && !OS(WINCE) && !PLATFORM(WIN_CAIRO)) 979 979 #define WTF_USE_REQUEST_ANIMATION_FRAME_TIMER 1 980 980 #endif 981 981 982 #if PLATFORM(MAC) || PLATFORM(BLACKBERRY)982 #if PLATFORM(MAC) 983 983 #define WTF_USE_REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR 1 984 984 #endif -
trunk/Source/WebKit/blackberry/Api/WebPage.cpp
r150060 r150071 430 430 , m_didStartAnimations(false) 431 431 , m_animationStartTime(0) 432 #if ENABLE(REQUEST_ANIMATION_FRAME) && !USE(REQUEST_ANIMATION_FRAME_TIMER) 433 , m_isRunningRefreshAnimationClient(false) 434 , m_animationScheduled(false) 435 #endif 432 436 { 433 437 static bool isInitialized = false; … … 455 459 if (BackingStorePrivate::currentBackingStoreOwner() == m_webPage) 456 460 BackingStorePrivate::setCurrentBackingStoreOwner(0); 461 462 #if ENABLE(REQUEST_ANIMATION_FRAME) && !USE(REQUEST_ANIMATION_FRAME_TIMER) 463 stopRefreshAnimationClient(); 464 cancelCallOnMainThread(handleServiceScriptedAnimationsOnMainThread, this); 465 #endif 457 466 458 467 delete m_webSettings; … … 6308 6317 } 6309 6318 6310 } 6311 } 6319 #if ENABLE(REQUEST_ANIMATION_FRAME) && !USE(REQUEST_ANIMATION_FRAME_TIMER) 6320 void WebPagePrivate::animationFrameChanged() 6321 { 6322 if (!m_animationMutex.tryLock()) 6323 return; 6324 6325 if (!m_animationScheduled) { 6326 stopRefreshAnimationClient(); 6327 m_animationMutex.unlock(); 6328 return; 6329 } 6330 6331 m_animationScheduled = false; 6332 callOnMainThread(handleServiceScriptedAnimationsOnMainThread, this); 6333 m_animationMutex.unlock(); 6334 } 6335 6336 void WebPagePrivate::scheduleAnimation() 6337 { 6338 if (m_animationScheduled) 6339 return; 6340 MutexLocker lock(m_animationMutex); 6341 m_animationScheduled = true; 6342 startRefreshAnimationClient(); 6343 } 6344 6345 void WebPagePrivate::startRefreshAnimationClient() 6346 { 6347 if (m_isRunningRefreshAnimationClient) 6348 return; 6349 m_isRunningRefreshAnimationClient = true; 6350 BlackBerry::Platform::AnimationFrameRateController::instance()->addClient(this); 6351 } 6352 6353 void WebPagePrivate::stopRefreshAnimationClient() 6354 { 6355 if (!m_isRunningRefreshAnimationClient) 6356 return; 6357 m_isRunningRefreshAnimationClient = false; 6358 BlackBerry::Platform::AnimationFrameRateController::instance()->removeClient(this); 6359 } 6360 6361 void WebPagePrivate::handleServiceScriptedAnimationsOnMainThread(void* data) 6362 { 6363 WebPagePrivate* webPagePrivate = static_cast<WebPagePrivate*>(data); 6364 webPagePrivate->m_mainFrame->view()->serviceScriptedAnimations(currentTime()); 6365 } 6366 #endif 6367 6368 } 6369 } -
trunk/Source/WebKit/blackberry/Api/WebPage_p.h
r150060 r150071 100 100 #if USE(ACCELERATED_COMPOSITING) 101 101 , public WebCore::GraphicsLayerClient 102 #endif 103 #if ENABLE(REQUEST_ANIMATION_FRAME) && !USE(REQUEST_ANIMATION_FRAME_TIMER) 104 , public BlackBerry::Platform::AnimationFrameRateClient 102 105 #endif 103 106 , public Platform::GuardedPointerBase { … … 455 458 WebCore::Color documentBackgroundColor() const; 456 459 460 #if ENABLE(REQUEST_ANIMATION_FRAME) && !USE(REQUEST_ANIMATION_FRAME_TIMER) 461 // BlackBerry::Platform::AnimationFrameRateClient. 462 virtual void animationFrameChanged(); 463 void scheduleAnimation(); 464 void startRefreshAnimationClient(); 465 void stopRefreshAnimationClient(); 466 static void handleServiceScriptedAnimationsOnMainThread(void*); 467 #endif 468 457 469 WebPage* m_webPage; 458 470 WebPageClient* m_client; … … 641 653 double m_animationStartTime; 642 654 655 #if ENABLE(REQUEST_ANIMATION_FRAME) && !USE(REQUEST_ANIMATION_FRAME_TIMER) 656 Mutex m_animationMutex; 657 bool m_isRunningRefreshAnimationClient; 658 bool m_animationScheduled; 659 #endif 660 643 661 protected: 644 662 virtual ~WebPagePrivate(); -
trunk/Source/WebKit/blackberry/ChangeLog
r150062 r150071 1 2013-05-14 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [BlackBerry] Use requestAnimationFrame for animations 4 https://bugs.webkit.org/show_bug.cgi?id=115896 5 6 Reviewed by Rob Buis. 7 8 Make WebPagePrivate a 9 BlackBerry::Platform::AnimationFrameRateClient and use it to 10 schedule animations. 11 12 * Api/WebPage.cpp: 13 (BlackBerry::WebKit::WebPagePrivate::WebPagePrivate): 14 (BlackBerry::WebKit::WebPagePrivate::~WebPagePrivate): 15 (WebKit): 16 (BlackBerry::WebKit::WebPagePrivate::animationFrameChanged): 17 (BlackBerry::WebKit::WebPagePrivate::scheduleAnimation): 18 (BlackBerry::WebKit::WebPagePrivate::startRefreshAnimationClient): 19 (BlackBerry::WebKit::WebPagePrivate::stopRefreshAnimationClient): 20 (BlackBerry::WebKit::WebPagePrivate::handleServiceScriptedAnimationsOnMainThread): 21 * Api/WebPage_p.h: 22 (WebPagePrivate): 23 * WebCoreSupport/ChromeClientBlackBerry.cpp: 24 (WebCore): 25 (WebCore::ChromeClientBlackBerry::scheduleAnimation): 26 * WebCoreSupport/ChromeClientBlackBerry.h: 27 (ChromeClientBlackBerry): 28 1 29 2013-05-14 Carlos Garcia Campos <cgarcia@igalia.com> 2 30 -
trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp
r149125 r150071 825 825 } 826 826 827 #if ENABLE(REQUEST_ANIMATION_FRAME) && !USE(REQUEST_ANIMATION_FRAME_TIMER) 828 void ChromeClientBlackBerry::scheduleAnimation() 829 { 830 m_webPagePrivate->scheduleAnimation(); 831 } 832 #endif 833 827 834 } // namespace WebCore -
trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.h
r149818 r150071 152 152 #endif 153 153 154 #if ENABLE(REQUEST_ANIMATION_FRAME) && !USE(REQUEST_ANIMATION_FRAME_TIMER) 155 virtual void scheduleAnimation(); 156 #endif 157 154 158 BlackBerry::WebKit::WebPagePrivate* webPagePrivate() const { return m_webPagePrivate; } 155 159
Note: See TracChangeset
for help on using the changeset viewer.