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

Side by Side Diff: bench/LineBench.cpp

Issue 23576015: Change old PRG to be SkLCGRandom; change new one to SkRandom (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix some spurious SkMWCRandoms 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/HairlinePathBench.cpp ('k') | bench/MathBench.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 "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 14 matching lines...) Expand all
25 N = SkBENCHLOOP(10) 25 N = SkBENCHLOOP(10)
26 }; 26 };
27 SkPoint fPts[PTS]; 27 SkPoint fPts[PTS];
28 28
29 public: 29 public:
30 LineBench(void* param, SkScalar width, bool doAA) : INHERITED(param) { 30 LineBench(void* param, SkScalar width, bool doAA) : INHERITED(param) {
31 fStrokeWidth = width; 31 fStrokeWidth = width;
32 fDoAA = doAA; 32 fDoAA = doAA;
33 fName.printf("lines_%g_%s", width, doAA ? "AA" : "BW"); 33 fName.printf("lines_%g_%s", width, doAA ? "AA" : "BW");
34 34
35 SkMWCRandom rand; 35 SkRandom rand;
36 for (int i = 0; i < PTS; ++i) { 36 for (int i = 0; i < PTS; ++i) {
37 fPts[i].set(rand.nextUScalar1() * 640, rand.nextUScalar1() * 480); 37 fPts[i].set(rand.nextUScalar1() * 640, rand.nextUScalar1() * 480);
38 } 38 }
39 } 39 }
40 40
41 protected: 41 protected:
42 virtual const char* onGetName() SK_OVERRIDE { 42 virtual const char* onGetName() SK_OVERRIDE {
43 return fName.c_str(); 43 return fName.c_str();
44 } 44 }
45 45
(...skipping 12 matching lines...) Expand all
58 58
59 private: 59 private:
60 typedef SkBenchmark INHERITED; 60 typedef SkBenchmark INHERITED;
61 }; 61 };
62 62
63 DEF_BENCH(return new LineBench(p, 0, false);) 63 DEF_BENCH(return new LineBench(p, 0, false);)
64 DEF_BENCH(return new LineBench(p, SK_Scalar1, false);) 64 DEF_BENCH(return new LineBench(p, SK_Scalar1, false);)
65 DEF_BENCH(return new LineBench(p, 0, true);) 65 DEF_BENCH(return new LineBench(p, 0, true);)
66 DEF_BENCH(return new LineBench(p, SK_Scalar1/2, true);) 66 DEF_BENCH(return new LineBench(p, SK_Scalar1/2, true);)
67 DEF_BENCH(return new LineBench(p, SK_Scalar1, true);) 67 DEF_BENCH(return new LineBench(p, SK_Scalar1, true);)
OLDNEW
« no previous file with comments | « bench/HairlinePathBench.cpp ('k') | bench/MathBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698