webgl: Lazily clear the canvas right before the first webgl command of the next frame.

This commit is contained in:
Josh Matthews 2019-10-08 13:19:21 -04:00
parent 4d7110aca5
commit c53680b282
8 changed files with 138 additions and 124 deletions

View file

@ -1520,6 +1520,13 @@ impl Window {
let stylesheets_changed = document.flush_stylesheets_for_reflow();
// If this reflow is for display, ensure webgl canvases are composited with
// up-to-date contents.
match reflow_goal {
ReflowGoal::Full => document.flush_dirty_canvases(),
ReflowGoal::TickAnimations | ReflowGoal::LayoutQuery(..) => {},
}
// Send new document and relevant styles to layout.
let needs_display = reflow_goal.needs_display();
let reflow = ScriptReflow {