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

Side by Side Diff: bench/BicubicBench.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/AAClipBench.cpp ('k') | bench/BitmapBench.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 2013 Google Inc. 2 * Copyright 2013 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 "SkRandom.h" 10 #include "SkRandom.h"
(...skipping 19 matching lines...) Expand all
30 virtual const char* onGetName() { 30 virtual const char* onGetName() {
31 return fName.c_str(); 31 return fName.c_str();
32 } 32 }
33 33
34 virtual void onDraw(SkCanvas* canvas) { 34 virtual void onDraw(SkCanvas* canvas) {
35 SkPaint paint; 35 SkPaint paint;
36 this->setupPaint(&paint); 36 this->setupPaint(&paint);
37 37
38 paint.setAntiAlias(true); 38 paint.setAntiAlias(true);
39 39
40 SkMWCRandom rand; 40 SkRandom rand;
41 SkRect r = SkRect::MakeWH(40, 40); 41 SkRect r = SkRect::MakeWH(40, 40);
42 SkAutoTUnref<SkImageFilter> bicubic(SkBicubicImageFilter::CreateMitchell (fScale)); 42 SkAutoTUnref<SkImageFilter> bicubic(SkBicubicImageFilter::CreateMitchell (fScale));
43 paint.setImageFilter(bicubic); 43 paint.setImageFilter(bicubic);
44 canvas->save(); 44 canvas->save();
45 canvas->clipRect(r); 45 canvas->clipRect(r);
46 canvas->drawOval(r, paint); 46 canvas->drawOval(r, paint);
47 canvas->restore(); 47 canvas->restore();
48 } 48 }
49 49
50 private: 50 private:
51 typedef SkBenchmark INHERITED; 51 typedef SkBenchmark INHERITED;
52 }; 52 };
53 53
54 static SkBenchmark* Fact00(void* p) { return new BicubicBench(p, 10.0f, 10.0f); } 54 static SkBenchmark* Fact00(void* p) { return new BicubicBench(p, 10.0f, 10.0f); }
55 static SkBenchmark* Fact01(void* p) { return new BicubicBench(p, 2.5f, 10.0f); } 55 static SkBenchmark* Fact01(void* p) { return new BicubicBench(p, 2.5f, 10.0f); }
56 static SkBenchmark* Fact02(void* p) { return new BicubicBench(p, 10.0f, 2.5f); } 56 static SkBenchmark* Fact02(void* p) { return new BicubicBench(p, 10.0f, 2.5f); }
57 static SkBenchmark* Fact03(void* p) { return new BicubicBench(p, 2.5f, 2.5f); } 57 static SkBenchmark* Fact03(void* p) { return new BicubicBench(p, 2.5f, 2.5f); }
58 58
59 static BenchRegistry gReg00(Fact00); 59 static BenchRegistry gReg00(Fact00);
60 static BenchRegistry gReg01(Fact01); 60 static BenchRegistry gReg01(Fact01);
61 static BenchRegistry gReg02(Fact02); 61 static BenchRegistry gReg02(Fact02);
62 static BenchRegistry gReg03(Fact03); 62 static BenchRegistry gReg03(Fact03);
OLDNEW
« no previous file with comments | « bench/AAClipBench.cpp ('k') | bench/BitmapBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698