Bug 1583841 - Highlight values in red in the full and compact profilers when values are outside their expected range. r=gw
authorNicolas Silva <nsilva@mozilla.com>
Fri, 18 Oct 2019 01:10:19 +0000
changeset 559439 16bed925e3ac7bf500d924d5441085f87de07e3d
parent 559438 8cc42e92e6ef2b11d818b056aa6f67cd800844db
child 559440 1ad5346d3fa4222b2252e756e4c57f62a6292667
push id12177
push usercsabou@mozilla.com
push dateMon, 21 Oct 2019 14:52:16 +0000
treeherdermozilla-beta@1918a9cd33bc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgw
bugs1583841
milestone71.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 1583841 - Highlight values in red in the full and compact profilers when values are outside their expected range. r=gw Differential Revision: https://phabricator.services.mozilla.com/D49619
gfx/wr/webrender/src/profiler.rs
--- a/gfx/wr/webrender/src/profiler.rs
+++ b/gfx/wr/webrender/src/profiler.rs
@@ -1258,18 +1258,22 @@ impl Profiler {
             (draw_state.x_left, draw_state.y_left)
         } else {
             (draw_state.x_right, draw_state.y_right)
         };
         let mut color_index = 0;
         let line_height = debug_renderer.line_height();
 
         let colors = [
+            // Regular values,
             ColorU::new(255, 255, 255, 255),
             ColorU::new(255, 255, 0, 255),
+            // Unexpected values,
+            ColorU::new(255, 80, 0, 255),
+            ColorU::new(255, 0, 0, 255),
         ];
 
         for (idx, counter) in counters.iter().enumerate() {
             if let Some(cooldowns) = cooldowns.as_mut() {
                 if !counter.is_expected() {
                     cooldowns[idx] = 40;
                 }
                 if cooldowns[idx] == 0 {
@@ -1278,42 +1282,43 @@ impl Profiler {
             }
             let rect = debug_renderer.add_text(
                 current_x,
                 current_y,
                 counter.description(),
                 colors[color_index],
                 None,
             );
-            color_index = (color_index + 1) % colors.len();
+            color_index = (color_index + 1) % 2;
 
             label_rect = label_rect.union(&rect);
             current_y += line_height;
         }
 
         color_index = 0;
         current_x = label_rect.origin.x + label_rect.size.width + 60.0;
         current_y = if left { draw_state.y_left } else { draw_state.y_right };
 
         for (idx, counter) in counters.iter().enumerate() {
+            let expected_offset = if counter.is_expected() || cooldowns.is_some() { 0 } else { 2 };
             if let Some(cooldowns) = cooldowns.as_mut() {
                 if cooldowns[idx] > 0 {
                     cooldowns[idx] -= 1;
                 } else {
                     continue;
                 }
             }
             let rect = debug_renderer.add_text(
                 current_x,
                 current_y,
                 &counter.value(),
-                colors[color_index],
+                colors[color_index + expected_offset],
                 None,
             );
-            color_index = (color_index + 1) % colors.len();
+            color_index = (color_index + 1) % 2;
 
             value_rect = value_rect.union(&rect);
             current_y += line_height;
         }
 
         let total_rect = label_rect.union(&value_rect).inflate(10.0, 10.0);
         debug_renderer.add_quad(
             total_rect.origin.x,