Last Comment Bug 763190 - WebGL readPixels shouldn't call EnsureBackbufferClearedAsNeeded
: WebGL readPixels shouldn't call EnsureBackbufferClearedAsNeeded
Status: RESOLVED FIXED
webgl-conformance
:
Product: Core
Classification: Components
Component: Canvas: WebGL (show other bugs)
: unspecified
: x86_64 Linux
: -- normal (vote)
: mozilla16
Assigned To: Benoit Jacob [:bjacob] (mostly away)
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-09 06:48 PDT by Benoit Jacob [:bjacob] (mostly away)
Modified: 2012-06-13 05:58 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
readPixels should not clear the backbuffer (1.03 KB, patch)
2012-06-09 06:48 PDT, Benoit Jacob [:bjacob] (mostly away)
jgilbert: review+
Details | Diff | Splinter Review

Description Benoit Jacob [:bjacob] (mostly away) 2012-06-09 06:48:41 PDT
Created attachment 631660 [details] [diff] [review]
readPixels should not clear the backbuffer

See this discussion:

  https://www.khronos.org/webgl/public-mailing-list/archives/1206/msg00006.html

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.

Gregg's testcase,

  http://jsfiddle.net/greggman/hDcxp/1/

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.
Comment 1 Benoit Jacob [:bjacob] (mostly away) 2012-06-12 10:13:28 PDT
https://tbpl.mozilla.org/?tree=Try&rev=8cd80ba5c8f3
Comment 2 Benoit Jacob [:bjacob] (mostly away) 2012-06-12 14:23:05 PDT
http://hg.mozilla.org/integration/mozilla-inbound/rev/d4820f5ac825
Comment 3 Ed Morley [:emorley] 2012-06-13 05:58:55 PDT
https://hg.mozilla.org/mozilla-central/rev/d4820f5ac825

Note You need to log in before you can comment on or make changes to this bug.