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

Side by Side Diff: bench/BlurBench.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/BitmapRectBench.cpp ('k') | bench/ChartBench.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "SkBenchmark.h" 8 #include "SkBenchmark.h"
9 #include "SkBlurMask.h" 9 #include "SkBlurMask.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.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(10); i++) { 63 for (int i = 0; i < SkBENCHLOOP(10); 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 SkMaskFilter* mf = SkBlurMaskFilter::Create(fStyle, 69 SkMaskFilter* mf = SkBlurMaskFilter::Create(fStyle,
70 SkBlurMask::ConvertRadiusToSigma(fRa dius), 70 SkBlurMask::ConvertRadiusToSigma(fRa dius),
71 fFlags); 71 fFlags);
72 paint.setMaskFilter(mf)->unref(); 72 paint.setMaskFilter(mf)->unref();
(...skipping 28 matching lines...) Expand all
101 101
102 DEF_BENCH(return new BlurBench(p, SMALL, SkBlurMaskFilter::kNormal_BlurStyle, Sk BlurMaskFilter::kHighQuality_BlurFlag);) 102 DEF_BENCH(return new BlurBench(p, SMALL, SkBlurMaskFilter::kNormal_BlurStyle, Sk BlurMaskFilter::kHighQuality_BlurFlag);)
103 103
104 DEF_BENCH(return new BlurBench(p, BIG, SkBlurMaskFilter::kNormal_BlurStyle, SkBl urMaskFilter::kHighQuality_BlurFlag);) 104 DEF_BENCH(return new BlurBench(p, BIG, SkBlurMaskFilter::kNormal_BlurStyle, SkBl urMaskFilter::kHighQuality_BlurFlag);)
105 105
106 DEF_BENCH(return new BlurBench(p, REALBIG, SkBlurMaskFilter::kNormal_BlurStyle, SkBlurMaskFilter::kHighQuality_BlurFlag);) 106 DEF_BENCH(return new BlurBench(p, REALBIG, SkBlurMaskFilter::kNormal_BlurStyle, SkBlurMaskFilter::kHighQuality_BlurFlag);)
107 107
108 DEF_BENCH(return new BlurBench(p, REAL, SkBlurMaskFilter::kNormal_BlurStyle, SkB lurMaskFilter::kHighQuality_BlurFlag);) 108 DEF_BENCH(return new BlurBench(p, REAL, SkBlurMaskFilter::kNormal_BlurStyle, SkB lurMaskFilter::kHighQuality_BlurFlag);)
109 109
110 DEF_BENCH(return new BlurBench(p, 0, SkBlurMaskFilter::kNormal_BlurStyle);) 110 DEF_BENCH(return new BlurBench(p, 0, SkBlurMaskFilter::kNormal_BlurStyle);)
OLDNEW
« no previous file with comments | « bench/BitmapRectBench.cpp ('k') | bench/ChartBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698