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 461167 deb6826900252a703b5211a6dbd29cad21b009e3
parent 461166 2e473aa11c1951de9ea1e7beebc839115f7a34de
child 461168 fb90471fe73746e4a508b540c9860380a5e99691
push id35620
push userncsoregi@mozilla.com
push dateTue, 26 Feb 2019 21:51:06 +0000
treeherdermozilla-central@8c60d3a2fcc4 [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 } => {