⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 169064 in webkit


Ignore:
Timestamp:
May 19, 2014, 2:02:24 PM (12 years ago)
Author:
benjamin@webkit.org
Message:

[iOS][WK2] Move scale noise filtering to the WebProcess
​https://bugs.webkit.org/show_bug.cgi?id=133021

Patch by Benjamin Poulain <​bpoulain@apple.com> on 2014-05-19
Reviewed by Darin Adler.

Filtering in the UIProcess was stupid. It forces to handle a third kind of scale just for updates.

The WebProcess already adjusts the input scale based on the viewport. Changing the input scale at that level
is already supported. It is a better place to have the filtering.

  • UIProcess/ios/WKContentView.mm:

(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):

  • WebProcess/WebPage/ios/WebPageIOS.mm:

(WebKit::WebPage::updateVisibleContentRects):

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r169063 r169064  
     12014-05-19  Benjamin Poulain  <bpoulain@apple.com>
     2
     3        [iOS][WK2] Move scale noise filtering to the WebProcess
     4        https://bugs.webkit.org/show_bug.cgi?id=133021
     5
     6        Reviewed by Darin Adler.
     7
     8        Filtering in the UIProcess was stupid. It forces to handle a third kind of scale just for updates.
     9
     10        The WebProcess already adjusts the input scale based on the viewport. Changing the input scale at that level
     11        is already supported. It is a better place to have the filtering.
     12
     13        * UIProcess/ios/WKContentView.mm:
     14        (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
     15        * WebProcess/WebPage/ios/WebPageIOS.mm:
     16        (WebKit::WebPage::updateVisibleContentRects):
     17
    1182014-05-19  Simon Fraser  <simon.fraser@apple.com>
    219
  • trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm

    r168920 r169064  
    303303        _historicalKinematicData.clear();
    304304
    305     double scaleNoiseThreshold = 0.0005;
    306     CGFloat filteredScale = zoomScale;
    307     if (!isStableState && fabs(filteredScale - _page->displayedContentScale()) < scaleNoiseThreshold) {
    308         // Tiny changes of scale during interactive zoom cause content to jump by one pixel, creating
    309         // visual noise. We filter those useless updates.
    310         filteredScale = _page->displayedContentScale();
    311     }
    312 
    313305    FloatRect fixedPositionRectForLayout = _page->computeCustomFixedPositionRect(unobscuredRect, zoomScale, WebPageProxy::UnobscuredRectConstraint::ConstrainedToDocumentRect);
    314306    _page->updateVisibleContentRects(VisibleContentRectUpdateInfo(_page->nextVisibleContentRectUpdateID(), visibleRect, unobscuredRect, unobscuredRectInScrollViewCoordinates, fixedPositionRectForLayout,
    315         filteredScale, isStableState, isChangingObscuredInsetsInteractively, timestamp, velocityData.horizontalVelocity, velocityData.verticalVelocity, velocityData.scaleChangeRate));
     307        zoomScale, isStableState, isChangingObscuredInsetsInteractively, timestamp, velocityData.horizontalVelocity, velocityData.verticalVelocity, velocityData.scaleChangeRate));
    316308
    317309    RemoteScrollingCoordinatorProxy* scrollingCoordinator = _page->scrollingCoordinatorProxy();
  • trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm

    r168982 r169064  
    22042204    m_lastVisibleContentRectUpdateID = visibleContentRectUpdateInfo.updateID();
    22052205
    2206     double boundedScale = std::min(m_viewportConfiguration.maximumScale(), std::max(m_viewportConfiguration.minimumScale(), visibleContentRectUpdateInfo.scale()));
     2206    double scaleNoiseThreshold = 0.005;
     2207    double filteredScale = visibleContentRectUpdateInfo.scale();
     2208    double currentScale = m_page->pageScaleFactor();
     2209    if (!visibleContentRectUpdateInfo.inStableState() && fabs(filteredScale - m_page->pageScaleFactor()) < scaleNoiseThreshold) {
     2210        // Tiny changes of scale during interactive zoom cause content to jump by one pixel, creating
     2211        // visual noise. We filter those useless updates.
     2212        filteredScale = currentScale;
     2213    }
     2214
     2215    double boundedScale = std::min(m_viewportConfiguration.maximumScale(), std::max(m_viewportConfiguration.minimumScale(), filteredScale));
    22072216
    22082217    FloatRect exposedRect = visibleContentRectUpdateInfo.exposedRect();
    … …  
    22152224    float floatBoundedScale = boundedScale;
    22162225    bool hasSetPageScale = false;
    2217     if (floatBoundedScale != m_page->pageScaleFactor()) {
     2226    if (floatBoundedScale != currentScale) {
    22182227        m_scaleWasSetByUIProcess = true;
    22192228
Note: See TracChangeset for help on using the changeset viewer.