typedef SkIRect (*MakeRectProc)(SkRandom&, int, int);
// Time how long it takes to build an QuadTree
-class BBoxBuildBench : public SkBenchmark {
+class QuadTreeBuildBench : public SkBenchmark {
public:
- BBoxBuildBench(const char* name, MakeRectProc proc, SkBBoxHierarchy* tree)
+ QuadTreeBuildBench(const char* name, MakeRectProc proc, SkBBoxHierarchy* tree)
: fTree(tree)
, fProc(proc) {
fName.append("quadtree_");
return backend == kNonRendering_Backend;
}
- virtual ~BBoxBuildBench() {
+ virtual ~QuadTreeBuildBench() {
fTree->unref();
}
protected:
};
// Time how long it takes to perform queries on an QuadTree
-class BBoxQueryBench : public SkBenchmark {
+class QuadTreeQueryBench : public SkBenchmark {
public:
enum QueryType {
kSmall_QueryType, // small queries
kFull_QueryType // queries that cover everything
};
- BBoxQueryBench(const char* name, MakeRectProc proc,
+ QuadTreeQueryBench(const char* name, MakeRectProc proc,
QueryType q, SkBBoxHierarchy* tree)
: fTree(tree)
, fProc(proc)
return backend == kNonRendering_Backend;
}
- virtual ~BBoxQueryBench() {
+ virtual ~QuadTreeQueryBench() {
fTree->unref();
}
protected:
///////////////////////////////////////////////////////////////////////////////
DEF_BENCH(
- return SkNEW_ARGS(BBoxBuildBench, ("XYordered", &make_XYordered_rects,
+ return SkNEW_ARGS(QuadTreeBuildBench, ("XYordered", &make_XYordered_rects,
SkNEW_ARGS(SkQuadTree, (QUAD_TREE_BOUNDS))));
)
DEF_BENCH(
- return SkNEW_ARGS(BBoxQueryBench, ("XYordered", &make_XYordered_rects,
- BBoxQueryBench::kRandom_QueryType,
+ return SkNEW_ARGS(QuadTreeQueryBench, ("XYordered", &make_XYordered_rects,
+ QuadTreeQueryBench::kRandom_QueryType,
SkNEW_ARGS(SkQuadTree, (QUAD_TREE_BOUNDS))));
)
DEF_BENCH(
- return SkNEW_ARGS(BBoxBuildBench, ("YXordered", &make_YXordered_rects,
+ return SkNEW_ARGS(QuadTreeBuildBench, ("YXordered", &make_YXordered_rects,
SkNEW_ARGS(SkQuadTree, (QUAD_TREE_BOUNDS))));
)
DEF_BENCH(
- return SkNEW_ARGS(BBoxQueryBench, ("YXordered", &make_YXordered_rects,
- BBoxQueryBench::kRandom_QueryType,
+ return SkNEW_ARGS(QuadTreeQueryBench, ("YXordered", &make_YXordered_rects,
+ QuadTreeQueryBench::kRandom_QueryType,
SkNEW_ARGS(SkQuadTree, (QUAD_TREE_BOUNDS))));
)
DEF_BENCH(
- return SkNEW_ARGS(BBoxBuildBench, ("random", &make_random_rects,
+ return SkNEW_ARGS(QuadTreeBuildBench, ("random", &make_random_rects,
SkNEW_ARGS(SkQuadTree, (QUAD_TREE_BOUNDS))));
)
DEF_BENCH(
- return SkNEW_ARGS(BBoxQueryBench, ("random", &make_random_rects,
- BBoxQueryBench::kRandom_QueryType,
+ return SkNEW_ARGS(QuadTreeQueryBench, ("random", &make_random_rects,
+ QuadTreeQueryBench::kRandom_QueryType,
SkNEW_ARGS(SkQuadTree, (QUAD_TREE_BOUNDS))));
)
DEF_BENCH(
- return SkNEW_ARGS(BBoxBuildBench, ("concentric", &make_concentric_rects_increasing,
+ return SkNEW_ARGS(QuadTreeBuildBench, ("concentric", &make_concentric_rects_increasing,
SkNEW_ARGS(SkQuadTree, (QUAD_TREE_BOUNDS))));
)
DEF_BENCH(
- return SkNEW_ARGS(BBoxQueryBench, ("concentric", &make_concentric_rects_increasing,
- BBoxQueryBench::kRandom_QueryType,
+ return SkNEW_ARGS(QuadTreeQueryBench, ("concentric", &make_concentric_rects_increasing,
+ QuadTreeQueryBench::kRandom_QueryType,
SkNEW_ARGS(SkQuadTree, (QUAD_TREE_BOUNDS))));
)
typedef SkIRect (*MakeRectProc)(SkRandom&, int, int);
// Time how long it takes to build an R-Tree either bulk-loaded or not
-class BBoxBuildBench : public SkBenchmark {
+class RTreeBuildBench : public SkBenchmark {
public:
- BBoxBuildBench(const char* name, MakeRectProc proc, bool bulkLoad,
+ RTreeBuildBench(const char* name, MakeRectProc proc, bool bulkLoad,
SkBBoxHierarchy* tree)
: fTree(tree)
, fProc(proc)
return backend == kNonRendering_Backend;
}
- virtual ~BBoxBuildBench() {
+ virtual ~RTreeBuildBench() {
fTree->unref();
}
protected:
};
// Time how long it takes to perform queries on an R-Tree, bulk-loaded or not
-class BBoxQueryBench : public SkBenchmark {
+class RTreeQueryBench : public SkBenchmark {
public:
enum QueryType {
kSmall_QueryType, // small queries
kFull_QueryType // queries that cover everything
};
- BBoxQueryBench(const char* name, MakeRectProc proc, bool bulkLoad,
+ RTreeQueryBench(const char* name, MakeRectProc proc, bool bulkLoad,
QueryType q, SkBBoxHierarchy* tree)
: fTree(tree)
, fProc(proc)
return backend == kNonRendering_Backend;
}
- virtual ~BBoxQueryBench() {
+ virtual ~RTreeQueryBench() {
fTree->unref();
}
protected:
///////////////////////////////////////////////////////////////////////////////
DEF_BENCH(
- return SkNEW_ARGS(BBoxBuildBench, ("XYordered", &make_XYordered_rects, false,
+ return SkNEW_ARGS(RTreeBuildBench, ("XYordered", &make_XYordered_rects, false,
SkRTree::Create(5, 16)));
)
DEF_BENCH(
- return SkNEW_ARGS(BBoxBuildBench, ("XYordered", &make_XYordered_rects, true,
+ return SkNEW_ARGS(RTreeBuildBench, ("XYordered", &make_XYordered_rects, true,
SkRTree::Create(5, 16)));
)
DEF_BENCH(
- return SkNEW_ARGS(BBoxBuildBench, ("(unsorted)XYordered", &make_XYordered_rects, true,
+ return SkNEW_ARGS(RTreeBuildBench, ("(unsorted)XYordered", &make_XYordered_rects, true,
SkRTree::Create(5, 16, 1, false)));
)
DEF_BENCH(
- return SkNEW_ARGS(BBoxQueryBench, ("XYordered", &make_XYordered_rects, true,
- BBoxQueryBench::kRandom_QueryType, SkRTree::Create(5, 16)));
+ return SkNEW_ARGS(RTreeQueryBench, ("XYordered", &make_XYordered_rects, true,
+ RTreeQueryBench::kRandom_QueryType, SkRTree::Create(5, 16)));
)
DEF_BENCH(
- return SkNEW_ARGS(BBoxQueryBench, ("(unsorted)XYordered", &make_XYordered_rects, true,
- BBoxQueryBench::kRandom_QueryType, SkRTree::Create(5, 16, 1, false)));
+ return SkNEW_ARGS(RTreeQueryBench, ("(unsorted)XYordered", &make_XYordered_rects, true,
+ RTreeQueryBench::kRandom_QueryType, SkRTree::Create(5, 16, 1, false)));
)
DEF_BENCH(
- return SkNEW_ARGS(BBoxBuildBench, ("YXordered", &make_YXordered_rects, false,
+ return SkNEW_ARGS(RTreeBuildBench, ("YXordered", &make_YXordered_rects, false,
SkRTree::Create(5, 16)));
)
DEF_BENCH(
- return SkNEW_ARGS(BBoxBuildBench, ("YXordered", &make_YXordered_rects, true,
+ return SkNEW_ARGS(RTreeBuildBench, ("YXordered", &make_YXordered_rects, true,
SkRTree::Create(5, 16)));
)
DEF_BENCH(
- return SkNEW_ARGS(BBoxBuildBench, ("(unsorted)YXordered", &make_YXordered_rects, true,
+ return SkNEW_ARGS(RTreeBuildBench, ("(unsorted)YXordered", &make_YXordered_rects, true,
SkRTree::Create(5, 16, 1, false)));
)
DEF_BENCH(
- return SkNEW_ARGS(BBoxQueryBench, ("YXordered", &make_YXordered_rects, true,
- BBoxQueryBench::kRandom_QueryType, SkRTree::Create(5, 16)));
+ return SkNEW_ARGS(RTreeQueryBench, ("YXordered", &make_YXordered_rects, true,
+ RTreeQueryBench::kRandom_QueryType, SkRTree::Create(5, 16)));
)
DEF_BENCH(
- return SkNEW_ARGS(BBoxQueryBench, ("(unsorted)YXordered", &make_YXordered_rects, true,
- BBoxQueryBench::kRandom_QueryType, SkRTree::Create(5, 16, 1, false)));
+ return SkNEW_ARGS(RTreeQueryBench, ("(unsorted)YXordered", &make_YXordered_rects, true,
+ RTreeQueryBench::kRandom_QueryType, SkRTree::Create(5, 16, 1, false)));
)
DEF_BENCH(
- return SkNEW_ARGS(BBoxBuildBench, ("random", &make_random_rects, false,
+ return SkNEW_ARGS(RTreeBuildBench, ("random", &make_random_rects, false,
SkRTree::Create(5, 16)));
)
DEF_BENCH(
- return SkNEW_ARGS(BBoxBuildBench, ("random", &make_random_rects, true,
+ return SkNEW_ARGS(RTreeBuildBench, ("random", &make_random_rects, true,
SkRTree::Create(5, 16)));
)
DEF_BENCH(
- return SkNEW_ARGS(BBoxBuildBench, ("(unsorted)random", &make_random_rects, true,
+ return SkNEW_ARGS(RTreeBuildBench, ("(unsorted)random", &make_random_rects, true,
SkRTree::Create(5, 16, 1, false)));
)
DEF_BENCH(
- return SkNEW_ARGS(BBoxQueryBench, ("random", &make_random_rects, true,
- BBoxQueryBench::kRandom_QueryType, SkRTree::Create(5, 16)));
+ return SkNEW_ARGS(RTreeQueryBench, ("random", &make_random_rects, true,
+ RTreeQueryBench::kRandom_QueryType, SkRTree::Create(5, 16)));
)
DEF_BENCH(
- return SkNEW_ARGS(BBoxQueryBench, ("(unsorted)random", &make_random_rects, true,
- BBoxQueryBench::kRandom_QueryType, SkRTree::Create(5, 16, 1, false)));
+ return SkNEW_ARGS(RTreeQueryBench, ("(unsorted)random", &make_random_rects, true,
+ RTreeQueryBench::kRandom_QueryType, SkRTree::Create(5, 16, 1, false)));
)
DEF_BENCH(
- return SkNEW_ARGS(BBoxBuildBench, ("concentric",
+ return SkNEW_ARGS(RTreeBuildBench, ("concentric",
&make_concentric_rects_increasing, true, SkRTree::Create(5, 16)));
)
DEF_BENCH(
- return SkNEW_ARGS(BBoxBuildBench, ("(unsorted)concentric",
+ return SkNEW_ARGS(RTreeBuildBench, ("(unsorted)concentric",
&make_concentric_rects_increasing, true, SkRTree::Create(5, 16, 1, false)));
)
DEF_BENCH(
- return SkNEW_ARGS(BBoxQueryBench, ("concentric", &make_concentric_rects_increasing, true,
- BBoxQueryBench::kRandom_QueryType, SkRTree::Create(5, 16)));
+ return SkNEW_ARGS(RTreeQueryBench, ("concentric", &make_concentric_rects_increasing, true,
+ RTreeQueryBench::kRandom_QueryType, SkRTree::Create(5, 16)));
)
DEF_BENCH(
- return SkNEW_ARGS(BBoxQueryBench, ("(unsorted)concentric", &make_concentric_rects_increasing, true,
- BBoxQueryBench::kRandom_QueryType, SkRTree::Create(5, 16, 1, false)));
+ return SkNEW_ARGS(RTreeQueryBench, ("(unsorted)concentric", &make_concentric_rects_increasing, true,
+ RTreeQueryBench::kRandom_QueryType, SkRTree::Create(5, 16, 1, false)));
)