summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--TYDAL-CHANGE-LOG1
-rw-r--r--pts-core/functions/pts-functions.php20
-rw-r--r--pts-core/functions/pts-functions_tests.php20
-rw-r--r--pts-core/modules/system_monitor.php5
-rw-r--r--pts-core/objects/pts_Graph/pts_CandleStickGraph.php2
-rw-r--r--pts-core/objects/pts_Graph/pts_Graph.php24
6 files changed, 27 insertions, 45 deletions
diff --git a/TYDAL-CHANGE-LOG b/TYDAL-CHANGE-LOG
index f07571f..2c212dd 100644
--- a/TYDAL-CHANGE-LOG
+++ b/TYDAL-CHANGE-LOG
@@ -17,6 +17,7 @@ Phoronix Test Suite (Git)
- pts-core: Change benchmark option to using the revised pts_run_option interface to avoid double pts-core initalization
- pts-core: Eliminate use of SILENT_INSTALL environmental variable
- pts-core: Ensure all PTS options extend the pts_option_interface
+- pts-core: Allow pts_Graph to set the default image renderer for blide_renderer
- pts: Add adjustable file size support for bonnie test profile
- tandem_XmlReader: Major performance improvements and optimizations
- bilde_renderer: New PTS-spawned abstracted image rendering interface that supports SVG and PNG rendering with a standard API
diff --git a/pts-core/functions/pts-functions.php b/pts-core/functions/pts-functions.php
index d6caf49..48a950b 100644
--- a/pts-core/functions/pts-functions.php
+++ b/pts-core/functions/pts-functions.php
@@ -114,26 +114,6 @@ function p_str($str_o)
// $_ENV["LANG"]
return $str_o;
}
-function pts_gd_available()
-{
- // Checks if PHP GD library is available for image rendering
-
- if(!extension_loaded("gd"))
- {
- /* if(dl("gd.so"))
- {
- $gd_available = true;
- }
- else */
- $gd_available = false;
- }
- else
- {
- $gd_available = true;
- }
-
- return $gd_available;
-}
function pts_process_register($process)
{
// Register a process as active
diff --git a/pts-core/functions/pts-functions_tests.php b/pts-core/functions/pts-functions_tests.php
index 5b3553f..bd4e270 100644
--- a/pts-core/functions/pts-functions_tests.php
+++ b/pts-core/functions/pts-functions_tests.php
@@ -123,25 +123,7 @@ function pts_save_result($save_to = null, $save_results = null)
$t = new pts_BarGraph($results_name[$i], $results_attributes[$i], $results_scale[$i]);
}
- if(pts_gd_available() && getenv("SVG_DEBUG") == false)
- {
- // Render to PNG
- $t->setRenderer("PNG");
- pts_copy(RESULTS_VIEWER_DIR . "pts-results-viewer.xsl", $save_to_dir . "/pts-results-viewer.xsl");
- file_put_contents($save_to_dir . "/pts-results-viewer.xsl", pts_get_results_viewer_xsl_formatted("PNG"));
- }
- else
- {
- if(!pts_is_assignment("PHP_SVG_TEXT"))
- {
- echo "\nThe PHP GD extension is missing, so the experimental SVG rendering engine is being used.\n";
- pts_set_assignment("PHP_SVG_TEXT", 1);
- }
-
- // Render to SVG
- $t->setRenderer("SVG");
- file_put_contents($save_to_dir . "/pts-results-viewer.xsl", pts_get_results_viewer_xsl_formatted("SVG"));
- }
+ file_put_contents($save_to_dir . "/pts-results-viewer.xsl", pts_get_results_viewer_xsl_formatted($t->getRenderer()));
$t->loadGraphIdentifiers($results_identifiers[$i]);
$t->loadGraphValues($results_values[$i]);
diff --git a/pts-core/modules/system_monitor.php b/pts-core/modules/system_monitor.php
index 78a90dd..daf2de1 100644
--- a/pts-core/modules/system_monitor.php
+++ b/pts-core/modules/system_monitor.php
@@ -442,11 +442,6 @@ class system_monitor extends pts_module_interface
$t = new pts_LineGraph($graph_title, $sub_title, $graph_unit);
- if(pts_gd_available() && getenv("SVG_DEBUG") == FALSE)
- $t->setRenderer("PNG");
- else
- $t->setRenderer("SVG");
-
$first_run = true;
foreach($sub_array as $id_point)
{
diff --git a/pts-core/objects/pts_Graph/pts_CandleStickGraph.php b/pts-core/objects/pts_Graph/pts_CandleStickGraph.php
index 5b10322..3b4aca8 100644
--- a/pts-core/objects/pts_Graph/pts_CandleStickGraph.php
+++ b/pts-core/objects/pts_Graph/pts_CandleStickGraph.php
@@ -72,8 +72,8 @@ class pts_CandleStickGraph extends pts_BarGraph
}
$this->graph_image->draw_line($px_bound_center, $plot_wick_lowest, $px_bound_center, $plot_wick_highest, $this->graph_color_body_light, 1);
- $this->graph_image->draw_rectangle_border($px_bound_left, $plot_body_low, $px_bound_right, $plot_body_high, $this->graph_color_body_light);
$this->graph_image->draw_rectangle($px_bound_left + 1, $plot_body_low - 1, $px_bound_right - 1, $plot_body_high + 1, $body_color);
+ $this->graph_image->draw_rectangle_border($px_bound_left, $plot_body_low, $px_bound_right, $plot_body_high, $this->graph_color_body_light);
}
}
}
diff --git a/pts-core/objects/pts_Graph/pts_Graph.php b/pts-core/objects/pts_Graph/pts_Graph.php
index eb55eb0..de43841 100644
--- a/pts-core/objects/pts_Graph/pts_Graph.php
+++ b/pts-core/objects/pts_Graph/pts_Graph.php
@@ -109,6 +109,30 @@ abstract class pts_Graph
{
putenv("GDFONTPATH=" . getcwd());
}
+
+ // Set a renderer
+ if(!extension_loaded("gd"))
+ {
+ /* if(dl("gd.so"))
+ {
+ $gd_available = true;
+ }
+ else */
+ $gd_available = false;
+ }
+ else
+ {
+ $gd_available = true;
+ }
+
+ if($gd_available && getenv("SVG_DEBUG") == false)
+ {
+ $this->setRenderer("PNG");
+ }
+ else
+ {
+ $this->setRenderer("SVG");
+ }
}
public function setRenderer($renderer)
{