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

Side by Side Diff: bench/BitmapRectBench.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/BitmapBench.cpp ('k') | bench/BlurBench.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 "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkPaint.h" 10 #include "SkPaint.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 fDstR.offset(SK_Scalar1 / 3, SK_Scalar1 * 5 / 7); 79 fDstR.offset(SK_Scalar1 / 3, SK_Scalar1 * 5 / 7);
80 // want enough to create a scale matrix, but not enough to scare 80 // want enough to create a scale matrix, but not enough to scare
81 // off our sniffer which tries to see if the matrix is "effectively" 81 // off our sniffer which tries to see if the matrix is "effectively"
82 // translate-only. 82 // translate-only.
83 fDstR.fRight += SK_Scalar1 / (kWidth * 60); 83 fDstR.fRight += SK_Scalar1 / (kWidth * 60);
84 } 84 }
85 } 85 }
86 86
87 87
88 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { 88 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
89 SkMWCRandom rand; 89 SkRandom rand;
90 90
91 SkPaint paint; 91 SkPaint paint;
92 this->setupPaint(&paint); 92 this->setupPaint(&paint);
93 paint.setFilterBitmap(fDoFilter); 93 paint.setFilterBitmap(fDoFilter);
94 paint.setAlpha(fAlpha); 94 paint.setAlpha(fAlpha);
95 95
96 for (int i = 0; i < N; i++) { 96 for (int i = 0; i < N; i++) {
97 canvas->drawBitmapRectToRect(fBitmap, &fSrcR, fDstR, &paint); 97 canvas->drawBitmapRectToRect(fBitmap, &fSrcR, fDstR, &paint);
98 } 98 }
99 } 99 }
100 100
101 private: 101 private:
102 typedef SkBenchmark INHERITED; 102 typedef SkBenchmark INHERITED;
103 }; 103 };
104 104
105 DEF_BENCH(return new BitmapRectBench(p, 0xFF, false, false)) 105 DEF_BENCH(return new BitmapRectBench(p, 0xFF, false, false))
106 DEF_BENCH(return new BitmapRectBench(p, 0x80, false, false)) 106 DEF_BENCH(return new BitmapRectBench(p, 0x80, false, false))
107 DEF_BENCH(return new BitmapRectBench(p, 0xFF, true, false)) 107 DEF_BENCH(return new BitmapRectBench(p, 0xFF, true, false))
108 DEF_BENCH(return new BitmapRectBench(p, 0x80, true, false)) 108 DEF_BENCH(return new BitmapRectBench(p, 0x80, true, false))
109 109
110 DEF_BENCH(return new BitmapRectBench(p, 0xFF, false, true)) 110 DEF_BENCH(return new BitmapRectBench(p, 0xFF, false, true))
111 DEF_BENCH(return new BitmapRectBench(p, 0xFF, true, true)) 111 DEF_BENCH(return new BitmapRectBench(p, 0xFF, true, true))
OLDNEW
« no previous file with comments | « bench/BitmapBench.cpp ('k') | bench/BlurBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698