Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2903)

Unified Diff: bench/RTreeBench.cpp

Issue 23478013: Major bench refactoring. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: merge with head agani Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bench/PremulAndUnpremulAlphaOpsBench.cpp ('k') | bench/ReadPixBench.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/RTreeBench.cpp
diff --git a/bench/RTreeBench.cpp b/bench/RTreeBench.cpp
index 7dc54ca329d76ad6af675f32b1aaa3ad466ed3f6..99f8ca8f1234e0ca05950bab38cbb2f10919dc04 100644
--- a/bench/RTreeBench.cpp
+++ b/bench/RTreeBench.cpp
@@ -16,7 +16,6 @@
static const int GENERATE_EXTENTS = 1000;
static const int NUM_BUILD_RECTS = 500;
static const int NUM_QUERY_RECTS = 5000;
-static const int NUM_QUERIES = 1000;
static const int GRID_WIDTH = 100;
typedef SkIRect (*MakeRectProc)(SkRandom&, int, int);
@@ -47,7 +46,7 @@ protected:
}
virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
SkRandom rand;
- for (int i = 0; i < SkBENCHLOOP(100); ++i) {
+ for (int i = 0; i < this->getLoops(); ++i) {
for (int j = 0; j < NUM_BUILD_RECTS; ++j) {
fTree->insert(reinterpret_cast<void*>(j), fProc(rand, j, NUM_BUILD_RECTS),
fBulkLoad);
@@ -98,16 +97,17 @@ protected:
}
virtual void onPreDraw() SK_OVERRIDE {
SkRandom rand;
- for (int j = 0; j < SkBENCHLOOP(NUM_QUERY_RECTS); ++j) {
- fTree->insert(reinterpret_cast<void*>(j), fProc(rand, j,
- SkBENCHLOOP(NUM_QUERY_RECTS)), fBulkLoad);
+ for (int j = 0; j < NUM_QUERY_RECTS; ++j) {
+ fTree->insert(reinterpret_cast<void*>(j),
+ fProc(rand, j, NUM_QUERY_RECTS),
+ fBulkLoad);
}
fTree->flushDeferredInserts();
}
virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
SkRandom rand;
- for (int i = 0; i < SkBENCHLOOP(NUM_QUERIES); ++i) {
+ for (int i = 0; i < this->getLoops(); ++i) {
SkTDArray<void*> hits;
SkIRect query;
switch(fQuery) {
« no previous file with comments | « bench/PremulAndUnpremulAlphaOpsBench.cpp ('k') | bench/ReadPixBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698