From 47f617ef8034c85f2ed2b9f597ef7d73c95c9797 Mon Sep 17 00:00:00 2001 From: Michael Larabel Date: Thu, 17 Sep 2015 08:50:10 -0500 Subject: [PATCH] pts_Graph: Support coloring based on brand --- ChangeLog | 1 + .../phx_graph/phx_graph_horizontal_bars.php | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/ChangeLog b/ChangeLog index 1a321a393a..86701414b2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,7 @@ Phoronix Test Suite (Git) - phodevi: AMDGPU Linux detection improvements - phoromatic: Add "Tests" page - pts_Graph: Don't embed the PNG logo directly into the SVG file, but rely on HTTPS link +- pts_Graph: Support coloring based on brand Phoronix Test Suite 6.0 Milestone 1 26 August 2015 diff --git a/pts-core/objects/phx_graph/phx_graph_horizontal_bars.php b/pts-core/objects/phx_graph/phx_graph_horizontal_bars.php index be0a484887..6e217106b7 100644 --- a/pts-core/objects/phx_graph/phx_graph_horizontal_bars.php +++ b/pts-core/objects/phx_graph/phx_graph_horizontal_bars.php @@ -85,6 +85,25 @@ protected function render_graph_bars() $paint_color = $this->get_paint_color($identifier); foreach($group as &$buffer_item) { + // if identifier is 0, not a multi-way comparison or anything special + if($identifier == 0) + { + // See if the result identifier matches something to be color-coded better + $result_identifier = strtolower($buffer_item->get_result_identifier()); + if(strpos($result_identifier, 'geforce') !== false || strpos($result_identifier, 'nvidia') !== false) + { + $paint_color = '#75b900'; + } + else if(strpos($result_identifier, 'radeon') !== false || strpos($result_identifier, 'amd ') !== false) + { + $paint_color = '#f1052d'; + } + else if(strpos($result_identifier, 'intel ') !== false) + { + $paint_color = '#0b5997'; + } + } + $i_o = $this->calc_offset($group_offsets, $identifier); $i = $this->calc_offset($id_offsets, $buffer_item->get_result_identifier()); $value = $buffer_item->get_result_value();