Changeset 231818 in webkit
- Timestamp:
- May 15, 2018, 4:06:28 PM (7 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r231814 r231818 1 2018-05-15 Per Arne Vollan <pvollan@apple.com> 2 3 Pause display links when window is not visible. 4 https://bugs.webkit.org/show_bug.cgi?id=185627 5 <rdar://problem/39401106> 6 7 Reviewed by Simon Fraser. 8 9 Pause/resume display links created in the UI process when the window is hidden/shown. 10 11 * UIProcess/WebPageProxy.cpp: 12 (WebKit::WebPageProxy::dispatchActivityStateChange): 13 * UIProcess/mac/DisplayLink.cpp: 14 (WebKit::DisplayLink::pause): 15 (WebKit::DisplayLink::resume): 16 * UIProcess/mac/DisplayLink.h: 17 1 18 2018-05-15 Dean Jackson <dino@apple.com> 2 19 -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r231795 r231818 1587 1587 1588 1588 if (changed & ActivityState::IsVisible) { 1589 if (isViewVisible()) 1589 if (isViewVisible()) { 1590 1590 m_visiblePageToken = m_process->visiblePageToken(); 1591 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 1592 if (m_displayLink) 1593 m_displayLink->resume(); 1594 #endif 1595 } 1591 1596 else { 1592 1597 m_visiblePageToken = nullptr; … … 1596 1601 // stop the unresponsiveness timer here. 1597 1602 m_process->responsivenessTimer().stop(); 1603 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 1604 if (m_displayLink) 1605 m_displayLink->pause(); 1606 #endif 1598 1607 } 1599 1608 } -
trunk/Source/WebKit/UIProcess/mac/DisplayLink.cpp
r230747 r231818 82 82 } 83 83 84 void DisplayLink::pause() 85 { 86 if (!CVDisplayLinkIsRunning(m_displayLink)) 87 return; 88 CVDisplayLinkStop(m_displayLink); 89 } 90 91 void DisplayLink::resume() 92 { 93 if (CVDisplayLinkIsRunning(m_displayLink)) 94 return; 95 CVDisplayLinkStart(m_displayLink); 96 } 97 84 98 CVReturn DisplayLink::displayLinkCallback(CVDisplayLinkRef displayLinkRef, const CVTimeStamp*, const CVTimeStamp*, CVOptionFlags, CVOptionFlags*, void* data) 85 99 { -
trunk/Source/WebKit/UIProcess/mac/DisplayLink.h
r230747 r231818 46 46 bool hasObservers() const; 47 47 48 void pause(); 49 void resume(); 50 48 51 private: 49 52 static CVReturn displayLinkCallback(CVDisplayLinkRef, const CVTimeStamp*, const CVTimeStamp*, CVOptionFlags, CVOptionFlags*, void* data);
Note:
See TracChangeset
for help on using the changeset viewer.