One can now chose clipping or no clipping (--clipping or -c) and the drawing
mode. The ClippedLineTest is removed, since that was a dup of RandomLines anyways. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29953 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -9,10 +9,10 @@
|
|||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
#include <Screen.h>
|
#include <Screen.h>
|
||||||
|
|
||||||
|
#include "DrawingModeToString.h"
|
||||||
#include "TestWindow.h"
|
#include "TestWindow.h"
|
||||||
|
|
||||||
// tests
|
// tests
|
||||||
#include "ClippedLineTest.h"
|
|
||||||
#include "HorizontalLineTest.h"
|
#include "HorizontalLineTest.h"
|
||||||
#include "RandomLineTest.h"
|
#include "RandomLineTest.h"
|
||||||
#include "StringTest.h"
|
#include "StringTest.h"
|
||||||
@@ -25,7 +25,6 @@ struct test_info {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const test_info kTestInfos[] = {
|
const test_info kTestInfos[] = {
|
||||||
{ "ClippedLines", ClippedLineTest::CreateTest },
|
|
||||||
{ "HorizontalLines", HorizontalLineTest::CreateTest },
|
{ "HorizontalLines", HorizontalLineTest::CreateTest },
|
||||||
{ "RandomLines", RandomLineTest::CreateTest },
|
{ "RandomLines", RandomLineTest::CreateTest },
|
||||||
{ "Strings", StringTest::CreateTest },
|
{ "Strings", StringTest::CreateTest },
|
||||||
@@ -36,10 +35,12 @@ const test_info kTestInfos[] = {
|
|||||||
|
|
||||||
class Benchmark : public BApplication {
|
class Benchmark : public BApplication {
|
||||||
public:
|
public:
|
||||||
Benchmark(Test* test)
|
Benchmark(Test* test, drawing_mode mode, bool clipping)
|
||||||
: BApplication("application/x-vnd.haiku-benchmark"),
|
: BApplication("application/x-vnd.haiku-benchmark"),
|
||||||
fTest(test),
|
fTest(test),
|
||||||
fTestWindow(NULL)
|
fTestWindow(NULL),
|
||||||
|
fDrawingMode(mode),
|
||||||
|
fUseClipping(clipping)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,8 +60,8 @@ public:
|
|||||||
frame.right = frame.left + width - 1;
|
frame.right = frame.left + width - 1;
|
||||||
frame.bottom = frame.top + height - 1;
|
frame.bottom = frame.top + height - 1;
|
||||||
|
|
||||||
fTestWindow = new TestWindow(frame, fTest, B_OP_COPY,
|
fTestWindow = new TestWindow(frame, fTest, fDrawingMode,
|
||||||
BMessenger(this));
|
fUseClipping, BMessenger(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool QuitRequested()
|
virtual bool QuitRequested()
|
||||||
@@ -77,7 +78,9 @@ public:
|
|||||||
printf("Test canceled early.\n");
|
printf("Test canceled early.\n");
|
||||||
// fall through
|
// fall through
|
||||||
case MSG_TEST_FINISHED:
|
case MSG_TEST_FINISHED:
|
||||||
fTest->PrintResults();
|
fTestWindow->Lock();
|
||||||
|
fTest->PrintResults(fTestWindow->View());
|
||||||
|
fTestWindow->Unlock();
|
||||||
PostMessage(B_QUIT_REQUESTED);
|
PostMessage(B_QUIT_REQUESTED);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -89,6 +92,8 @@ public:
|
|||||||
private:
|
private:
|
||||||
Test* fTest;
|
Test* fTest;
|
||||||
TestWindow* fTestWindow;
|
TestWindow* fTestWindow;
|
||||||
|
drawing_mode fDrawingMode;
|
||||||
|
bool fUseClipping;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -114,7 +119,25 @@ main(int argc, char** argv)
|
|||||||
print_test_list(true);
|
print_test_list(true);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
testName = argv[1];
|
// skip program name
|
||||||
|
argc--;
|
||||||
|
argv++;
|
||||||
|
|
||||||
|
testName = argv[0];
|
||||||
|
bool clipping = false;
|
||||||
|
drawing_mode mode = B_OP_COPY;
|
||||||
|
|
||||||
|
while (argc > 0) {
|
||||||
|
drawing_mode possibleMode;
|
||||||
|
if (strcmp(argv[0], "--clipping") == 0 || strcmp(argv[0], "-c") == 0) {
|
||||||
|
clipping = true;
|
||||||
|
} else if (ToDrawingMode(argv[0], possibleMode)) {
|
||||||
|
mode = possibleMode;
|
||||||
|
}
|
||||||
|
argc--;
|
||||||
|
argv++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// find and create the test
|
// find and create the test
|
||||||
Test* test = NULL;
|
Test* test = NULL;
|
||||||
@@ -136,7 +159,7 @@ main(int argc, char** argv)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
Benchmark app(test);
|
Benchmark app(test, mode, clipping);
|
||||||
app.Run();
|
app.Run();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,104 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2008-2009 Stephan Aßmus <[email protected]>
|
|
||||||
* All rights reserved. Distributed under the terms of the MIT license.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "ClippedLineTest.h"
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#include <Region.h>
|
|
||||||
#include <View.h>
|
|
||||||
|
|
||||||
#include "TestSupport.h"
|
|
||||||
|
|
||||||
|
|
||||||
ClippedLineTest::ClippedLineTest()
|
|
||||||
: Test(),
|
|
||||||
fTestDuration(0),
|
|
||||||
fTestStart(-1),
|
|
||||||
|
|
||||||
fLinesRendered(0),
|
|
||||||
fLinesPerIteration(20),
|
|
||||||
|
|
||||||
fIterations(0),
|
|
||||||
fMaxTestDuration(5000000),
|
|
||||||
|
|
||||||
fViewBounds(0, 0, -1, -1)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ClippedLineTest::~ClippedLineTest()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
ClippedLineTest::Prepare(BView* view)
|
|
||||||
{
|
|
||||||
fViewBounds = view->Bounds();
|
|
||||||
|
|
||||||
SetupClipping(view);
|
|
||||||
|
|
||||||
fTestDuration = 0;
|
|
||||||
fLinesRendered = 0;
|
|
||||||
fIterations = 0;
|
|
||||||
fTestStart = system_time();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
ClippedLineTest::RunIteration(BView* view)
|
|
||||||
{
|
|
||||||
bigtime_t now = system_time();
|
|
||||||
|
|
||||||
float vMiddle = (fViewBounds.top + fViewBounds.bottom) / 2;
|
|
||||||
|
|
||||||
for (uint32 i = 0; i < fLinesPerIteration; i++) {
|
|
||||||
view->SetHighColor(rand() % 255, rand() % 255, rand() % 255);
|
|
||||||
|
|
||||||
BPoint a;
|
|
||||||
a.x = random_number_between(fViewBounds.left, fViewBounds.right);
|
|
||||||
a.y = random_number_between(fViewBounds.top, vMiddle);
|
|
||||||
BPoint b;
|
|
||||||
b.x = random_number_between(fViewBounds.left, fViewBounds.right);
|
|
||||||
b.y = random_number_between(vMiddle, fViewBounds.bottom);
|
|
||||||
|
|
||||||
view->StrokeLine(a, b);
|
|
||||||
|
|
||||||
fLinesRendered++;
|
|
||||||
}
|
|
||||||
|
|
||||||
view->Sync();
|
|
||||||
|
|
||||||
fTestDuration += system_time() - now;
|
|
||||||
fIterations++;
|
|
||||||
|
|
||||||
return system_time() - fTestStart < fMaxTestDuration;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
ClippedLineTest::PrintResults()
|
|
||||||
{
|
|
||||||
if (fTestDuration == 0) {
|
|
||||||
printf("Test was not run.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
bigtime_t timeLeak = system_time() - fTestStart - fTestDuration;
|
|
||||||
printf("Lines per iteration: %lu\n", fLinesPerIteration);
|
|
||||||
printf("Clipping rects: %ld\n", fClippingRegion.CountRects());
|
|
||||||
printf("Total lines rendered: %llu\n", fLinesRendered);
|
|
||||||
printf("Lines per second: %.3f\n",
|
|
||||||
fLinesRendered * 1000000.0 / fTestDuration);
|
|
||||||
printf("Average time between iterations: %.4f seconds.\n",
|
|
||||||
(float)timeLeak / fIterations / 1000000);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Test*
|
|
||||||
ClippedLineTest::CreateTest()
|
|
||||||
{
|
|
||||||
return new ClippedLineTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2008-2009 Stephan Aßmus <[email protected]>
|
|
||||||
* All rights reserved. Distributed under the terms of the MIT license.
|
|
||||||
*/
|
|
||||||
#ifndef CLIPPED_LINE_TEST_H
|
|
||||||
#define CLIPPED_LINE_TEST_H
|
|
||||||
|
|
||||||
#include <Rect.h>
|
|
||||||
|
|
||||||
#include "Test.h"
|
|
||||||
|
|
||||||
class ClippedLineTest : public Test {
|
|
||||||
public:
|
|
||||||
ClippedLineTest();
|
|
||||||
virtual ~ClippedLineTest();
|
|
||||||
|
|
||||||
virtual void Prepare(BView* view);
|
|
||||||
virtual bool RunIteration(BView* view);
|
|
||||||
virtual void PrintResults();
|
|
||||||
|
|
||||||
static Test* CreateTest();
|
|
||||||
|
|
||||||
private:
|
|
||||||
bigtime_t fTestDuration;
|
|
||||||
bigtime_t fTestStart;
|
|
||||||
uint64 fLinesRendered;
|
|
||||||
uint32 fLinesPerIteration;
|
|
||||||
|
|
||||||
uint32 fIterations;
|
|
||||||
bigtime_t fMaxTestDuration;
|
|
||||||
|
|
||||||
BRect fViewBounds;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // CLIPPED_LINE_TEST_H
|
|
||||||
@@ -72,15 +72,19 @@ HorizontalLineTest::RunIteration(BView* view)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
HorizontalLineTest::PrintResults()
|
HorizontalLineTest::PrintResults(BView* view)
|
||||||
{
|
{
|
||||||
if (fTestDuration == 0) {
|
if (fTestDuration == 0) {
|
||||||
printf("Test was not run.\n");
|
printf("Test was not run.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
bigtime_t timeLeak = system_time() - fTestStart - fTestDuration;
|
bigtime_t timeLeak = system_time() - fTestStart - fTestDuration;
|
||||||
|
|
||||||
|
Test::PrintResults(view);
|
||||||
|
|
||||||
printf("Line width: %ld\n", fViewBounds.IntegerWidth() + 1 - 2);
|
printf("Line width: %ld\n", fViewBounds.IntegerWidth() + 1 - 2);
|
||||||
printf("Lines per iteration: %ld\n", fViewBounds.IntegerHeight() / 2);
|
printf("Lines per iteration: %ld\n", fViewBounds.IntegerHeight() / 2);
|
||||||
|
printf("Total lines rendered: %llu\n", fLinesRendered);
|
||||||
printf("Lines per second: %.3f\n",
|
printf("Lines per second: %.3f\n",
|
||||||
fLinesRendered * 1000000.0 / fTestDuration);
|
fLinesRendered * 1000000.0 / fTestDuration);
|
||||||
printf("Average time between iterations: %.4f seconds.\n",
|
printf("Average time between iterations: %.4f seconds.\n",
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ public:
|
|||||||
|
|
||||||
virtual void Prepare(BView* view);
|
virtual void Prepare(BView* view);
|
||||||
virtual bool RunIteration(BView* view);
|
virtual bool RunIteration(BView* view);
|
||||||
virtual void PrintResults();
|
virtual void PrintResults(BView* view);
|
||||||
|
|
||||||
static Test* CreateTest();
|
static Test* CreateTest();
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ UseHeaders [ FDirName os interface ] ;
|
|||||||
|
|
||||||
Application Benchmark :
|
Application Benchmark :
|
||||||
Benchmark.cpp
|
Benchmark.cpp
|
||||||
ClippedLineTest.cpp
|
DrawingModeToString.cpp
|
||||||
HorizontalLineTest.cpp
|
HorizontalLineTest.cpp
|
||||||
RandomLineTest.cpp
|
RandomLineTest.cpp
|
||||||
StringTest.cpp
|
StringTest.cpp
|
||||||
|
|||||||
@@ -76,14 +76,18 @@ RandomLineTest::RunIteration(BView* view)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
RandomLineTest::PrintResults()
|
RandomLineTest::PrintResults(BView* view)
|
||||||
{
|
{
|
||||||
if (fTestDuration == 0) {
|
if (fTestDuration == 0) {
|
||||||
printf("Test was not run.\n");
|
printf("Test was not run.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
bigtime_t timeLeak = system_time() - fTestStart - fTestDuration;
|
bigtime_t timeLeak = system_time() - fTestStart - fTestDuration;
|
||||||
|
|
||||||
|
Test::PrintResults(view);
|
||||||
|
|
||||||
printf("Lines per iteration: %lu\n", fLinesPerIteration);
|
printf("Lines per iteration: %lu\n", fLinesPerIteration);
|
||||||
|
printf("Total lines rendered: %llu\n", fLinesRendered);
|
||||||
printf("Lines per second: %.3f\n",
|
printf("Lines per second: %.3f\n",
|
||||||
fLinesRendered * 1000000.0 / fTestDuration);
|
fLinesRendered * 1000000.0 / fTestDuration);
|
||||||
printf("Average time between iterations: %.4f seconds.\n",
|
printf("Average time between iterations: %.4f seconds.\n",
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ public:
|
|||||||
|
|
||||||
virtual void Prepare(BView* view);
|
virtual void Prepare(BView* view);
|
||||||
virtual bool RunIteration(BView* view);
|
virtual bool RunIteration(BView* view);
|
||||||
virtual void PrintResults();
|
virtual void PrintResults(BView* view);
|
||||||
|
|
||||||
static Test* CreateTest();
|
static Test* CreateTest();
|
||||||
|
|
||||||
|
|||||||
@@ -97,13 +97,16 @@ StringTest::RunIteration(BView* view)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
StringTest::PrintResults()
|
StringTest::PrintResults(BView* view)
|
||||||
{
|
{
|
||||||
if (fTestDuration == 0) {
|
if (fTestDuration == 0) {
|
||||||
printf("Test was not run.\n");
|
printf("Test was not run.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
bigtime_t timeLeak = system_time() - fTestStart - fTestDuration;
|
bigtime_t timeLeak = system_time() - fTestStart - fTestDuration;
|
||||||
|
|
||||||
|
Test::PrintResults(view);
|
||||||
|
|
||||||
printf("Glyphs per DrawString() call: %ld\n", fGlyphsPerLine);
|
printf("Glyphs per DrawString() call: %ld\n", fGlyphsPerLine);
|
||||||
printf("Glyphs per second: %.3f\n",
|
printf("Glyphs per second: %.3f\n",
|
||||||
fGlyphsRendered * 1000000.0 / fTestDuration);
|
fGlyphsRendered * 1000000.0 / fTestDuration);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ public:
|
|||||||
|
|
||||||
virtual void Prepare(BView* view);
|
virtual void Prepare(BView* view);
|
||||||
virtual bool RunIteration(BView* view);
|
virtual bool RunIteration(BView* view);
|
||||||
virtual void PrintResults();
|
virtual void PrintResults(BView* view);
|
||||||
|
|
||||||
static Test* CreateTest();
|
static Test* CreateTest();
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,12 @@
|
|||||||
|
|
||||||
#include "Test.h"
|
#include "Test.h"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <View.h>
|
#include <View.h>
|
||||||
|
|
||||||
|
#include "DrawingModeToString.h"
|
||||||
|
|
||||||
|
|
||||||
Test::Test()
|
Test::Test()
|
||||||
{
|
{
|
||||||
@@ -35,3 +39,17 @@ Test::SetupClipping(BView* view)
|
|||||||
|
|
||||||
view->ConstrainClippingRegion(&fClippingRegion);
|
view->ConstrainClippingRegion(&fClippingRegion);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
Test::PrintResults(BView* view)
|
||||||
|
{
|
||||||
|
if (fClippingRegion.CountRects() > 0)
|
||||||
|
printf("Clipping rects: %ld\n", fClippingRegion.CountRects());
|
||||||
|
|
||||||
|
const char* string;
|
||||||
|
if (ToString(view->DrawingMode(), string))
|
||||||
|
printf("Drawing mode: %s\n", string);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ public:
|
|||||||
|
|
||||||
virtual void Prepare(BView* view) = 0;
|
virtual void Prepare(BView* view) = 0;
|
||||||
virtual bool RunIteration(BView* view) = 0;
|
virtual bool RunIteration(BView* view) = 0;
|
||||||
virtual void PrintResults() = 0;
|
virtual void PrintResults(BView* view);
|
||||||
|
|
||||||
void SetupClipping(BView* view);
|
void SetupClipping(BView* view);
|
||||||
|
|
||||||
|
|||||||
@@ -8,10 +8,12 @@
|
|||||||
|
|
||||||
|
|
||||||
TestView::TestView(BRect frame, Test* test, drawing_mode mode,
|
TestView::TestView(BRect frame, Test* test, drawing_mode mode,
|
||||||
const BMessenger& target)
|
bool useClipping, const BMessenger& target)
|
||||||
: BView(frame, "test view", B_FOLLOW_ALL, B_WILL_DRAW),
|
:
|
||||||
fTest(test),
|
BView(frame, "test view", B_FOLLOW_ALL, B_WILL_DRAW),
|
||||||
fTarget(target)
|
fTest(test),
|
||||||
|
fTarget(target),
|
||||||
|
fUseClipping(useClipping)
|
||||||
{
|
{
|
||||||
SetDrawingMode(mode);
|
SetDrawingMode(mode);
|
||||||
}
|
}
|
||||||
@@ -21,6 +23,8 @@ void
|
|||||||
TestView::AttachedToWindow()
|
TestView::AttachedToWindow()
|
||||||
{
|
{
|
||||||
fTest->Prepare(this);
|
fTest->Prepare(this);
|
||||||
|
if (fUseClipping)
|
||||||
|
fTest->SetupClipping(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -37,14 +41,14 @@ TestView::Draw(BRect updateRect)
|
|||||||
|
|
||||||
|
|
||||||
TestWindow::TestWindow(BRect frame, Test* test, drawing_mode mode,
|
TestWindow::TestWindow(BRect frame, Test* test, drawing_mode mode,
|
||||||
const BMessenger& target)
|
bool useClipping, const BMessenger& target)
|
||||||
: BWindow(frame, "Test Window", B_TITLED_WINDOW_LOOK,
|
: BWindow(frame, "Test Window", B_TITLED_WINDOW_LOOK,
|
||||||
B_FLOATING_ALL_WINDOW_FEEL, B_NOT_ZOOMABLE | B_NOT_RESIZABLE),
|
B_FLOATING_ALL_WINDOW_FEEL, B_NOT_ZOOMABLE | B_NOT_RESIZABLE),
|
||||||
fTarget(target),
|
fTarget(target),
|
||||||
fAllowedToQuit(false)
|
fAllowedToQuit(false)
|
||||||
{
|
{
|
||||||
TestView* view = new TestView(Bounds(), test, mode, target);
|
fTestView = new TestView(Bounds(), test, mode, useClipping, target);
|
||||||
AddChild(view);
|
AddChild(fTestView);
|
||||||
Show();
|
Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class Test;
|
|||||||
class TestView : public BView {
|
class TestView : public BView {
|
||||||
public:
|
public:
|
||||||
TestView(BRect frame, Test* test,
|
TestView(BRect frame, Test* test,
|
||||||
drawing_mode mode,
|
drawing_mode mode, bool useClipping,
|
||||||
const BMessenger& target);
|
const BMessenger& target);
|
||||||
|
|
||||||
virtual void AttachedToWindow();
|
virtual void AttachedToWindow();
|
||||||
@@ -31,21 +31,24 @@ public:
|
|||||||
private:
|
private:
|
||||||
Test* fTest;
|
Test* fTest;
|
||||||
BMessenger fTarget;
|
BMessenger fTarget;
|
||||||
|
bool fUseClipping;
|
||||||
};
|
};
|
||||||
|
|
||||||
// TestWindow
|
// TestWindow
|
||||||
class TestWindow : public BWindow {
|
class TestWindow : public BWindow {
|
||||||
public:
|
public:
|
||||||
TestWindow(BRect fame, Test* test,
|
TestWindow(BRect fame, Test* test,
|
||||||
drawing_mode mode,
|
drawing_mode mode, bool useClipping,
|
||||||
const BMessenger& target);
|
const BMessenger& target);
|
||||||
|
|
||||||
virtual bool QuitRequested();
|
virtual bool QuitRequested();
|
||||||
|
|
||||||
void SetAllowedToQuit(bool allowed);
|
void SetAllowedToQuit(bool allowed);
|
||||||
|
BView* View() const { return fTestView; }
|
||||||
private:
|
private:
|
||||||
BMessenger fTarget;
|
BMessenger fTarget;
|
||||||
bool fAllowedToQuit;
|
bool fAllowedToQuit;
|
||||||
|
TestView* fTestView;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TEST_WINDOW_H
|
#endif // TEST_WINDOW_H
|
||||||
|
|||||||
@@ -72,15 +72,19 @@ VerticalLineTest::RunIteration(BView* view)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
VerticalLineTest::PrintResults()
|
VerticalLineTest::PrintResults(BView* view)
|
||||||
{
|
{
|
||||||
if (fTestDuration == 0) {
|
if (fTestDuration == 0) {
|
||||||
printf("Test was not run.\n");
|
printf("Test was not run.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
bigtime_t timeLeak = system_time() - fTestStart - fTestDuration;
|
bigtime_t timeLeak = system_time() - fTestStart - fTestDuration;
|
||||||
|
|
||||||
|
Test::PrintResults(view);
|
||||||
|
|
||||||
printf("Line height: %ld\n", fViewBounds.IntegerHeight() + 1 - 2);
|
printf("Line height: %ld\n", fViewBounds.IntegerHeight() + 1 - 2);
|
||||||
printf("Lines per iteration: %ld\n", fViewBounds.IntegerWidth() / 2);
|
printf("Lines per iteration: %ld\n", fViewBounds.IntegerWidth() / 2);
|
||||||
|
printf("Total lines rendered: %llu\n", fLinesRendered);
|
||||||
printf("Lines per second: %.3f\n",
|
printf("Lines per second: %.3f\n",
|
||||||
fLinesRendered * 1000000.0 / fTestDuration);
|
fLinesRendered * 1000000.0 / fTestDuration);
|
||||||
printf("Average time between iterations: %.4f seconds.\n",
|
printf("Average time between iterations: %.4f seconds.\n",
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ public:
|
|||||||
|
|
||||||
virtual void Prepare(BView* view);
|
virtual void Prepare(BView* view);
|
||||||
virtual bool RunIteration(BView* view);
|
virtual bool RunIteration(BView* view);
|
||||||
virtual void PrintResults();
|
virtual void PrintResults(BView* view);
|
||||||
|
|
||||||
static Test* CreateTest();
|
static Test* CreateTest();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user