[Webkit-unassigned] [Bug 154819] New: WebGL canvas resumes at incorrect size/scale

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 29 09:15:01 PST 2016


https://bugs.webkit.org/show_bug.cgi?id=154819

            Bug ID: 154819
           Summary: WebGL canvas resumes at incorrect size/scale
    Classification: Unclassified
           Product: WebKit
           Version: Safari 9
          Hardware: iOS
                OS: iOS 9.2
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Canvas
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: ashley at scirra.com
                CC: dino at apple.com

URL: http://www.scirra.com/labs/bugs/iosc2bug/

Steps to reproduce:

1. Visit the URL and observe the content running in Safari
2. Press the device power button to put it to sleep
3. Wake it up again and unlock it
4. Observe the content running in Safari again

Observed result:

The canvas (WebGL rendered) restores at a strange size. It appears the canvas has become much larger, and inside the Safari viewport only the top-left area of the canvas is visible. The content is however still running.

Expected result:

Canvas to resume at same size it was before.


We are developers of the widely-used HTML5 game engine Construct 2. This bug affects all Construct 2 content. We have found a workaround: we have a setSize() method which is called in the resize event. If we ignore resize events and simply poll window.innerWidth and window.innerHeight every requestAnimationFrame, and call the same setSize() method when this polling notices them changing, it appears to work. You can see this approach used here: http://www.scirra.com/labs/bugs/iosc2bugworkaround/
We will likely ship this workaround shortly, but this does not fix all existing Construct 2 content on the web.

I've tried to produce a more minimal test case. I'm afraid I haven't been able to do this, but along the way filed bug 154815 and bug 154816 which may be related; in particular bug 154816 involves firing incorrect resize events when resuming. I speculate that trying to resize the WebGL canvas in this incorrectly-fired resize event causes Safari to get confused about how to display it.

Not all devices are affected - of the devices I have access to:

iPad Pro: affected
iPad Air 2: affected
iPad 3: not affected
iPad 2: not affected
iPhone 4S: not affected
(Chrome for Android does not appear to be affected at all)

This is the same list of affected devices as in bug 154816. However I feel I should point out I believe this is a different problem to that bug. Firing incorrect resize events is one problem, but even in this case the last event fired had the right size, and this means means our engine should only temporarily set the wrong size, then set the right size before a frame is displayed. This should work fine, but the issue with *this* bug is it appears to corrupt the canvas size even though it should work in the face of a spurious resize event.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160229/c2c17cb1/attachment.html>


More information about the webkit-unassigned mailing list