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

Side by Side Diff: bench/ShaderMaskBench.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/ScalarBench.cpp ('k') | bench/SortBench.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 "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkColorShader.h" 10 #include "SkColorShader.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 protected: 52 protected:
53 virtual const char* onGetName() { 53 virtual const char* onGetName() {
54 fName.printf("shadermask"); 54 fName.printf("shadermask");
55 fName.appendf("_%s", fontQualityName(fPaint)); 55 fName.appendf("_%s", fontQualityName(fPaint));
56 fName.appendf("_%02X", fPaint.getAlpha()); 56 fName.appendf("_%02X", fPaint.getAlpha());
57 return fName.c_str(); 57 return fName.c_str();
58 } 58 }
59 59
60 virtual void onDraw(SkCanvas* canvas) { 60 virtual void onDraw(SkCanvas* canvas) {
61 const SkIPoint dim = this->getSize(); 61 const SkIPoint dim = this->getSize();
62 SkMWCRandom rand; 62 SkRandom rand;
63 63
64 SkPaint paint(fPaint); 64 SkPaint paint(fPaint);
65 this->setupPaint(&paint); 65 this->setupPaint(&paint);
66 // explicitly need these 66 // explicitly need these
67 paint.setAlpha(fPaint.getAlpha()); 67 paint.setAlpha(fPaint.getAlpha());
68 paint.setAntiAlias(kBW != fFQ); 68 paint.setAntiAlias(kBW != fFQ);
69 paint.setLCDRenderText(kLCD == fFQ); 69 paint.setLCDRenderText(kLCD == fFQ);
70 70
71 const SkScalar x0 = SkIntToScalar(-10); 71 const SkScalar x0 = SkIntToScalar(-10);
72 const SkScalar y0 = SkIntToScalar(-10); 72 const SkScalar y0 = SkIntToScalar(-10);
(...skipping 25 matching lines...) Expand all
98 static SkBenchmark* Fact11(void* p) { return new ShaderMaskBench(p, false, kAA); } 98 static SkBenchmark* Fact11(void* p) { return new ShaderMaskBench(p, false, kAA); }
99 static SkBenchmark* Fact20(void* p) { return new ShaderMaskBench(p, true, kLCD) ; } 99 static SkBenchmark* Fact20(void* p) { return new ShaderMaskBench(p, true, kLCD) ; }
100 static SkBenchmark* Fact21(void* p) { return new ShaderMaskBench(p, false, kLCD) ; } 100 static SkBenchmark* Fact21(void* p) { return new ShaderMaskBench(p, false, kLCD) ; }
101 101
102 static BenchRegistry gReg00(Fact00); 102 static BenchRegistry gReg00(Fact00);
103 static BenchRegistry gReg01(Fact01); 103 static BenchRegistry gReg01(Fact01);
104 static BenchRegistry gReg10(Fact10); 104 static BenchRegistry gReg10(Fact10);
105 static BenchRegistry gReg11(Fact11); 105 static BenchRegistry gReg11(Fact11);
106 static BenchRegistry gReg20(Fact20); 106 static BenchRegistry gReg20(Fact20);
107 static BenchRegistry gReg21(Fact21); 107 static BenchRegistry gReg21(Fact21);
OLDNEW
« no previous file with comments | « bench/ScalarBench.cpp ('k') | bench/SortBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698