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

Side by Side Diff: bench/MemoryBench.cpp

Issue 23876006: Refactoring: get rid of the SkBenchmark void* parameter. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: sync to head 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « bench/MatrixConvolutionBench.cpp ('k') | bench/MemsetBench.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkBenchmark.h" 8 #include "SkBenchmark.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkPaint.h" 10 #include "SkPaint.h"
11 #include "SkRandom.h" 11 #include "SkRandom.h"
12 #include "SkChunkAlloc.h" 12 #include "SkChunkAlloc.h"
13 #include "SkString.h" 13 #include "SkString.h"
14 14
15 class ChunkAllocBench : public SkBenchmark { 15 class ChunkAllocBench : public SkBenchmark {
16 SkString fName; 16 SkString fName;
17 size_t fMinSize; 17 size_t fMinSize;
18 public: 18 public:
19 ChunkAllocBench(void* param, size_t minSize) : INHERITED(param) { 19 ChunkAllocBench(size_t minSize) {
20 fMinSize = minSize; 20 fMinSize = minSize;
21 fName.printf("chunkalloc_" SK_SIZE_T_SPECIFIER, minSize); 21 fName.printf("chunkalloc_" SK_SIZE_T_SPECIFIER, minSize);
22 fIsRendering = false; 22 fIsRendering = false;
23 } 23 }
24 24
25 protected: 25 protected:
26 virtual const char* onGetName() SK_OVERRIDE { 26 virtual const char* onGetName() SK_OVERRIDE {
27 return fName.c_str(); 27 return fName.c_str();
28 } 28 }
29 29
(...skipping 13 matching lines...) Expand all
43 calls += 1; 43 calls += 1;
44 } 44 }
45 alloc.reset(); 45 alloc.reset();
46 } 46 }
47 } 47 }
48 48
49 private: 49 private:
50 typedef SkBenchmark INHERITED; 50 typedef SkBenchmark INHERITED;
51 }; 51 };
52 52
53 static SkBenchmark* F0(void* p) { return new ChunkAllocBench(p, 64); } 53 DEF_BENCH( return new ChunkAllocBench(64); )
54 static SkBenchmark* F1(void* p) { return new ChunkAllocBench(p, 8*1024); } 54 DEF_BENCH( return new ChunkAllocBench(8*1024); )
55
56 static BenchRegistry gR0(F0);
57 static BenchRegistry gR1(F1);
OLDNEW
« no previous file with comments | « bench/MatrixConvolutionBench.cpp ('k') | bench/MemsetBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698