diff options
author | Josh Matthews <josh@joshmatthews.net> | 2019-10-08 13:19:21 -0400 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2019-10-10 09:57:20 -0400 |
commit | c53680b282aa5bf77ca15b8a4f9ae84afb8b9361 (patch) | |
tree | c41be0a3275b0ef09751a0c85517d4030545ec8a /components/script/dom/window.rs | |
parent | 4d7110aca53f54c5a9ee2bbbfbe800627c9af249 (diff) | |
download | servo-c53680b282aa5bf77ca15b8a4f9ae84afb8b9361.tar.gz servo-c53680b282aa5bf77ca15b8a4f9ae84afb8b9361.zip |
webgl: Lazily clear the canvas right before the first webgl command of the next frame.
Diffstat (limited to 'components/script/dom/window.rs')
-rw-r--r-- | components/script/dom/window.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index 8e139158427..565308ff36f 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -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 { |