Bug 1441308 - Ensure lazy init of debug renderer in draw_frame_debug_items r=gw
authorDoug Thayer <dothayer@mozilla.com>
Tue, 26 Feb 2019 15:29:15 +0000
changeset 461112 deb682690025
parent 461111 2e473aa11c19
child 461113 fb90471fe737
push id79023
push userdothayer@mozilla.com
push dateTue, 26 Feb 2019 15:30:13 +0000
treeherderautoland@deb682690025 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgw
bugs1441308
milestone67.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 1441308 - Ensure lazy init of debug renderer in draw_frame_debug_items r=gw Document splitting is crashing with early initialization of the debug renderer. Not sure why, and this is just a temporary workaround, but one that I think we want anyway, as we don't want to be unnecessarily lazy-initting the debug renderer. Depends on D20698 Differential Revision: https://phabricator.services.mozilla.com/D20700
gfx/wr/webrender/src/renderer.rs
--- a/gfx/wr/webrender/src/renderer.rs
+++ b/gfx/wr/webrender/src/renderer.rs
@@ -4241,16 +4241,20 @@ impl Renderer {
         self.debug_flags = flags;
     }
 
     pub fn save_cpu_profile(&self, filename: &str) {
         write_profile(filename);
     }
 
     fn draw_frame_debug_items(&mut self, items: &[DebugItem]) {
+        if items.is_empty() {
+            return;
+        }
+
         let debug_renderer = match self.debug.get_mut(&mut self.device) {
             Some(render) => render,
             None => return,
         };
 
         for item in items {
             match item {
                 DebugItem::Rect { rect, color } => {