aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/window.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2019-10-08 13:19:21 -0400
committerJosh Matthews <josh@joshmatthews.net>2019-10-10 09:57:20 -0400
commitc53680b282aa5bf77ca15b8a4f9ae84afb8b9361 (patch)
treec41be0a3275b0ef09751a0c85517d4030545ec8a /components/script/dom/window.rs
parent4d7110aca53f54c5a9ee2bbbfbe800627c9af249 (diff)
downloadservo-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.rs7
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 {