aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2014-10-29 14:15:10 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-29 14:15:10 -0700
commit6838d854a87e79f1fbb7b89b9f395155ad44dc0a (patch)
tree6c539b237606beca31239ef7441000f55b4d6384 /bench
parent2c8371aea7d1313efc4e224f962a9f38570981c8 (diff)
Try out SkTree in nanobench.
Looks like a fairly large recording speed win with no playback cost. BUG=skia: Review URL: https://codereview.chromium.org/653023003
Diffstat (limited to 'bench')
-rw-r--r--bench/RecordingBench.cpp9
-rw-r--r--bench/SKPBench.cpp2
-rw-r--r--bench/nanobench.cpp12
3 files changed, 5 insertions, 18 deletions
diff --git a/bench/RecordingBench.cpp b/bench/RecordingBench.cpp
index ee626bc52c..76d557d48b 100644
--- a/bench/RecordingBench.cpp
+++ b/bench/RecordingBench.cpp
@@ -10,8 +10,6 @@
#include "SkBBHFactory.h"
#include "SkPictureRecorder.h"
-static const int kTileSize = 256;
-
RecordingBench::RecordingBench(const char* name, const SkPicture* pic, bool useBBH)
: fSrc(SkRef(pic))
, fName(name)
@@ -31,12 +29,7 @@ SkIPoint RecordingBench::onGetSize() {
}
void RecordingBench::onDraw(const int loops, SkCanvas*) {
- SkTileGridFactory::TileGridInfo info;
- info.fTileInterval.set(kTileSize, kTileSize);
- info.fMargin.setEmpty();
- info.fOffset.setZero();
- SkTileGridFactory factory(info);
-
+ SkRTreeFactory factory;
const SkScalar w = fSrc->cullRect().width(),
h = fSrc->cullRect().height();
diff --git a/bench/SKPBench.cpp b/bench/SKPBench.cpp
index 9c96ef6f53..5844d8a588 100644
--- a/bench/SKPBench.cpp
+++ b/bench/SKPBench.cpp
@@ -8,7 +8,7 @@
#include "SKPBench.h"
#include "SkCommandLineFlags.h"
-DECLARE_int32(benchTile);
+DEFINE_int32(benchTile, 256, "Tile dimension used for SKP playback.");
SKPBench::SKPBench(const char* name, const SkPicture* pic, const SkIRect& clip, SkScalar scale)
: fPic(SkRef(pic))
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index a5a96aa613..31b69fa6e2 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -17,7 +17,7 @@
#include "Stats.h"
#include "Timer.h"
-#include "SkBBHFactory.h"
+#include "SkBBoxHierarchy.h"
#include "SkCanvas.h"
#include "SkCommonFlags.h"
#include "SkForceLinking.h"
@@ -70,7 +70,6 @@ DEFINE_int32(maxLoops, 1000000, "Never run a bench more times than this.");
DEFINE_string(clip, "0,0,1000,1000", "Clip for SKPs.");
DEFINE_string(scales, "1.0", "Space-separated scales for SKPs.");
DEFINE_bool(bbh, true, "Build a BBH for SKPs?");
-DEFINE_int32(benchTile, 256, "Tile dimension used for SKP playback.");
DEFINE_int32(flushEvery, 10, "Flush --outResultsFile every Nth run.");
static SkString humanize(double ms) {
@@ -515,12 +514,7 @@ public:
}
if (FLAGS_bbh) {
// The SKP we read off disk doesn't have a BBH. Re-record so it grows one.
- const SkTileGridFactory::TileGridInfo info = {
- SkISize::Make(FLAGS_benchTile, FLAGS_benchTile), // tile interval
- SkISize::Make(0,0), // margin
- SkIPoint::Make(0,0), // offset
- };
- SkTileGridFactory factory(info);
+ SkRTreeFactory factory;
SkPictureRecorder recorder;
pic->playback(recorder.beginRecording(pic->cullRect().width(),
pic->cullRect().height(),
@@ -726,7 +720,7 @@ int nanobench_main() {
#if SK_SUPPORT_GPU && GR_CACHE_STATS
if (FLAGS_veryVerbose &&
Benchmark::kGPU_Backend == targets[j]->config.backend) {
- gGrFactory->get(targets[j]->config.ctxType)->printCacheStats();
+ gGrFactory->get(targets[j]->config.ctxType)->printCacheStats();
}
#endif
}