Changeset 203145 in webkit
- Timestamp:
- Jul 12, 2016, 5:55:47 PM (9 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r203133 r203145 1 2016-07-12 Simon Fraser <simon.fraser@apple.com> 2 3 [iOS WK2] After zooming and when under memory pressure, page tiles sometimes don't redraw while panning 4 https://bugs.webkit.org/show_bug.cgi?id=159697 5 rdar://problem/26314075 6 7 Reviewed by Benjamin Poulain. 8 9 When under memory pressure, and after pinching back to minimum scale, WebPage::updateVisibleContentRects() 10 would sometimes always bail under the "boundedScale != currentScale..." condition. 11 12 This happened because the visibleContentRectUpdateInfo.scale() is a double, but m_page->pageScaleFactor() 13 is a float, and the constraining between min and max scale (which are doubles) caused boundedScale 14 to be always different from currentScale. 15 16 Fix by using floats throughout. 17 18 No test because there's no way to simulate memory pressure for testing. 19 20 * WebProcess/WebPage/ios/WebPageIOS.mm: 21 (WebKit::WebPage::updateVisibleContentRects): 22 1 23 2016-07-12 Chris Dumez <cdumez@apple.com> 2 24 -
trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm
r203085 r203145 3021 3021 3022 3022 double scaleNoiseThreshold = 0.005; 3023 double filteredScale = visibleContentRectUpdateInfo.scale(); 3024 double currentScale = m_page->pageScaleFactor(); 3025 if (!m_isInStableState && fabs(filteredScale - m_page->pageScaleFactor()) < scaleNoiseThreshold) { 3023 float filteredScale = visibleContentRectUpdateInfo.scale(); 3024 float currentScale = m_page->pageScaleFactor(); 3025 3026 if (!m_isInStableState && fabs(filteredScale - currentScale) < scaleNoiseThreshold) { 3026 3027 // Tiny changes of scale during interactive zoom cause content to jump by one pixel, creating 3027 3028 // visual noise. We filter those useless updates. … … 3029 3030 } 3030 3031 3031 double boundedScale = std::min(m_viewportConfiguration.maximumScale(), std::max(m_viewportConfiguration.minimumScale(), filteredScale));3032 float boundedScale = std::min<float>(m_viewportConfiguration.maximumScale(), std::max<float>(m_viewportConfiguration.minimumScale(), filteredScale)); 3032 3033 3033 3034 // Skip progressively redrawing tiles if pinch-zooming while the system is under memory pressure. … … 3048 3049 IntPoint scrollPosition = roundedIntPoint(visibleContentRectUpdateInfo.unobscuredContentRect().location()); 3049 3050 3050 float floatBoundedScale = boundedScale;3051 3051 bool hasSetPageScale = false; 3052 if ( floatBoundedScale != currentScale) {3052 if (boundedScale != currentScale) { 3053 3053 m_scaleWasSetByUIProcess = true; 3054 3054 m_hasStablePageScaleFactor = m_isInStableState; … … 3056 3056 m_dynamicSizeUpdateHistory.clear(); 3057 3057 3058 m_page->setPageScaleFactor( floatBoundedScale, scrollPosition, m_isInStableState);3058 m_page->setPageScaleFactor(boundedScale, scrollPosition, m_isInStableState); 3059 3059 hasSetPageScale = true; 3060 send(Messages::WebPageProxy::PageScaleFactorDidChange( floatBoundedScale));3060 send(Messages::WebPageProxy::PageScaleFactorDidChange(boundedScale)); 3061 3061 } 3062 3062 3063 3063 if (!hasSetPageScale && m_isInStableState) { 3064 m_page->setPageScaleFactor( floatBoundedScale, scrollPosition, true);3064 m_page->setPageScaleFactor(boundedScale, scrollPosition, true); 3065 3065 hasSetPageScale = true; 3066 3066 }
Note:
See TracChangeset
for help on using the changeset viewer.