Title: [209690] trunk/Source/WebKit2
Revision
209690
Author
[email protected]
Date
2016-12-11 17:10:00 -0800 (Sun, 11 Dec 2016)

Log Message

Quarter-second stalls scrolling images that are links because of sync getPositionInformation
https://bugs.webkit.org/show_bug.cgi?id=165707

Reviewed by Simon Fraser.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView positionInformationForActionSheetAssistant:]):
(-[WKContentView updatePositionInformationForActionSheetAssistant:]):
For now, synchronously block when presenting the action sheet if we
don't have a snapshot ready.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):
Respect includeSnapshot in another place in getPositionInformation,
so that many getPositionInformations don't have to do extra snapshotting work.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (209689 => 209690)


--- trunk/Source/WebKit2/ChangeLog	2016-12-12 00:57:02 UTC (rev 209689)
+++ trunk/Source/WebKit2/ChangeLog	2016-12-12 01:10:00 UTC (rev 209690)
@@ -1,3 +1,21 @@
+2016-12-11  Tim Horton  <[email protected]>
+
+        Quarter-second stalls scrolling images that are links because of sync getPositionInformation
+        https://bugs.webkit.org/show_bug.cgi?id=165707
+
+        Reviewed by Simon Fraser.
+
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView positionInformationForActionSheetAssistant:]):
+        (-[WKContentView updatePositionInformationForActionSheetAssistant:]):
+        For now, synchronously block when presenting the action sheet if we
+        don't have a snapshot ready.
+
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::getPositionInformation):
+        Respect includeSnapshot in another place in getPositionInformation,
+        so that many getPositionInformations don't have to do extra snapshotting work.
+
 2016-12-10  Filip Pizlo  <[email protected]>
 
         The DOM should have an advancing wavefront opaque root barrier

Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (209689 => 209690)


--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm	2016-12-12 00:57:02 UTC (rev 209689)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm	2016-12-12 01:10:00 UTC (rev 209690)
@@ -3798,6 +3798,11 @@
 
 - (const WebKit::InteractionInformationAtPosition&)positionInformationForActionSheetAssistant:(WKActionSheetAssistant *)assistant
 {
+    // FIXME: This should be more asynchronous, since we control the presentation of the action sheet.
+    InteractionInformationRequest request(_positionInformation.request.point);
+    request.includeSnapshot = true;
+    [self ensurePositionInformationIsUpToDate:request];
+
     return _positionInformation;
 }
 
@@ -3805,7 +3810,7 @@
 {
     _hasValidPositionInformation = NO;
     InteractionInformationRequest request(_positionInformation.request.point);
-    request.includeSnapshot = YES;
+    request.includeSnapshot = true;
 
     [self requestAsynchronousPositionInformationUpdate:request];
 }

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


--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2016-12-12 00:57:02 UTC (rev 209689)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2016-12-12 01:10:00 UTC (rev 209690)
@@ -2370,17 +2370,20 @@
                             if (image->width() > 1 && image->height() > 1) {
                                 info.imageURL = [(NSURL *)element->document().completeURL(renderImage.cachedImage()->url()) absoluteString];
                                 info.isAnimatedImage = image->isAnimated();
-                                FloatSize screenSizeInPixels = screenSize();
-                                screenSizeInPixels.scale(corePage()->deviceScaleFactor());
-                                FloatSize scaledSize = largestRectWithAspectRatioInsideRect(image->size().width() / image->size().height(), FloatRect(0, 0, screenSizeInPixels.width(), screenSizeInPixels.height())).size();
-                                FloatSize bitmapSize = scaledSize.width() < image->size().width() ? scaledSize : image->size();
-                                // FIXME: Only select ExtendedColor on images known to need wide gamut
-                                ShareableBitmap::Flags flags = ShareableBitmap::SupportsAlpha;
-                                flags |= screenSupportsExtendedColor() ? ShareableBitmap::SupportsExtendedColor : 0;
-                                if (RefPtr<ShareableBitmap> sharedBitmap = ShareableBitmap::createShareable(IntSize(bitmapSize), flags)) {
-                                    auto graphicsContext = sharedBitmap->createGraphicsContext();
-                                    graphicsContext->drawImage(*image, FloatRect(0, 0, bitmapSize.width(), bitmapSize.height()));
-                                    info.image = sharedBitmap;
+
+                                if (request.includeSnapshot) {
+                                    FloatSize screenSizeInPixels = screenSize();
+                                    screenSizeInPixels.scale(corePage()->deviceScaleFactor());
+                                    FloatSize scaledSize = largestRectWithAspectRatioInsideRect(image->size().width() / image->size().height(), FloatRect(0, 0, screenSizeInPixels.width(), screenSizeInPixels.height())).size();
+                                    FloatSize bitmapSize = scaledSize.width() < image->size().width() ? scaledSize : image->size();
+                                    // FIXME: Only select ExtendedColor on images known to need wide gamut
+                                    ShareableBitmap::Flags flags = ShareableBitmap::SupportsAlpha;
+                                    flags |= screenSupportsExtendedColor() ? ShareableBitmap::SupportsExtendedColor : 0;
+                                    if (RefPtr<ShareableBitmap> sharedBitmap = ShareableBitmap::createShareable(IntSize(bitmapSize), flags)) {
+                                        auto graphicsContext = sharedBitmap->createGraphicsContext();
+                                        graphicsContext->drawImage(*image, FloatRect(0, 0, bitmapSize.width(), bitmapSize.height()));
+                                        info.image = sharedBitmap;
+                                    }
                                 }
                             }
                         }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to