aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/RTreeBench.cpp
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2014-10-02 07:41:56 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-02 07:41:56 -0700
commit6bd41969a0f2283a7a7320bb0025551353c241ec (patch)
tree8f46646875b1d810ff4156f220ee2eb5d808f664 /bench/RTreeBench.cpp
parent29fe24c0ed44c1ee8f21df16f4bdc058f27eab77 (diff)
BBHs: void* data -> unsigned data
Now that the old backend's not using BBHs, we can specialize them for SkRecord's needs. The only thing we really want to store is op index, which should always be small enough to fit into an unsigned (unsigned also helps keep it straight from other ints floating around). This means we'll need half (32-bit) or a quarter (64-bit) the bytes in SkTileGrid, because we don't have to store an extra int for ordering. BUG=skia:2834 Review URL: https://codereview.chromium.org/617393004
Diffstat (limited to 'bench/RTreeBench.cpp')
-rw-r--r--bench/RTreeBench.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/bench/RTreeBench.cpp b/bench/RTreeBench.cpp
index 5442f7e261..21c1d79a94 100644
--- a/bench/RTreeBench.cpp
+++ b/bench/RTreeBench.cpp
@@ -51,8 +51,7 @@ protected:
SkRandom rand;
for (int i = 0; i < loops; ++i) {
for (int j = 0; j < NUM_BUILD_RECTS; ++j) {
- fTree->insert(reinterpret_cast<void*>(j), fProc(rand, j, NUM_BUILD_RECTS),
- fBulkLoad);
+ fTree->insert(j, fProc(rand, j, NUM_BUILD_RECTS), fBulkLoad);
}
fTree->flushDeferredInserts();
fTree->clear();
@@ -104,9 +103,7 @@ protected:
virtual void onPreDraw() SK_OVERRIDE {
SkRandom rand;
for (int j = 0; j < NUM_QUERY_RECTS; ++j) {
- fTree->insert(reinterpret_cast<void*>(j),
- fProc(rand, j, NUM_QUERY_RECTS),
- fBulkLoad);
+ fTree->insert(j, fProc(rand, j, NUM_QUERY_RECTS), fBulkLoad);
}
fTree->flushDeferredInserts();
}
@@ -114,7 +111,7 @@ protected:
virtual void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE {
SkRandom rand;
for (int i = 0; i < loops; ++i) {
- SkTDArray<void*> hits;
+ SkTDArray<unsigned> hits;
SkRect query;
switch(fQuery) {
case kSmall_QueryType: