Created attachment 755547 [details] index.html User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36 Steps to reproduce: If you are doing offscreen rendering to a texture render target, and don't re-bind the primary framebuffer, then when you do a call like context2d.drawImage(webglCanvas, 0, 0), what you get is a copy of the last bound framebuffer, rather than the content that is actually showing on the WebGL canvas. This is not the result that the spec leads me to expect. I have a repro at http://www.billbaxter.com/rttRepro, and also attached. Actual results: If you call drawImage with the webgl canvas as the source, you seem to get the last framebuffer bound rather than the primary/screen framebuffer of the webgl canvas. Expected results: I think context2d.drawImage should never copy an offscreen framebuffer from a webgl canvas, but rather always the primary framebuffer.
Note that it seems that Firefox behaves the same whether or not preserveDrawingBuffer is set to true or not. In the case of preserveDrawingBuffer=false, the spec says you can't count on drawImage working properly unless you do it before returning from your requestAnimationFrame callback. You can turn preserveDrawingBuffer on in the demo with http://www.billbaxter.com/rttRepro?preserve
Created attachment 756852 [details] [diff] [review] patch: Read from screen, not current bound FBO for WebGLContext::Render Yep, oops.
Assignee: nobody → jgilbert
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attachment #756852 - Flags: review?(bjacob)
Nice! Thanks for the quick fix.
Attachment #756852 - Flags: review?(bjacob) → review+
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in before you can comment on or make changes to this bug.