Bug 1442608 - Fix rendering failure with WebRender on Windows. r=nical
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 02 Mar 2018 16:45:18 -0500
changeset 461434 02bf3c12111caa986bfaec1f2c6a50381492698e
parent 461433 8ee92682ad1f3b67c110742bc910cf1af03ac48b
child 461435 58b3bc37c7f8a18abb2cf2c669fe5547b87ed0a6
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1442608, 1442748
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1442608 - Fix rendering failure with WebRender on Windows. r=nical This works around a rendering failure on Windows where the browser window opens and remains white. Details of why this happens can be found in bug 1442748; this workaround just forces a scene build if we get a GenerateFrame request after having the root pipeline id set on the pending scene, but if it hasn't yet been propagated to the current scene. This ensures the render isn't skipped and prevents the C++-side frame throttler from preventing future composites.
gfx/webrender/src/render_backend.rs
--- a/gfx/webrender/src/render_backend.rs
+++ b/gfx/webrender/src/render_backend.rs
@@ -934,17 +934,29 @@ impl RenderBackend {
             return;
         }
 
         self.resource_cache.update_resources(
             transaction_msg.resource_updates,
             &mut profile_counters.resources,
         );
 
-        if op.build {
+        // If we get a generate_frame message after getting a root pipeline set,
+        // but that pipeline id hasn't been propagated to the current scene, then
+        // we should force that to happen. Otherwise we will skip a render that
+        // the caller is expecting to happen, and in Gecko's case, that will
+        // leave it wedged permanently.
+        let force_build = if transaction_msg.generate_frame {
+            let doc = self.documents.get_mut(&document_id).unwrap();
+            doc.pending.scene.root_pipeline_id.is_some() && !doc.current.scene.root_pipeline_id.is_some()
+        } else {
+            false
+        };
+
+        if op.build || force_build {
             let doc = self.documents.get_mut(&document_id).unwrap();
             let _timer = profile_counters.total_time.timer();
             profile_scope!("build scene");
 
             doc.build_scene(&mut self.resource_cache);
             doc.render_on_hittest = true;
         }