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

Side by Side Diff: bench/MorphologyBench.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/MatrixConvolutionBench.cpp ('k') | bench/PathBench.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 #include "SkBenchmark.h" 7 #include "SkBenchmark.h"
8 #include "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkPaint.h" 9 #include "SkPaint.h"
10 #include "SkRandom.h" 10 #include "SkRandom.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 virtual const char* onGetName() { 52 virtual const char* onGetName() {
53 return fName.c_str(); 53 return fName.c_str();
54 } 54 }
55 55
56 virtual void onDraw(SkCanvas* canvas) { 56 virtual void onDraw(SkCanvas* canvas) {
57 SkPaint paint; 57 SkPaint paint;
58 this->setupPaint(&paint); 58 this->setupPaint(&paint);
59 59
60 paint.setAntiAlias(true); 60 paint.setAntiAlias(true);
61 61
62 SkMWCRandom rand; 62 SkRandom rand;
63 for (int i = 0; i < SkBENCHLOOP(3); i++) { 63 for (int i = 0; i < SkBENCHLOOP(3); i++) {
64 SkRect r = SkRect::MakeWH(rand.nextUScalar1() * 400, 64 SkRect r = SkRect::MakeWH(rand.nextUScalar1() * 400,
65 rand.nextUScalar1() * 400); 65 rand.nextUScalar1() * 400);
66 r.offset(fRadius, fRadius); 66 r.offset(fRadius, fRadius);
67 67
68 if (fRadius > 0) { 68 if (fRadius > 0) {
69 SkMorphologyImageFilter* mf = NULL; 69 SkMorphologyImageFilter* mf = NULL;
70 switch (fStyle) { 70 switch (fStyle) {
71 case kDilate_MT: 71 case kDilate_MT:
72 mf = new SkDilateImageFilter(SkScalarFloorToInt(fRadius), 72 mf = new SkDilateImageFilter(SkScalarFloorToInt(fRadius),
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 107
108 static BenchRegistry gReg10(Fact10); 108 static BenchRegistry gReg10(Fact10);
109 static BenchRegistry gReg11(Fact11); 109 static BenchRegistry gReg11(Fact11);
110 110
111 static BenchRegistry gReg20(Fact20); 111 static BenchRegistry gReg20(Fact20);
112 static BenchRegistry gReg21(Fact21); 112 static BenchRegistry gReg21(Fact21);
113 113
114 static BenchRegistry gRegNone(FactNone); 114 static BenchRegistry gRegNone(FactNone);
115 115
116 #endif 116 #endif
OLDNEW
« no previous file with comments | « bench/MatrixConvolutionBench.cpp ('k') | bench/PathBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698