Title: [170326] trunk/Source/WebKit2
- Revision
- 170326
- Author
- [email protected]
- Date
- 2014-06-23 15:12:49 -0700 (Mon, 23 Jun 2014)
Log Message
[iOS][wk2] Don't use view snapshots if the destination layer is a different size
https://bugs.webkit.org/show_bug.cgi?id=134210
<rdar://problem/17369463>
Reviewed by Benjamin Poulain.
* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::beginSwipeGesture):
Only use the view snapshot if the snapshot is the same (in device space) size
as the layer it's going to be put into, and only if the device scale factor is
the same as it was when the snapshot was taken.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (170325 => 170326)
--- trunk/Source/WebKit2/ChangeLog 2014-06-23 22:05:47 UTC (rev 170325)
+++ trunk/Source/WebKit2/ChangeLog 2014-06-23 22:12:49 UTC (rev 170326)
@@ -1,3 +1,17 @@
+2014-06-23 Timothy Horton <[email protected]>
+
+ [iOS][wk2] Don't use view snapshots if the destination layer is a different size
+ https://bugs.webkit.org/show_bug.cgi?id=134210
+ <rdar://problem/17369463>
+
+ Reviewed by Benjamin Poulain.
+
+ * UIProcess/ios/ViewGestureControllerIOS.mm:
+ (WebKit::ViewGestureController::beginSwipeGesture):
+ Only use the view snapshot if the snapshot is the same (in device space) size
+ as the layer it's going to be put into, and only if the device scale factor is
+ the same as it was when the snapshot was taken.
+
2014-06-23 Benjamin Poulain <[email protected]>
[iOS][WK2] Make the state restore from HistoryItem more precise and reliable
Modified: trunk/Source/WebKit2/UIProcess/ios/ViewGestureControllerIOS.mm (170325 => 170326)
--- trunk/Source/WebKit2/UIProcess/ios/ViewGestureControllerIOS.mm 2014-06-23 22:05:47 UTC (rev 170325)
+++ trunk/Source/WebKit2/UIProcess/ios/ViewGestureControllerIOS.mm 2014-06-23 22:12:49 UTC (rev 170326)
@@ -158,8 +158,13 @@
m_snapshotView = adoptNS([[UIView alloc] initWithFrame:liveSwipeViewFrame]);
ViewSnapshot snapshot;
- if (ViewSnapshotStore::shared().getSnapshot(targetItem, snapshot) && snapshot.hasImage())
- [m_snapshotView layer].contents = snapshot.asLayerContents();
+ if (ViewSnapshotStore::shared().getSnapshot(targetItem, snapshot) && snapshot.hasImage()) {
+ float deviceScaleFactor = m_webPageProxy.deviceScaleFactor();
+ FloatSize swipeLayerSizeInDeviceCoordinates(liveSwipeViewFrame.size);
+ swipeLayerSizeInDeviceCoordinates.scale(deviceScaleFactor);
+ if (snapshot.size == swipeLayerSizeInDeviceCoordinates && deviceScaleFactor == snapshot.deviceScaleFactor)
+ [m_snapshotView layer].contents = snapshot.asLayerContents();
+ }
[m_snapshotView setBackgroundColor:[UIColor whiteColor]];
[m_snapshotView layer].contentsGravity = kCAGravityTopLeft;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes