summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
968b44d)
Running all the benchmarks is relatively long, so allow running individual
ones only.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73467
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
height = 600;
numLines = 10000;
height = 600;
numLines = 10000;
+
+ testBitmaps =
+ testLines =
+ testRectangles = false;
+
+ bool testBitmaps,
+ testLines,
+ testRectangles;
} opts;
class GraphicsBenchmarkFrame : public wxFrame
} opts;
class GraphicsBenchmarkFrame : public wxFrame
void BenchmarkLines(const char *msg, wxDC& dc)
{
void BenchmarkLines(const char *msg, wxDC& dc)
{
+ if ( !opts.testLines )
+ return;
+
if ( opts.mapMode != 0 )
dc.SetMapMode((wxMappingMode)opts.mapMode);
if ( opts.penWidth != 0 )
if ( opts.mapMode != 0 )
dc.SetMapMode((wxMappingMode)opts.mapMode);
if ( opts.penWidth != 0 )
void BenchmarkRectangles(const char *msg, wxDC& dc)
{
void BenchmarkRectangles(const char *msg, wxDC& dc)
{
+ if ( !opts.testRectangles )
+ return;
+
if ( opts.mapMode != 0 )
dc.SetMapMode((wxMappingMode)opts.mapMode);
if ( opts.penWidth != 0 )
if ( opts.mapMode != 0 )
dc.SetMapMode((wxMappingMode)opts.mapMode);
if ( opts.penWidth != 0 )
void BenchmarkBitmaps(const char *msg, wxDC& dc)
{
void BenchmarkBitmaps(const char *msg, wxDC& dc)
{
+ if ( !opts.testBitmaps )
+ return;
+
if ( opts.mapMode != 0 )
dc.SetMapMode((wxMappingMode)opts.mapMode);
if ( opts.penWidth != 0 )
if ( opts.mapMode != 0 )
dc.SetMapMode((wxMappingMode)opts.mapMode);
if ( opts.penWidth != 0 )
{
static const wxCmdLineEntryDesc desc[] =
{
{
static const wxCmdLineEntryDesc desc[] =
{
+ { wxCMD_LINE_SWITCH, "", "bitmaps" },
+ { wxCMD_LINE_SWITCH, "", "lines" },
+ { wxCMD_LINE_SWITCH, "", "rectangles" },
{ wxCMD_LINE_OPTION, "m", "map-mode", "", wxCMD_LINE_VAL_NUMBER },
{ wxCMD_LINE_OPTION, "p", "pen-width", "", wxCMD_LINE_VAL_NUMBER },
{ wxCMD_LINE_OPTION, "w", "width", "", wxCMD_LINE_VAL_NUMBER },
{ wxCMD_LINE_OPTION, "m", "map-mode", "", wxCMD_LINE_VAL_NUMBER },
{ wxCMD_LINE_OPTION, "p", "pen-width", "", wxCMD_LINE_VAL_NUMBER },
{ wxCMD_LINE_OPTION, "w", "width", "", wxCMD_LINE_VAL_NUMBER },
if ( parser.Found("L", &opts.numLines) && opts.numLines < 1 )
return false;
if ( parser.Found("L", &opts.numLines) && opts.numLines < 1 )
return false;
+ opts.testBitmaps = parser.Found("bitmaps");
+ opts.testLines = parser.Found("lines");
+ opts.testRectangles = parser.Found("rectangles");
+ if ( !(opts.testBitmaps || opts.testLines || opts.testRectangles) )
+ {
+ // Do everything by default.
+ opts.testBitmaps =
+ opts.testLines =
+ opts.testRectangles = true;
+ }
+