Commit 27d03e34 authored by Ken Martin's avatar Ken Martin

add window size options to timing test

patch courtesy of Tim Rowley for adding width and height
options to the TimingTest
parent 0b7d6de3
......@@ -101,7 +101,7 @@ class surfaceTest : public vtkRTTest
ren1->AddActor(actor.Get());
// set the size/color of our window
renWindow->SetSize(500, 500);
renWindow->SetSize(this->GetRenderWidth(), this->GetRenderHeight());
ren1->SetBackground(0.2, 0.3, 0.5);
// draw the resulting scene
......@@ -204,7 +204,7 @@ class glyphTest : public vtkRTTest
ren1->AddActor(actor.Get());
// set the size/color of our window
renWindow->SetSize(600, 600);
renWindow->SetSize(this->GetRenderWidth(), this->GetRenderHeight());
ren1->SetBackground(0.2, 0.3, 0.5);
// draw the resulting scene
......@@ -342,7 +342,7 @@ class moleculeTest : public vtkRTTest
ren1->AddActor(actor.GetPointer());
// set the size/color of our window
renWindow->SetSize(600,600);
renWindow->SetSize(this->GetRenderWidth(), this->GetRenderHeight());
ren1->SetBackground(0.2,0.3,0.5);
// draw the resulting scene
......@@ -473,7 +473,7 @@ class volumeTest : public vtkRTTest
ren1->AddActor(volume.GetPointer());
// set the size/color of our window
renWindow->SetSize(600, 600);
renWindow->SetSize(this->GetRenderWidth(), this->GetRenderHeight());
ren1->SetBackground(0.2, 0.3, 0.4);
// draw the resulting scene
......@@ -601,7 +601,7 @@ class depthPeelingTest : public vtkRTTest
}
// set the size/color of our window
renWindow->SetSize(500, 500);
renWindow->SetSize(this->GetRenderWidth(), this->GetRenderHeight());
ren1->SetBackground(0.2, 0.3, 0.5);
// draw the resulting scene
......
......@@ -111,6 +111,9 @@ void vtkRTTestSequence::Run()
{
this->SequenceCount = this->RenderTimings->GetSequenceStart();
int sequenceEnd = this->RenderTimings->GetSequenceEnd();
this->Test->SetRenderSize(
this->RenderTimings->GetRenderWidth(),
this->RenderTimings->GetRenderHeight());
vtkNew<vtkContextView> chartView;
vtkNew<vtkChartXY> chart;
......@@ -242,6 +245,8 @@ vtkRenderTimings::vtkRenderTimings()
this->SequenceEnd = 0;
this->SequenceStepTimeLimit = 15.0; // seconds
this->DetailedResultsFileName = "results.csv";
this->RenderWidth = 600;
this->RenderHeight = 600;
}
int vtkRenderTimings::RunTests()
......@@ -342,6 +347,10 @@ int vtkRenderTimings::ParseCommandLineArguments( int argc, char *argv[] )
"Provide a listing of available tests.");
this->Arguments.AddBooleanArgument("-nochart", &this->NoChartResults,
"Suppress realtime charting of test performance.");
this->Arguments.AddArgument("-width", argT::SPACE_ARGUMENT, &this->RenderWidth,
"Width of benchmark rendering window.");
this->Arguments.AddArgument("-height", argT::SPACE_ARGUMENT, &this->RenderHeight,
"Height of benchmark rendering window.");
if ( !this->Arguments.Parse() )
{
......
......@@ -55,6 +55,10 @@ public:
virtual void SetTargetTime(float tt) { this->TargetTime = tt; }
virtual float GetTargetTime() { return this->TargetTime; }
void SetRenderSize(int width, int height) { this->RenderWidth = width; this->RenderHeight = height; }
int GetRenderWidth() { return this->RenderWidth; }
int GetRenderHeight() { return this->RenderHeight; }
// run the test, argc and argv are extra arguments that the test might
// use.
virtual vtkRTTestResult Run(vtkRTTestSequence *ats, int argc, char *argv[]) = 0;
......@@ -63,6 +67,7 @@ public:
{
this->TargetTime = 1.0;
this->Name = name;
RenderWidth = RenderHeight = 600;
}
virtual ~vtkRTTest() {}
......@@ -70,6 +75,7 @@ public:
protected:
float TargetTime;
std::string Name;
int RenderWidth, RenderHeight;
};
class vtkRTTestResult
......@@ -145,6 +151,10 @@ public:
// get the maxmimum time allowed per step
double GetSequenceStepTimeLimit() { return this->SequenceStepTimeLimit; }
// get the render size
int GetRenderWidth() { return this->RenderWidth; }
int GetRenderHeight() { return this->RenderHeight; }
// parse and act on the command line arguments
int ParseCommandLineArguments(int argc, char *argv[]);
......@@ -172,6 +182,8 @@ private:
int SequenceEnd;
double SequenceStepTimeLimit;
std::string DetailedResultsFileName;
int RenderWidth;
int RenderHeight;
};
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment