Changeset 203145 in webkit


Ignore:
Timestamp:
Jul 12, 2016, 5:55:47 PM (9 years ago)
Author:
Simon Fraser
Message:

[iOS WK2] After zooming and when under memory pressure, page tiles sometimes don't redraw while panning
https://bugs.webkit.org/show_bug.cgi?id=159697
rdar://problem/26314075

Reviewed by Benjamin Poulain.

When under memory pressure, and after pinching back to minimum scale, WebPage::updateVisibleContentRects()
would sometimes always bail under the "boundedScale != currentScale..." condition.

This happened because the visibleContentRectUpdateInfo.scale() is a double, but m_page->pageScaleFactor()
is a float, and the constraining between min and max scale (which are doubles) caused boundedScale
to be always different from currentScale.

Fix by using floats throughout.

No test because there's no way to simulate memory pressure for testing.

  • WebProcess/WebPage/ios/WebPageIOS.mm:

(WebKit::WebPage::updateVisibleContentRects):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r203133 r203145  
     12016-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
    1232016-07-12  Chris Dumez  <cdumez@apple.com>
    224
  • trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm

    r203085 r203145  
    30213021
    30223022    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) {
    30263027        // Tiny changes of scale during interactive zoom cause content to jump by one pixel, creating
    30273028        // visual noise. We filter those useless updates.
     
    30293030    }
    30303031
    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));
    30323033
    30333034    // Skip progressively redrawing tiles if pinch-zooming while the system is under memory pressure.
     
    30483049    IntPoint scrollPosition = roundedIntPoint(visibleContentRectUpdateInfo.unobscuredContentRect().location());
    30493050
    3050     float floatBoundedScale = boundedScale;
    30513051    bool hasSetPageScale = false;
    3052     if (floatBoundedScale != currentScale) {
     3052    if (boundedScale != currentScale) {
    30533053        m_scaleWasSetByUIProcess = true;
    30543054        m_hasStablePageScaleFactor = m_isInStableState;
     
    30563056        m_dynamicSizeUpdateHistory.clear();
    30573057
    3058         m_page->setPageScaleFactor(floatBoundedScale, scrollPosition, m_isInStableState);
     3058        m_page->setPageScaleFactor(boundedScale, scrollPosition, m_isInStableState);
    30593059        hasSetPageScale = true;
    3060         send(Messages::WebPageProxy::PageScaleFactorDidChange(floatBoundedScale));
     3060        send(Messages::WebPageProxy::PageScaleFactorDidChange(boundedScale));
    30613061    }
    30623062
    30633063    if (!hasSetPageScale && m_isInStableState) {
    3064         m_page->setPageScaleFactor(floatBoundedScale, scrollPosition, true);
     3064        m_page->setPageScaleFactor(boundedScale, scrollPosition, true);
    30653065        hasSetPageScale = true;
    30663066    }
Note: See TracChangeset for help on using the changeset viewer.