Title: [169064] trunk/Source/WebKit2
Revision
169064
Author
[email protected]
Date
2014-05-19 14:02:24 -0700 (Mon, 19 May 2014)

Log Message

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

Patch by Benjamin Poulain <[email protected]> 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):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (169063 => 169064)


--- trunk/Source/WebKit2/ChangeLog	2014-05-19 20:23:10 UTC (rev 169063)
+++ trunk/Source/WebKit2/ChangeLog	2014-05-19 21:02:24 UTC (rev 169064)
@@ -1,3 +1,20 @@
+2014-05-19  Benjamin Poulain  <[email protected]>
+
+        [iOS][WK2] Move scale noise filtering to the WebProcess
+        https://bugs.webkit.org/show_bug.cgi?id=133021
+
+        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):
+
 2014-05-19  Simon Fraser  <[email protected]>
 
         Split scrolling tree ScrollingNodes into FrameScrollingNodes and OverflowScrollingNodes

Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm (169063 => 169064)


--- trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm	2014-05-19 20:23:10 UTC (rev 169063)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm	2014-05-19 21:02:24 UTC (rev 169064)
@@ -302,17 +302,9 @@
     else
         _historicalKinematicData.clear();
 
-    double scaleNoiseThreshold = 0.0005;
-    CGFloat filteredScale = zoomScale;
-    if (!isStableState && fabs(filteredScale - _page->displayedContentScale()) < scaleNoiseThreshold) {
-        // Tiny changes of scale during interactive zoom cause content to jump by one pixel, creating
-        // visual noise. We filter those useless updates.
-        filteredScale = _page->displayedContentScale();
-    }
-
     FloatRect fixedPositionRectForLayout = _page->computeCustomFixedPositionRect(unobscuredRect, zoomScale, WebPageProxy::UnobscuredRectConstraint::ConstrainedToDocumentRect);
     _page->updateVisibleContentRects(VisibleContentRectUpdateInfo(_page->nextVisibleContentRectUpdateID(), visibleRect, unobscuredRect, unobscuredRectInScrollViewCoordinates, fixedPositionRectForLayout,
-        filteredScale, isStableState, isChangingObscuredInsetsInteractively, timestamp, velocityData.horizontalVelocity, velocityData.verticalVelocity, velocityData.scaleChangeRate));
+        zoomScale, isStableState, isChangingObscuredInsetsInteractively, timestamp, velocityData.horizontalVelocity, velocityData.verticalVelocity, velocityData.scaleChangeRate));
 
     RemoteScrollingCoordinatorProxy* scrollingCoordinator = _page->scrollingCoordinatorProxy();
     scrollingCoordinator->viewportChangedViaDelegatedScrolling(scrollingCoordinator->rootScrollingNodeID(), _page->computeCustomFixedPositionRect(_page->unobscuredContentRect(), zoomScale), zoomScale);

Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (169063 => 169064)


--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2014-05-19 20:23:10 UTC (rev 169063)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2014-05-19 21:02:24 UTC (rev 169064)
@@ -2203,8 +2203,17 @@
     m_hasReceivedVisibleContentRectsAfterDidCommitLoad = true;
     m_lastVisibleContentRectUpdateID = visibleContentRectUpdateInfo.updateID();
 
-    double boundedScale = std::min(m_viewportConfiguration.maximumScale(), std::max(m_viewportConfiguration.minimumScale(), visibleContentRectUpdateInfo.scale()));
+    double scaleNoiseThreshold = 0.005;
+    double filteredScale = visibleContentRectUpdateInfo.scale();
+    double currentScale = m_page->pageScaleFactor();
+    if (!visibleContentRectUpdateInfo.inStableState() && fabs(filteredScale - m_page->pageScaleFactor()) < scaleNoiseThreshold) {
+        // Tiny changes of scale during interactive zoom cause content to jump by one pixel, creating
+        // visual noise. We filter those useless updates.
+        filteredScale = currentScale;
+    }
 
+    double boundedScale = std::min(m_viewportConfiguration.maximumScale(), std::max(m_viewportConfiguration.minimumScale(), filteredScale));
+
     FloatRect exposedRect = visibleContentRectUpdateInfo.exposedRect();
     FloatRect adjustedExposedRect = adjustExposedRectForBoundedScale(exposedRect, visibleContentRectUpdateInfo.scale(), boundedScale);
     m_drawingArea->setExposedContentRect(enclosingIntRect(adjustedExposedRect));
@@ -2214,7 +2223,7 @@
 
     float floatBoundedScale = boundedScale;
     bool hasSetPageScale = false;
-    if (floatBoundedScale != m_page->pageScaleFactor()) {
+    if (floatBoundedScale != currentScale) {
         m_scaleWasSetByUIProcess = true;
 
         m_dynamicSizeUpdateHistory.clear();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to