[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Public WebGL] preserveDrawingBuffer = false
Some complications: do you trigger this behavior at the beginning of every DOM event dispatch, or at the beginning of each event handler invocation?Â What happens if a WebGL call causes an event to be fired synchronously, causing nested callbacks?Â There are probably interactions with other specs that I'm not thinking of, too.Â Also, needing to check a list of callback hooks before all script callbacks are executed could cause overhead for everything else.Â It would be good to avoid all of this.
You could think about an explicit ctx.present() function.Â Instead of drawing functions marking the drawing buffer as modified (ready to be presented to the compositor and then cleared), present() would do that.Â Calling any drawing function on a drawing buffer marked as modified would clear it (if preserveDrawingBuffer is false) and mark the drawing buffer unmodified, regardless of entering or exiting any callbacks. This would replace the clearing that currently happens after compositing, and give completely deterministic behavior.Â The backwards-incompatibility would be unfortunate, though, even though it's a trivial change for users.