Created attachment 631660 [details] [diff] [review]
readPixels should not clear the backbuffer
See this discussion:
Section 2.2 in the spec has been updated to clarify that with preserveDrawingBuffer=false, the clearing only occurs if the canvas has been invalidated by a draw operation. In this respect, readPixels is not a draw operation hence it shouldn't request a clear.
clears the canvas in green and does a readPixels in a setTimeout callback. It should not result in a clearing of the buffer. Currently in Firefox it does, because our readPixels implementation calls EnsureBackbufferClearedAsNeeded. This seems unneeded, and removing it fixes it. Notice that there is no security issue here because this only applies to the default framebuffer (non-default FBOs are still initialized if they had uninitialized renderbuffers) and on context creation the default framebuffer does get cleared already.