Closed Bug 890472 Opened 12 years ago Closed 11 years ago

WebGL unintended clearing issue

Categories

(Core :: Graphics: CanvasWebGL, defect)

22 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: bavanandel, Unassigned)

References

Details

(Whiteboard: webgl-correctness)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0 (Beta/Release) Build ID: 20130618035212 Steps to reproduce: We are developing a WebGL based panorama viewer, which only draws frames when the view parameters change (i.e., yaw, pitch, field of view, or canvas size). In between those draw actions, we do not touch the WebGL context. Actual results: When no frames are explicitly drawn by us, the viewer sometimes blanks all of a sudden. Expected results: The previously drawn frame should stay visible.
This issue did not happen in FF21, it started to happen after the update to FF22. I've tried to reproduce the issue in the portable versions of FF21 (ok), FF22 (not ok), and FF23beta1 (not ok). We don't have any of our own code at hand, but the issue is also reproducible with the WebGL rotating cube demo by Mozilla itself (https://developer.mozilla.org/samples/webgl/sample6/index.html). After clearing the timeout which makes the cube rotate (i.e. using the FireBug developer console: clearTimeout(some number)), the canvas may turn black at some point. It is not exactly clear when this happens, but we can reproduce the issue quite easily by opening another tab with another WebGL demo, and switch a few times between those tabs. NB: the color by which the viewport is cleared appears to be transparent black (0,0,0,0), irrespective of any clear color actually set. This has been tested by setting a different color using gl.clearColor(...), enabling/disabling the alpha parameter at creating time of the webgl context, playing around with the background color behind the canvas, etc. Since it only happens in FF22 (and 23beta1) and not in earlier versions, I suspect it has something to do with the recent performance improvement mentioned in the release notes and discussed in issue #829747. No GL errors show up anywhere. Our hardware configuration: Workstation model: Dell Precision M6600 CPU: Intel Core i7-2720QM RAM: 8GM GPU: NVIDIA Quadro 3000M OS: Windows 7 Professional, all MS updates applied Driver: official NVIDIA driver, 310.90. Also tested with the current release (320.49)
Forgot to mention: everything was tested in 64 bit versions.
Whoops. "clearTimeout" should be "clearInterval" obviously.
I just found out that this behavior can be counteracted by setting the variable "preserveDrawingBuffer" to true on initialization of the context: var gl = canvas.getContext("experimental-webgl", { preserveDrawingBuffer: true }); Has the default value changed with the release of FF22? Or is this just a coincidence?
Component: Untriaged → Canvas: WebGL
Product: Firefox → Core
(In reply to Bart van Andel from comment #4) > I just found out that this behavior can be counteracted by setting the > variable "preserveDrawingBuffer" to true on initialization of the context: > > var gl = canvas.getContext("experimental-webgl", { > preserveDrawingBuffer: true > }); > > Has the default value changed with the release of FF22? Or is this just a > coincidence? The default has not changed, and has always been 'false'. I can reproduce this, so I'll take a look at it.
Status: UNCONFIRMED → NEW
Ever confirmed: true
See Also: → 917160
Whiteboard: webgl-correctness
Fixed by 917160. Please reopen if you can still reproduce it.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.