diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-07-22 19:28:40 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-07-22 19:28:40 +0000 |
commit | 49a07ad0977fb118fe91f5c908b6703e2d89dec6 (patch) | |
tree | 2e031274c894c4aa4ead62c34a5c6ffbb19ff36a /tools | |
parent | 5b3e2b96227f21d9643ca1678d777fd23767756d (diff) |
Last friday I changed this file to un-break the build.
I introduced a bug in my tool that is fixed by this CL.
R=caryclark@google.com
Author: sglez@google.com
Review URL: https://chromiumcodereview.appspot.com/19780004
git-svn-id: http://skia.googlecode.com/svn/trunk@10250 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tools')
-rw-r--r-- | tools/bbh_shootout.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/bbh_shootout.cpp b/tools/bbh_shootout.cpp index 4a3d7650ae..24d7b86500 100644 --- a/tools/bbh_shootout.cpp +++ b/tools/bbh_shootout.cpp @@ -14,6 +14,7 @@ #include "SkGraphics.h" #include "SkStream.h" #include "SkString.h" +#include "SkTArray.h" #include "TimerData.h" static const int kNumNormalRecordings = SkBENCHLOOP(10); @@ -265,8 +266,7 @@ static bool benchmark_loop( int argc, char **argv, const BenchmarkControl& benchControl, - Histogram** histogram) { - + SkTArray<Histogram>& histogram) { static const SkString timeFormat("%f"); TimerData timerData(timeFormat, timeFormat); for (int index = 1; index < argc; ++index) { @@ -280,8 +280,8 @@ static bool benchmark_loop( benchControl.fFunction(benchControl.fType, benchControl.fTileSize, path, pic, &timer); timerData.appendTimes(&timer, argc - 1 == index); - histogram[index - 1]->fPath = path; - histogram[index - 1]->fCpuTime = SkDoubleToScalar(timer.fCpu); + histogram[index - 1].fPath = path; + histogram[index - 1].fCpuTime = SkDoubleToScalar(timer.fCpu); } const SkString timerResult = timerData.getResult( @@ -321,14 +321,14 @@ int tool_main(int argc, char** argv) { return -1; } - Histogram* histograms[kNumBenchmarks]; + SkTArray<Histogram> histograms[kNumBenchmarks]; for (size_t i = 0; i < kNumBenchmarks; ++i) { - histograms[i] = SkNEW_ARRAY(Histogram, argc - 1); + histograms[i].reset(argc - 1); bool success = benchmark_loop( argc, argv, BenchmarkControl::Make(i), - &histograms[i]); + histograms[i]); if (!success) { SkDebugf("benchmark_loop failed at index %d", i); } |