Changeset 219314 in webkit


Ignore:
Timestamp:
Jul 10, 2017 4:28:27 PM (7 years ago)
Author:
Chris Dumez
Message:

[iOS] _didCommitLayerTree should avoid calling [scrollView setZoomScale] unnecessarily
https://bugs.webkit.org/show_bug.cgi?id=174326
<rdar://problem/33150490>

Reviewed by Simon Fraser.

Only call [scrollView setZoomScale] if the new zoom scale is actually different to
avoid doing unnecessary work in UIKit.

  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView _didCommitLayerTree:]):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r219312 r219314  
     12017-07-10  Chris Dumez  <cdumez@apple.com>
     2
     3        [iOS] _didCommitLayerTree should avoid calling [scrollView setZoomScale] unnecessarily
     4        https://bugs.webkit.org/show_bug.cgi?id=174326
     5        <rdar://problem/33150490>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Only call [scrollView setZoomScale] if the new zoom scale is actually different to
     10        avoid doing unnecessary work in UIKit.
     11
     12        * UIProcess/API/Cocoa/WKWebView.mm:
     13        (-[WKWebView _didCommitLayerTree:]):
     14
    1152017-07-10  Chris Dumez  <cdumez@apple.com>
    216
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm

    r219310 r219314  
    15101510    [_scrollView setMaximumZoomScale:layerTreeTransaction.maximumScaleFactor()];
    15111511    [_scrollView setZoomEnabled:layerTreeTransaction.allowsUserScaling()];
    1512     if (!layerTreeTransaction.scaleWasSetByUIProcess() && ![_scrollView isZooming] && ![_scrollView isZoomBouncing] && ![_scrollView _isAnimatingZoom])
     1512    if (!layerTreeTransaction.scaleWasSetByUIProcess() && ![_scrollView isZooming] && ![_scrollView isZoomBouncing] && ![_scrollView _isAnimatingZoom] && [_scrollView zoomScale] != layerTreeTransaction.pageScaleFactor())
    15131513        [_scrollView setZoomScale:layerTreeTransaction.pageScaleFactor()];
    15141514
Note: See TracChangeset for help on using the changeset viewer.