On 02/06/2012 06:15, Benoit Jacob wrote:
Clearing the drawing buffer is correct. Requesting a re-composite is
incorrect since the buffer has not been modified by the application.
In the sample I clear the drawing buffer to green.
Then 1 second later I issue some GL commands to see what
happens. ÂThese 6 commands should not effect what is
Â Â Â ÂÂgl.enable(gl.BLEND);
Â Â Â ÂÂgl.bindTexture(gl.TEXTURE_2D,
Â Â Â ÂÂgl.viewport(1,1,1,1);
Â Â Â ÂÂgl.bindFramebuffer(gl.FRAMEBUFFER,
Â Â Â Â var p =
Â Â Â Â gl.readPixels(0,0,1,1,gl.RGBA,gl.UNSIGNED_BYTE,
What I find is Firefox ends up
reflecting that the backbuffer has been cleared if I
call gl.readPixels. On other words it recomposites the
page with the cleared drawing buffer. As far as I can
tell from the spec that's a bug. The drawing buffer has
not been modified so Âit should not be composited again.
In Mozilla's implementation, readPixel checks if the
backbuffer needs a clear (which is the case if
preserveDrawingBuffer is false and the drawing buffer hasn't
been cleared since it was last presented). If it does find
that it needs a clear, then it clears it and requests it to
be composited again.
How else should it behave?