Skip to content

Commit 2bbbc64

Browse files
committed
Device update for canvasBitBltShift - real
(Previous changeset not pushed correctly)
1 parent 7213bb1 commit 2bbbc64

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

src/system/Device.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -663,16 +663,19 @@ Phaser.Device._initialize = function () {
663663

664664
device.getUserMedia = !!(navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia);
665665

666-
// TODO: replace with actual feature check
667-
if (device.ie || device.firefox || device.chrome)
666+
// TODO: replace canvasBitBltShift detection with actual feature check
667+
668+
// Excludes iOS versions as they generally wrap UIWebView (eg. Safari WebKit) and it
669+
// is safer to not try and use the fast copy-over method.
670+
if (!device.iOS &&
671+
(device.ie || device.firefox || device.chrome))
668672
{
669-
// Believed to work; XYZ for iOS should be reset below
670673
device.canvasBitBltShift = true;
671674
}
672-
if (device.safari || device.mobileSafari || device.iOS)
675+
676+
// Known not to work
677+
if (device.safari || device.mobileSafari)
673678
{
674-
// Known or suspected not to work
675-
// The iOS check is to catch Chrome for iOS and other browsers that use UIWebView (aka Safari WebKit).
676679
device.canvasBitBltShift = false;
677680
}
678681

0 commit comments

Comments
 (0)